xarray-contrib / datatree

WIP implementation of a tree-like hierarchical data structure for xarray.
https://xarray-datatree.readthedocs.io
Apache License 2.0
161 stars 43 forks source link

Add a `case_sensitivity` keyword arguments to methods relying on `pathlib` (Python 3.12) #292

Open etienneschalk opened 6 months ago

etienneschalk commented 6 months ago

Motive

In Python 3.12, PurePath.match, Path.glob and Path.rglob now supports a case_sensitivity argument, so that the user have full-control on the behavior of the path matching.

https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match

Changed in version 3.12: The case_sensitive parameter was added.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob

Changed in version 3.12: The case_sensitive parameter was added.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.rglob

Changed in version 3.12: The case_sensitive parameter was added.

By default, None means "use OS defaults"

typically, case-sensitive on POSIX, and case-insensitive on Windows.

Proposal: Since datatree only supports POSIX-paths, the default behaviour in datatree should be case-sensitive.

TomNicholas commented 6 months ago

Sounds good to me!