diff --git a/pygdsm/__init__.py b/pygdsm/__init__.py index 7b53832..717e4f0 100644 --- a/pygdsm/__init__.py +++ b/pygdsm/__init__.py @@ -35,17 +35,18 @@ def init_gsm(gsm_name: str='gsm08'): sky_model (various): Corresponding sky model """ gsm_name = gsm_name.lower().strip() - match gsm_name: - case 'gsm': # Shorthand for GSM08 - return GlobalSkyModel() - case 'gsm08': - return GlobalSkyModel() - case 'gsm16': - return GlobalSkyModel16() - case 'lfsm': - return LowFrequencySkyModel() - case 'haslam': - return HaslamSkyModel() + if gsm_name == 'gsm': # Shorthand for GSM08 + return GlobalSkyModel() + elif gsm_name == 'gsm08': + return GlobalSkyModel() + elif gsm_name == 'gsm16': + return GlobalSkyModel16() + elif gsm_name == 'lfsm': + return LowFrequencySkyModel() + elif gsm_name == 'haslam': + return HaslamSkyModel() + else: + raise ValueError(f'Invalid model specification "{gsm_name}"') def init_observer(gsm_name: str='gsm08'): @@ -68,14 +69,16 @@ def init_observer(gsm_name: str='gsm08'): observer (various): Corresponding sky model observer """ gsm_name = gsm_name.lower().strip() - match gsm_name: - case 'gsm': # Shorthand for GSM08 - return GSMObserver() - case 'gsm08': - return GSMObserver() - case 'gsm16': - return GSMObserver16() - case 'lfsm': - return LFSMObserver() - case 'haslam': - return HaslamObserver() \ No newline at end of file + + if gsm_name == 'gsm': # Shorthand for GSM08 + return GSMObserver() + elif gsm_name == 'gsm08': + return GSMObserver() + elif gsm_name == 'gsm16': + return GSMObserver16() + elif gsm_name == 'lfsm': + return LFSMObserver() + elif gsm_name == 'haslam': + return HaslamObserver() + else: + raise ValueError(f'Invalid model specification "{gsm_name}"') \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 8b09a37..09c4c7c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,9 @@ universal=1 [metadata] description_file=README.md +[options] +python_requires = >=3.6 + [aliases] test=pytest diff --git a/setup.py b/setup.py index 9a89064..dde423b 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,10 @@ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', ],