-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor postprocessing #82
base: dev
Are you sure you want to change the base?
Conversation
Hey @jnnr, I started refactoring. Please look at predefined calculations and tell me if you like it that way! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the new approach! I really like the modularity.
For now, I have only one comment.
I can review again after the next steps.
I could check if some parts have more implicit assumptions than desirable. The goal in this PR is to reproduce the existing postprocessed results, right? So this could happen separately.
oemoflex/model/postprocessing.py
Outdated
|
||
return inputs | ||
class InvestedStorageCapacityCosts(Calculation): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiplying ep_costs and differentiating capacity and storage_capacity is orthogonal (the latter is just a filter). So this is a bit of duplication. If it was possible to wrap calculations, this could be more clean. But not necessary for the first refactoring.
Hey @jnnr, refactored postprocessing to use string-based indexes and get component attributes from |
Thanks for your work, @henhuy! I tried to reproduce the results for an oemof-B3-scenario and found these differences:
Scalars did not change, which is good! Update: This seems to happen because the first call here alters the results for the second call. Can be fixed by reverting the order, but maybe it makes sense to understand better what is happening. oemoflex/oemoflex/model/datapackage.py Lines 327 to 329 in 9f05634
|
Thanks for checking. Which scenario did you test? I will add scenario results to tests and try to reproduce the error. |
I checked with 2050-80-gas_moreCH4. You should be able to see it with the dump you already uploaded. What we do in oemof-B3 is call |
9f05634
to
f166654
Compare
75b3059
to
e4aa0c0
Compare
Refactoring is done. @jnnr: could you check once more if your oemof-B3-scenario returns the same results? |
Have checked it and found only marginal differences (decimal round-off errors). I had to swap the order of postprocessing as suggested earlier to preserve the postprocessed timeseries. |
The 3.7 build fails as used frictionless version tries to import |
I am ok with that. oemof.solph supports 3.8 -3.10, too. |
15b1a84
to
392ddf9
Compare
…esample_mode and from/to nodes
Steps:
map_var_names
optional (activated by default)add_component_info
to be adaptable and provide default attributes