LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
134 stars 50 forks source link

pre-cache dependent databases #1172

Open marc-vdm opened 6 months ago

marc-vdm commented 6 months ago

Feature request

If user opens a database, it's likely user will 1) work on modelling in that database OR 2) runs a calculation using that database.

In situation 1, it's likely user will want to open dependent databases to look for processes In situation 2, AB MUST open dependent databases for the calculation

Because of the above, it can be assumed that dependent databases end up in MetaDataStore at some point. Because of this, I suggest that when a database is opened, we subsequently also load the dependent databases into MetaDataStore in a background thread.

By loading these databases in a background thread, user does not notice these databases are loaded already, but this will increase the fast 'feel' of AB when user then opens those databases or when a calculation is done in AB.

Disadvantage of this would be that it could be complicated to load something in the background and then add it to the MetaDataStore without the user noticing.

On further thought I also suggest we always load biosphere3 in background when project is loaded, this is basically always needed.