All methods that take a path argument (e.g. Observation, Observation.save_observation, set_kernel_path) can now accept os.PathLike objects, in addition to strings. For example, these are now equivalent:
from pathlib import Path
Observation(Path('data.fits'))
Observation('data.fits')
This is mainly a change to type hints, with a few additional internal checks to ensure any path-like inputs are standardised internally to strings. Any path outputs/attributes (e.g. Observation.path) remain as strings.
Closes #348
Pull request checklist
[x] Add a clear description of the change
[x] Add any new tests needed
[x] Run spell check on new text visible to user (documentation, GUI etc.)
[x] Check any changes to requirements.txt are reflected in setup.py and conda-forge feedstock
[x] Check code passes CI checks (run run_ci.sh or check GitHub Actions)
All methods that take a path argument (e.g.
Observation
,Observation.save_observation
,set_kernel_path
) can now acceptos.PathLike
objects, in addition to strings. For example, these are now equivalent:This is mainly a change to type hints, with a few additional internal checks to ensure any path-like inputs are standardised internally to strings. Any path outputs/attributes (e.g.
Observation.path
) remain as strings.Closes #348
Pull request checklist
requirements.txt
are reflected insetup.py
and conda-forge feedstockrun_ci.sh
or check GitHub Actions)See CONTRIBUTING.md for more details.