Skip to content

Is it possible to allow pathlib.Path to be passed as argument to Mesh()? #3424

Open
@p479h

Description

@p479h

As of right now, you must provide the file path to your .msh mesh using a python string. Since many users utilize python's built in pathlib.Path objects for indicating the mesh directory it would be nice to be able to pass them as arguments. I believe the solution could be added to firedrake/mesh.py _from_gmsh(filename, comm=None) as follows:

if isinstance(filename, Path):
    filename = filename.as_posix()

Or something similar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions