Skip to content

Commit

Permalink
Refactor dataset ID handling to allow for optional integer conversion…
Browse files Browse the repository at this point in the history
… and improve environment variable parsing
  • Loading branch information
GoldenAnpu committed Dec 16, 2024
1 parent 490a1d9 commit 92d4f42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
TEAM_ID = int(os.environ['context.teamId'])
WORKSPACE_ID = int(os.environ['context.workspaceId'])
PROJECT_ID = int(os.environ['modal.state.slyProjectId'])
DATASET_ID = int(os.environ.get('modal.state.slyDatasetId', None))
DATASET_ID = os.environ.get('modal.state.slyDatasetId', None)
if DATASET_ID is not None:
DATASET_ID = int(DATASET_ID)
CHANGE_RESOLUTION = bool(strtobool(os.environ.get('modal.state.changeResolution', 'false')))
TARGET_HEIGHT = int(os.environ.get('modal.state.targetResolutionHeight'), 1280)
TARGET_WIDTH = int(os.environ.get('modal.state.targetResolutionWidth'), 720)
Expand Down

0 comments on commit 92d4f42

Please sign in to comment.