Serialize energysystem to datapackage #97
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a draft for a function that takes an oemof.solph.EnergySytem and writes a datapackage. Maybe this is interesting for you, @Bachibouzouk.
The idea is to map oemof.solph's parameters to a data model where each type of component has its own table. Type of components means classes like
Sink
,Source
,Transformer
,GenericStorage
, with the addition that the number of outputs and inputs is distinguished. A Transformer in particular can have n inputs and m outputs, in general.(Component, None): var_name
maps to(var_name, none, none)
(bus, component): var_name
maps to(var_name, inputs, bus_n)
(component, bus): var_name
maps to(var_name, outputs, bus_n)
This leads to tables like this (GenericStorage 1 input 1 output):
The output format can in a next step be mapped to oemof.tabular. E.g. variable_costs on inputs would be carrier_costs by tabulars convention, variable_costs on outputs would be marginal_costs, so the multiindex columns would map to something like:
In another step, tabular's facades' mapping to solph in
build_solph_components
could be simplified.Some facades are quite generic: Storage, Conversion, Load, Link.
Facades with several nodes are not invertible.