Faster Scenario loading
Loading scenarios into the calculation setup can be rather slow with large files. This could be partially because of the use of excel files, where other files types (e.g. CSV) could be faster. Furthermore, supporting additional filetypes can help in the future to avoid the excel max lines limitation (#693).
We should check why loading scenarios is slow and see if speed could be improved. Loading scenarios happens in 3 major steps (also links below):
- Checking what kind of scenario file we have (flow or parameters) (Lets assume flow scenarios because those are often so large)
- Loading the file into Pandas
- Checking the flow scenario file for missing keys
- if this is the case, it looks for matching flows by finding unique product name/activity name/location/database entries
We should profile the three steps with larger files to see what is taking most time and see if it can be optimized. If it is specifically the loading step (2) we do, this page may give some useful improvements by enabling CSV support -though I'm not expecting a 5000fold increase-. Step 3 could also be rather time consuming, and may also have options to speed things up.
1 https://github.com/LCA-ActivityBrowser/activity-browser/blob/d7c8e5f197ce25d5ff2c677765f504a330074d48/activity_browser/layouts/tabs/LCA_setup.py#L435 2 https://github.com/LCA-ActivityBrowser/activity-browser/blob/d7c8e5f197ce25d5ff2c677765f504a330074d48/activity_browser/bwutils/superstructure/excel.py#L69 3 https://github.com/LCA-ActivityBrowser/activity-browser/blob/d7c8e5f197ce25d5ff2c677765f504a330074d48/activity_browser/bwutils/superstructure/activities.py#L137
edit: also see #743 and specifically the collapsed 'outdated' part of the PR