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

Move delete crashed runs var to Settings class #552

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

LuukBlom
Copy link
Contributor

@LuukBlom LuukBlom commented Sep 25, 2024

Usage:

from windows terminal:

set DELETE_CRASHED_RUNS=False
python floodadapt_run.py

from linux terminal:

export DELETE_CRASHED_RUNS=True
python floodadapt_run.py

from a python file

from flood_adapt.config import Settings
# Put this somewhere in initialization
Settings(
  delete_crashed_runs=False
)
... # the rest of the script

Any time Settings() is called,

  1. It first reads the arguments it was given.
  2. Then it fills unset fields with environment variables.
  3. If there are still unset fields, it will use the defaults defined in the Settings class.
  4. Then it will run all validators, and update the environment with its current state.

@LuukBlom LuukBlom requested a review from panosatha September 25, 2024 13:23
Copy link
Contributor

@panosatha panosatha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@panosatha panosatha merged commit 4aa5bb5 into main Sep 25, 2024
3 checks passed
@panosatha panosatha deleted the move-delete-crashed-runs-var-to-settings branch September 25, 2024 13:47
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