telegraphic / pygdsm

Python interface to Global Diffuse Sky Models (GDSM) for the radio sky between 10 MHz - 5 THz
MIT License
30 stars 7 forks source link

Replace `match` with if/else logic to restore compatiibility with earlier Python versions #29

Open sjoerd-bouma opened 5 months ago

sjoerd-bouma commented 5 months ago

The __init__.py currently uses the match statement, which was introduced only in Python 3.10. Unfortunately, this means pygdsm is incompatible with earlier Python versions, in particular on clusters etc. where upgrading may not be straightforward. As far as I could tell, the match statement was in fact the only source of incompatibility with older Python versions, so here my suggestion to replace it with if/else logic instead.

I have verified this works on a local Python 3.6 installation. I have also added the python_requires argument to the setup.cfg file, as I think this is how pip can tell which Python versions are supported. I suppose the version number also has to be bumped before this can be released, but I am not sure exactly how/if you would like to proceed from here : )

what-the-diff[bot] commented 5 months ago

PR Summary