Closed luigibrancati closed 1 year ago
General note: are there also more complex ways to manage state in Streamlit? Or patterns like separating state management in different files? I have looked a bit online in the documentation, but it doesn't seem so.
Another general question/idea: we could add all state variable default values to a config
file (or similar). Maybe not right now but during the final refactoring and refining phase.
@elisaliv I answered you comment and added Issue #18, but will reply here too.
As far as I can tell, Streamlit
only provides the session_state
dict-like to keep track of app state, this dict is shared between refreshes and also between different app pages. Why would we want to separate session between pages? Things like the selected_country
are used by all app pages after all.
We could define a wrapper around st.session_state
, but I'm afraid that would mostly over-complicate things.
About the session state in a config
file, I can't think of a way to do it. Config files are used to define things, not to initialize them:
config.py
file and put code to initialize the session state, we must import it in every module and will overwrite the session state with every import
Added a first UI with the following features:
I also added a CLI that starts the streamlit app. To use it, install the package with
pip install .
and runatmospheric-explorer
on a the terminal.Small changes to other modules.