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

Add timeseries to datapackage #20

Closed FelixMau closed 1 year ago

FelixMau commented 1 year ago

I think it will be easier to review if creation of foreign keys and saving of the DataPackage is moved to another branch to keep PRs small.

henhuy commented 1 year ago

Did some refactoring - but not finished yet (switched to draft mode). Here my ideas/changes:

Hope you can understand my ideas (as I wrote them down very quickly - sorry for that!)

henhuy commented 1 year ago

Also as a recommendation:

henhuy commented 1 year ago

Started to refactor timeseries refactor function. Not yet ready. Following things must be done: Pivot region to every column explode columns append dataframes with different timeindex using axis=0

If the tests runs successfully, this should be solved!

FelixMau commented 1 year ago

Thank you for your review and sorry for untidy code! My pre-commit checks are not automatically running, sometimes I forget to run them.

I hope I could simplify the refactor_timeseries process, yet It is somehow complicated to catch and map everything. Maybe I have overseen the correct Pandas functionality, I agree there must be some better way to directly map a new index and Pivot directly from explode but I could not ind it. I think using MultiIndexing together with stacking/unstacking would work as well but I think this approach is more complicated to understand.

Regarding setup_environment please see #19

Can you please explain further how mapping should be improved? Do you want the mapper to be able to handle the same facade differently for different Processes?