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

Uninformative error messages, when loading models from wrong paths #290

Closed Sheshuk closed 6 months ago

Sheshuk commented 10 months ago

When running models' loaders with the wrong path, we get all kinds of exceptions, but not the FileNotFoundError. For example:

from snewpy.models import loaders

loaders.Tamborra_2014('/path/to/models/s15')

raises InconsistentTableError

and

loaders.Fornax_2021('/path/to/models/s15')

raises IndexError: list index out of range (because it failed to parse the filename, splitting it to tokens).

Suggestion

We should make sure that the models raise FileNotFoundError when the path is wrong.