Cell inputs and outputs



I want to ask if there is a way to monitor cells in oemof. With labels it is possible to build cells in an energysystem, but I haven’t figured out a way to get a dataframe of every input and output of this cell. At first i thought this could be possible with groupings, but since now I wasn’t able to find this kind of function. So if someone knows a way to do this I would be glad to hear it.


I am not sure what you mean with ‘cells’.

The last line of the following code part gives you a pandas.DataFrame from all flow in and out the electricity bus with the label electricity_bus_of_region_1. Does this help or did I misunderstand your question?

results = outputlib.processing.results(model)
dataframe = outputlib.views.node(results, 'electricity_bus_of_region_1')

You can find the whole example here.


Sorry my fault. With cell I mean a subsystem. This subsystem should be similar to groupings. The idea would be to monitor the inputs and outputs of this subsystem, but not of the individual components. Hope now it is easier to understand what I mean.


The groupings is made to group components of the same type and build the constraint for the model.

As mentioned above, we offer some functions to group your results but as it depends heavily on your structure it is not possible to cover all cases.

If each cell has just one Bus per carrier (e.g. electricit bus, gas bus…) you could use the code I mentioned above.

If you have more Buses per carrier within a cell than you could filter all flows where the input of a flow has a different cell name than the output of this flow. That means that this flow goes from one cell to another. if you write all these flows into one (Multiindex) DataFrame you will have what you want.

I cannot be more precise because I do not know the structure of your model.


Thanks alot for the quick answer.
I wasnt sure if there is an easier way already implemented in oemof to do this. What you explained is pretty much the same I am currently working on to make this possible. So I am very glad to hear that I might be not completely wrong with my concept.


Please post your solution here if you found one or let us know if you still have problems.