sedos-project / data_adapter_oemof

This respository holds the data adapters to connect oemof with the OEDatamodel-concrete.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Adding bus to parametrized elements iterative #35

Closed FelixMau closed 1 year ago

FelixMau commented 1 year ago

Working towards #31 Adding busses by calling get_bus from Mapper iterative. Please confirm that each component within an Element should have the same busses.

Slightly related change: removed cls parameter from get_default and get bus since the class is stored in Mapper as adapter anyway.

Ps.: Sorry for missing pre-commit run.

henhuy commented 1 year ago

PR looks good to me. Good catch that you removed cls from Mapper class! But I don't understand your question:

Please confirm that each component within an Element should have the same busses.

Could you explain it again? thx

FelixMau commented 1 year ago

PR looks good to me. Good catch that you removed cls from Mapper class! But I don't understand your question:

Please confirm that each component within an Element should have the same busses.

Could you explain it again? thx

Sure :) If one component ("each row within the scalars") within a Element would need different busses I would not be able to catch them because I call Mapper.get_busses() outside of the loop and with the last component. I don't think this would be a problem and I've made that decision for a little runtime advantage and to not build large lists. The .get_bus function would not make any difference between the components. But if we would be changing this we could face some issues that are maybe not easy to debug?

henhuy commented 1 year ago

If one component ("each row within the scalars") within a Element would need different busses I would not be able to catch them because I call Mapper.get_busses() outside of the loop and with the last component.

Oh okay. You are right - and indeed this could be the very case! Thus, it would be good if you could gather busses for each row in a process and concat and unique them later...