spacetelescope / stpipe

https://stpipe.readthedocs.io
Other
3 stars 25 forks source link

Support for `pathlib.Path` objects? #139

Closed vandalt closed 6 months ago

vandalt commented 7 months ago

Hi!

I was wondering if pathlib.Path objects were supported in stpipe (and packages depending on it like jwst) or if support was planned in the future.

I wanted to report an example issue I encountered recently: using a Path object as input to Step.run() leads to the _input_filename attribute not being set because the Path falls in the else category here.

The simple fix for users is to use strings as input path, but it took me a bit of time to figure this out because I missed the error message in the log.

jdavies-st commented 7 months ago

Hi @vandalt, yes pathlib.Path objects should be supported. Thanks for reporting the bug.