Basically these are defined in the module where they are largely used. But if we wanted to use them more widely we might run in to import issues (circular imports, etc). Would it be better to have an exceptions.py that just has this code and minimal other dependencies so that it can be imported and used PINT-wide? I don't know if this is in general a good practice or not.
It looks like PINT has 19 or so custom exceptions defined in various places:
Basically these are defined in the module where they are largely used. But if we wanted to use them more widely we might run in to import issues (circular imports, etc). Would it be better to have an
exceptions.py
that just has this code and minimal other dependencies so that it can be imported and used PINT-wide? I don't know if this is in general a good practice or not.