Closed brynpickering closed 9 months ago
The new global expressions (particularly the flow_in_inc_eff
/flow_out_inc_eff
ones) increase the memory footprint of models since they keep more unique pyomo objects in memory. For the example models (1yr):
urban scale: 14% increase national scale: 2% increase
^ I would guess that this is the effect of the extra carriers in the urban scale model.
The linux py3.9 failure is due to type hinting (I'm surprised it took this long for it to have a problem with my use of pipes for unions). See #519 for proposal to kill py3.9 in favour of py3.12 support.
Attention: 33 lines
in your changes are missing coverage. Please review.
Comparison is base (
3b84476
) 93.42% compared to head (7592368
) 94.98%.
This is a biggie.
Fixes issue #324 Fixes issue #441 Fixes issue #337 Fixes issue #362 Fixes issue #263 Fixes issue #230
Adresses discussions #483, #484,
Summary of changes in this pull request:
tech_group
inheritance, mainly).parent
strictly one of the abstract base groups.inherit
, withnodes
having the option to also inherit fromnode_groups
._plus
techs removed as per #483, with the option to include lists of carriers in/out (technically for any technology, but one has to be very careful over which carriers they define their other parameters if doing so) and to invokestorage
of flows in for all butdemand
technologies (this could be updated to also include demand techs).node
/tech
groups, for instance.flow_cap
indexed over carriers now thatconversion_plus
has gone. This required quite a few base math changes and can make it difficult to know what happens when you define a parameter without subsetting its carriers (e.g., if you setflow_cap_max: 5
for a conversion tech, that will apply to all carriers in AND out. You have to usedims/index
structure to limit it to e.g., one of the output carrier flows).Summary of things still to do:
EDIT: done some
* Fixone_way
parameter so it actually does something (I know how, just need to do it)* Add docstrings (sorry sorry)Add test for new helper function which handles referencing a variable/expression that may not be built for a given model (e.g., referencing `storage_cap cost_storage_cap` when the model includes no techs with storage)* Add check for referencing transmission techs in nodes - this should not be allowed.Add check for referencing a differentparent
in different nodes. Although it's technically OK to do this, having to infer the number of dimensions on the resulting array is a pain (ideally they are only* indexed overtechs
).Things that I won't do in this PR
cost_...: 5
as being indexed overmonetary
. I think I'd prefer to avoid this magic.lookup
arrays more obvious to the user, rather than a module-level variable inpreprocess/model_data.py
, and add the ability to update it.Reviewer checklist: