Bw2io excel import for temporal distributions#177
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #177 +/- ##
===========================================
+ Coverage 59.39% 72.56% +13.17%
===========================================
Files 8 9 +1
Lines 1384 1520 +136
===========================================
+ Hits 822 1103 +281
+ Misses 562 417 -145 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
One upside to having similar fields to uncertainty data is that that way, it's easier to "input" the data in the excel directly, as you can use the convenience functions for e.g. uniform, normal, triangular etc. distributions that are currently built into bw_temporalis. In the current approach here, you'd need to directly input all dates and amounts "manually", no? |
Yes, I agree. This upside could weigh enough to argue in favour of a input format with the uncertainty-structure. a work-around within the current implementation would be to create complicated TDs using the convenience functions built into bw_temporalis in code, then use the .to_json() to print the corresponding json-formats and paste in the excel. But that's not super user-friendly. |
|
Ok, if you want you can have a look. Please install bw2io from https://github.com/jakobsarthur/brightway2-io/tree/temporal_distribution, do a fresh pull from this branch for the updated excel file and have a look. Remaining todo would e the dpcumentation for timex. |
works with using the new TD import strategies on my forked branch of bw2io (https://github.com/muelleram/brightway2-io/tree/td_excel_import).
I think it can be discussed if the proposed json format for the import is the best solution. I proposed it because we can then use the bw_temporalis method .from_json() to create TDs, and don't have to write a separate method.
I also think this format is better than an one similar to uncertainty, as proposed in trails (https://trails.readthedocs.io/en/latest/user_guide.html#trails-specific-temporal-fields) because it contains less fields, which i hope is potentially less confusing to the user. But happy to discuss this.
The PR contains additional code for the excel import in our notebook and a excel for the standalone case study. This works on my computer.