Skip to content

feature: broader path-like support #1729

@wpbonelli

Description

@wpbonelli

Is your feature request related to a problem? Please describe.
FloPy currently expects strings for some path parameters (files/dirs to read from or write to, etc). #1712 recently added support for pathlib.Path to some internals, allowing path-like objects to be passed e.g. to MFSimulation's ctor.

Describe the solution you'd like
Extending path-like support to all user-facing APIs would be convenient for use with modern pathlib.Path, removing the need to wrap with str(...), without breaking existing string usages. Type hint Union[str, os.PathLike] could be used in the spirit of PEP 519 — further SO discussions here and here. In many cases Path/path-like are already implicitly supported and docstrings could just be updated, but this is not universally true and some refactoring would be needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions