Skip to content

Commit

Permalink
fix: download match/case statement
Browse files Browse the repository at this point in the history
  • Loading branch information
seballgeyer committed Sep 4, 2024
1 parent 03a3c6f commit 87944c1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions gnssanalysis/gn_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,13 +890,11 @@ def download_atx(download_dir: _Path, reference_frame: str = "IGS20", if_file_pr
:raises ValueError: If an invalid option is given for reference_frame variable
:return _Path: The pathlib.Path of the downloaded file
"""
match reference_frame:
case "IGS20":
atx_filename = "igs20.atx"
case "IGb14":
atx_filename = "igs14.atx"
case _:
raise ValueError("Invalid value passed for reference_frame var. Must be either 'IGS20' or 'IGb14'")
reference_frame_to_filename = {"IGS20": "igs20.atx", "IGb14": "igs14.atx"}
try:
atx_filename = reference_frame_to_filename[reference_frame]
except KeyError:
raise ValueError("Invalid value passed for reference_frame var. Must be either 'IGS20' or 'IGb14'")

ensure_folders([download_dir])

Expand Down

0 comments on commit 87944c1

Please sign in to comment.