MannLabs / alphapeptstats

Python Package for the downstream analysis of mass-spectrometry-based proteomics data
https://alphapeptstats.readthedocs.io/en/latest/
Apache License 2.0
56 stars 12 forks source link

Bookkeeping of session state variables #291

Open JuliaS92 opened 2 weeks ago

JuliaS92 commented 2 weeks ago

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.