Skip to content

Accept pathlib.Path objects as filename in Mesh#4853

Merged
connorjward merged 5 commits intofiredrakeproject:mainfrom
ZiyaSelim:check-for-Path-objects-in-mesh
Feb 3, 2026
Merged

Accept pathlib.Path objects as filename in Mesh#4853
connorjward merged 5 commits intofiredrakeproject:mainfrom
ZiyaSelim:check-for-Path-objects-in-mesh

Conversation

@ZiyaSelim
Copy link
Copy Markdown
Contributor

Description

Fixes #3424

This is done by adding a check if the filename passed to the Mesh class is of the pathlib.Path type.

Additionally the test_load_mesh.py test has be extended to test for passing such a filename to the mesh.

@ZiyaSelim ZiyaSelim marked this pull request as draft January 31, 2026 15:09
@ZiyaSelim
Copy link
Copy Markdown
Contributor Author

As mentioned in the Issue the test throws an error in the newest version of mesh.py even without any changes.

I implemented this with the docker image of firedrakeproject/firedrake this error was not thrown, as this version did not have the "problematic" line 13: from ufl.cell import CellSequence

Copy link
Copy Markdown
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

Comment thread firedrake/mesh.py Outdated
Comment thread tests/firedrake/regression/test_load_mesh.py
@ZiyaSelim ZiyaSelim requested a review from connorjward February 2, 2026 21:29
@ZiyaSelim ZiyaSelim marked this pull request as ready for review February 3, 2026 17:33
@connorjward connorjward merged commit f177a6a into firedrakeproject:main Feb 3, 2026
7 checks passed
j-bowhay pushed a commit to j-bowhay/firedrake that referenced this pull request Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants