Skip to content
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

Serialize energysystem to datapackage #97

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Conversation

jnnr
Copy link
Member

@jnnr jnnr commented Feb 15, 2023

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):

-- -- -- -- -- -- -- -- --
var_name label storage_capacity bus_1 bus_2 nominal_value nominal_value variable_costs variable_costs
direction None None inputs outputs inputs outputs inputs outputs
connection None None None   bus_1 bus_2 bus_1 bus_2
  storage-1 100 gas gas 1 1 0 22
  storage-2 22 electricity-1 electricity-1 1 1 0 22
  storage-3 120 electricity-2 electricity-2 1 1 0 22

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:

l label storage_capacity from_bus to_bus from_capacity to_capacity carrier_cost marginal_cost

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant