While i was seeing if the 'data' folder was being used in the code, i found that there was a place in io where a relative path was used that would fail if the package wasn't being run from the repository root (ie. in cases where one installs from PyPI or etc.). The real way to do this would be to have a CALIBRATION_DIR in prefs that allows the user to set where their calibration files are, but this PR does some basic path safety stuff:
if given an absolute path, use it
if given a relative path that can be resolved to being from the root of the repository/directory containing 'pvp', do that (currently paths are given as pvp/io/... so not quite a relative path from the root of the package).
if neither of those are true, try to load the relative path
if that fails, raise an exception with informative error message
before i merge i wanted to make sure with y'all that this doesn't break the actual system
While i was seeing if the 'data' folder was being used in the code, i found that there was a place in
io
where a relative path was used that would fail if the package wasn't being run from the repository root (ie. in cases where one installs from PyPI or etc.). The real way to do this would be to have aCALIBRATION_DIR
inprefs
that allows the user to set where their calibration files are, but this PR does some basic path safety stuff:pvp/io/...
so not quite a relative path from the root of the package).before i merge i wanted to make sure with y'all that this doesn't break the actual system