Closed MaGering closed 1 year ago
Open question:
I would drop this line because attributes disappear from scalars: https://github.com/rl-institut/oemof-B3/blob/14656b04da0b4a85df8ece5bfde22986a34eb50e/scripts/create_empty_scalars.py#L53
Open question:
I would drop this line because attributes disappear from scalars:
This is dropped because these parameters are set by default (many of them are bus, from_bus, to_bus, carrier, tech e.g. parameters you do not want to specify again because they are given by the model structure). But you can change that or make that optional, of course.
Could not find the problem with the loop. Maybe you can post the error message or more info here?
Did you implement the loop and run it?
You can find my changes I've made attached in KeyError_loop_scenarios.zip
(create_empty_scalars.py
and create_empty_scalars.smk
).
The output of the console including the KeyError
can be found in file KeyError_loop_over_scenarios_component_attrs.txt
.
In component_attrs_content_first_iteration.txt
you find the content of component_attrs_update.yml
at the first loop step and in component_attrs_content_first_iteration.txt
at the second loop step.
It is also interesting that the error persists even if I insert a copy of component_attrs_update.yml
before the loop (attr_of_comp = component_attrs_update.copy()
) and overwrite component_attrs_update
in the loop with this copy. The copy then also contains the wrong data. What am I missing?
@jnnr: Should we consider this within milestone v0.0.2 or within v0.0.3?
Open question:
I would drop this line because attributes disappear from scalars:
I see now why we don't want to show these default scalars in the empty scalars but I would leave the option to have them as I did in commit https://github.com/rl-institut/oemof-B3/pull/307/commits/198a877adc1f0e98263e635791cd07904366356b. This might be handy for the user to check whether the energy model is set up in the right way and to have an overview over all the tabular attributes that exist.
Could not find the problem with the loop. Maybe you can post the error message or more info here?
Did you implement the loop and run it?
You can find my changes I've made attached in
KeyError_loop_scenarios.zip
(create_empty_scalars.py
andcreate_empty_scalars.smk
). The output of the console including theKeyError
can be found in fileKeyError_loop_over_scenarios_component_attrs.txt
. Incomponent_attrs_content_first_iteration.txt
you find the content ofcomponent_attrs_update.yml
at the first loop step and incomponent_attrs_content_first_iteration.txt
at the second loop step.It is also interesting that the error persists even if I insert a copy of
component_attrs_update.yml
before the loop (attr_of_comp = component_attrs_update.copy()
) and overwritecomponent_attrs_update
in the loop with this copy. The copy then also contains the wrong data. What am I missing?
I fixed this with commit https://github.com/rl-institut/oemof-B3/pull/307/commits/997b5742b751c062c0b183add3d8a158dd385522. I'm loading component_attrs_update
now from the original yaml file instead via the model module. Via the model module it always was overwritten with the input from oemoflex no matter what I tried (cf. comment above).
Ready for review @jnnr.
With this PR a bug in
create_empty_scalars.py
is fixed. Besides these changes the script is cleaned up.The saving function is improved to allow a potential future loop over scenarios. If there is already an empty scalars file in the destination path missing lines will be updated.
I didn't manage to loop over the scenarios in path
scenarios/
because somehow after the first iterationcomponent_attrs_update
was overwritten which led to the script erroring out. I have not been able to identify wherecomponent_attrs_update
is overwritten and have not been able to fix the error. Therefore, an empty scalars file is currently created per scenario.