Purpose
It would be convenient to be able to analyze Scenarios with downloaded data even when we cannot access the server.
Design idea
I think we can follow the existing design pattern, where we look for data either in ~/ScenarioData or on the server, except in this case we prioritize the server first instead of the local folder (since the ScenarioList file changes, while PF/PG/profiles are mostly constant once they're created).
- Every time we successfully instantiate a Scenario, we cache a copy of ScenarioList.csv in
~/ScenarioData.
- Every time we attempt to load an existing Scenario (e.g. anything but
Scenario('')), we add a try/except block around the getting of the ScenarioList from the server. If we cannot read from the server, either:
- we explicitly ask the user via an
input() call whether they want to continue in a read-only fashion using the cached data in ~/ScenarioData, or
- we have an optional parameter to the
Scenario init (default False) which will use a locally cached ScenarioList if one is available.
Purpose
It would be convenient to be able to analyze Scenarios with downloaded data even when we cannot access the server.
Design idea
I think we can follow the existing design pattern, where we look for data either in
~/ScenarioDataor on the server, except in this case we prioritize the server first instead of the local folder (since the ScenarioList file changes, while PF/PG/profiles are mostly constant once they're created).~/ScenarioData.Scenario('')), we add atry/exceptblock around the getting of the ScenarioList from the server. If we cannot read from the server, either:input()call whether they want to continue in a read-only fashion using the cached data in~/ScenarioData, orScenarioinit (defaultFalse) which will use a locally cached ScenarioList if one is available.