ECMWFCode4Earth / atmospheric-explorer

repository for 2023 Code for Earth project to develop a tool for exploration of CAMS atmospheric composition datasets
Apache License 2.0
3 stars 0 forks source link

Wip/first UI #15

Closed luigibrancati closed 1 year ago

luigibrancati commented 1 year ago

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 run atmospheric-explorer on a the terminal.

Small changes to other modules.

elisaliv commented 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.

luigibrancati commented 1 year ago

@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: