ortk95 / planetmapper

PlanetMapper: An open source Python package for visualising, navigating and mapping Solar System observations
https://planetmapper.readthedocs.io
MIT License
10 stars 1 forks source link

Accept path-like objects for path arguments (in addition to strings) #349

Closed ortk95 closed 4 months ago

ortk95 commented 4 months ago

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

See CONTRIBUTING.md for more details.

coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 8817888161

Details


Totals Coverage Status
Change from base Build 8724142762: 0.001%
Covered Lines: 2884
Relevant Lines: 2896

💛 - Coveralls