iris icon indicating copy to clipboard operation
iris copied to clipboard

Fully adopt pathlib.PurePath for file paths

Open SimonPeatman opened this issue 2 years ago • 2 comments

✨ Feature Request

Iris uses os.path to handle file paths, but the standard in Python 3 is to use pathlib.PurePath objects. #3411 proposed adopting pathlib.PurePath and this is partially implemented by #3917. The present issue proposes replacing os.path with the use of pathlib across the whole of Iris.

Details

#3917 implements pathlib.PurePath for the main public functions only (load, load_cube, load_cubes, load_raw and save). See https://github.com/SciTools/iris/pull/3917#pullrequestreview-846736928 for full details of what has been done and what is still to do.

SimonPeatman avatar Jan 22 '22 22:01 SimonPeatman

Is this actually closable now @SimonPeatman @wjbenfold ? Excuse my ignorance, I haven't been following detail here -- just tidying issues

pp-mo avatar Jan 26 '22 12:01 pp-mo

No, @pp-mo, this is the issue that has come out of the recent work on pathlib. We've so far introduced it "superficially" - i.e. the most frequently used bits of the public api will now accept a pathlib path but it's almost immediately converted to a string. This ticket is for the further work that would use paths all the way down (maybe converting input strings to paths) and leverage the features of paths that we currently use os for.

wjbenfold avatar Jan 26 '22 13:01 wjbenfold