Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookkeeping of session state variables #291

Closed
wants to merge 9 commits into from
Closed

Conversation

JuliaS92
Copy link
Collaborator

@JuliaS92 JuliaS92 commented Aug 28, 2024

As by a suggestion from Magnus, we should introduce a class to keep track of all session_state keys used throughout the app and replace all instances of accessing the keys with a reference to this class.

Turn this:
if 'dataset' in st.session_state

into this:

class SessionStateKeys:
    DATASET = 'dataset

if SessionStateKeys.DATASET in st.session_state

This way we can easily look up all references to that state and we have an overview of all keys used throughout the app.

I implemented this for the data import page.

Please check if this looks as intended Magnus, and if you think this might be breaking at other points in the app Mikhail.

@mschwoer
Copy link
Contributor

done in #326

@mschwoer mschwoer closed this Sep 20, 2024
@mschwoer mschwoer deleted the bookkeeping branch September 20, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants