roman-corgi / corgidrp

Data Reduction Pipeline for the Roman Coronagraph Instrument
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Updating contributor guide with path handling notes and possibly add glob wrapper #199

Open dsavransky opened 2 months ago

dsavransky commented 2 months ago

Is your feature request related to a problem? Please describe. File handling on different platforms may result in different results in terms of file list ordering. Case sensitive vs. insensitive filesystems may also result in different outcomes to the same file handling operations. Clear standards are required to ensure that corgidrp always acts consistently across all platforms and when repeating the same operation.

Describe the solution you'd like Two proposals: 1) Expand the contributing guide in the README to have explicit statements about file and path handling. Most importantly: all path operations should be done via pathlib (https://docs.python.org/3/library/pathlib.html) and/or os.path (https://docs.python.org/3/library/os.path.html#module-os.path).

2) glob, os.walk, and os.listdir have no strong guarantees on ordering of returned filepath lists. It may be useful to have a wrapper of one or all of these as part of corgidrp that returns filepaths in a preferred ordering, and to mandate use of this in all internals.