SNEWS2 / snewpy

A Python package for working with supernova neutrinos
https://snewpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

Use importlib functions compatible with Python < 3.10 #200

Closed sybenzvi closed 2 years ago

sybenzvi commented 2 years ago

The model_downloader module currently uses the files interface from importlib.resources to access the YAML configuration file specifying the remote location of model data. This interface is only available as of Python 3.10. Provide a solution that is backwards compatible to Python 3.7.

sybenzvi commented 2 years ago

Fixed by using the open_text function of importlib.resources, which has legacy support in Python 3.10 and does not appear to be deprecated.