Conversation
|
Might be a good one for @HarmonicReflux to review (i.e. work through the new notebooks and make sure you're able to replicate the results) |
|
Pesky regression tests failing on macos - not sure what to do about this... |
|
The tests appear not to be running... Does anyone have any idea why? |
|
No idea. They were running yesterday, I think. |
|
I've just closed and re-open the PR. That has triggered the workflows again. |
|
And now, everything fails... :( |
|
Numpy 2.0, yay! |
|
Here we go... |
|
FYI There's a |
alexdewar
left a comment
There was a problem hiding this comment.
I've made various small suggestions about parts of the text. On the whole, it looks great though!
I think this PR could have been broken up a bit more though. Personally I think it would be fine to do one PR per tutorial -- and it makes it a bit easier to digest.
| @@ -61,7 +61,7 @@ | |||
| "cell_type": "markdown", | |||
| "metadata": {}, | |||
| "source": [ | |||
| "We will now save this file and run the new simulation model using the following command in Anaconda prompt:\n", | |||
| "We will now save this file and run the new simulation model using the following command-line prompt:\n", | |||
| "\n", | |||
| " python -m muse settings.toml\n", | |||
There was a problem hiding this comment.
I'm wondering whether we should be telling people to run muse settings.toml instead these days. It looks like there are various places where we suggest running python -m muse... worth opening an issue for? What do you think @dalonsoa?
|
I've only just noticed that we're not pinning dependency versions... yikes. How about for now we just change the numpy requirement to be |
|
PS I tried the diff --git a/src/muse/quantities.py b/src/muse/quantities.py
index 604286d5..1fa4cad8 100644
--- a/src/muse/quantities.py
+++ b/src/muse/quantities.py
@@ -574,7 +574,7 @@ def supply_cost(
else:
data = data.groupby("region").sum(asset_dim)
- total = data.production.where(np.abs(data.production) > 1e-15, np.infty).sum(
+ total = data.production.where(np.abs(data.production) > 1e-15, np.inf).sum(
"timeslice"
)
return data.prices / total |
|
Thanks @alexdewar for the good points! I've made the changes you suggested. Yeah, I agree that I should have broken this up a bit more into multiple PRs - my bad. Hopefully future changes will be smaller. I've pinned numpy to <2.0 (and opened #345), but I'm still having issues with some of the tests (unrelated to numpy 2.0). It's just that some of the results on macos are ever-so-slightly different to the expected results, but I don't know why this is or how to fix it (maybe we just need to change the tolerance?) I've seen issues like this before and usually you can fix it by re-running the tests, but this seems particularly stubborn... |
Nw!
I think increasing the tolerance might be the way we have to go. Unfortunately there are subtle differences in the way different processor manufacturers design their floating-point units and so you often get slightly different results on Intel/AMD/ARM. (Come to think of it, I've got an AMD processor here, so maybe I should try running the regression tests too...) |
|
Fixed the failing tests by increasing rtol to |
Description
This PR makes a number of changes to the tutorial notebooks and underlying models. The tutorials are by no means finished, this is more just a step in the right direction, but this PR is getting quite large now (sorry), so I think it's worth reviewing and merging.
The main purpose of this PR was to update the text in the notebooks to make sure they have all the information needed to replicate the results. I have also made a few changes (simplifications) to the underlying models which will hopefully make it easier for users to follow the tutorials.
At some point we will want someone with domain knowledge to go through all of these and make sure they make sense, but I think this can wait until the remaining issues are completed.
Main things still to do:
Summary of changes:
General changes:
Section 4:
Section 8.1:
defaultexcluded_commoditiesinsettings.tomlSection 8.2:
Section 8.4:
forecastparameter insettings.tomlSection 8.5:
Section 8.6:
Section 8.7:
default_timeslicesmodel. This is a change compared to before, wheredefaultwas the starting point, and should make it much easier for the userMinimumServiceFactorto zero by default (this will be unecessary once ChangeMinimumServiceFactorfordefault_timeslicesmodel #334 is done)It's probably easiest to review by taking a glance at the documentation site for this branch (here), but bear in mind that tutorials 2 and 7 won't make much sense until the remaining issues are fixed
Fixes #311
Type of change
Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.
Key checklist
$ python -m pytest$ python -m sphinx -b html docs docs/buildFurther checks