Found while building the #269 reproducer matrix (2026-07-23).
uw.discretisation.Mesh("file.msh") — loading a gmsh file directly, without passing coordinate_system_type= — leaves mesh.CoordinateSystemType = None. Any subsequent mesh.write() / mesh.write_timestep() then crashes writing the metadata block in Mesh.write:
coordinates_type_dict = {
"name": self.CoordinateSystemType.name, # AttributeError: 'NoneType' object has no attribute 'name'
"value": self.CoordinateSystemType.value,
}
Reproducer:
import underworld3 as uw
tmp = uw.meshing.UnstructuredSimplexBox(minCoords=(0,0), maxCoords=(1,1), cellSize=0.2, filename="/tmp/box.msh")
del tmp
mesh = uw.discretisation.Mesh("/tmp/box.msh")
mesh.write("/tmp/box.h5") # AttributeError
Workaround: load via _from_gmsh + Mesh(plex, coordinate_system_type=uw.coordinates.CoordinateSystemType.CARTESIAN, ...) (the Spiegelman-benchmark pattern), which sets the type explicitly.
Suggested fix: either default the coordinate system to CARTESIAN when loading a plain gmsh file (matching what the uw.meshing.* constructors do), or make Mesh.write tolerate/refuse-legibly a missing coordinate system rather than tracebacking in the metadata writer.
Underworld development team with AI support from Claude Code
Found while building the #269 reproducer matrix (2026-07-23).
uw.discretisation.Mesh("file.msh")— loading a gmsh file directly, without passingcoordinate_system_type=— leavesmesh.CoordinateSystemType = None. Any subsequentmesh.write()/mesh.write_timestep()then crashes writing the metadata block inMesh.write:Reproducer:
Workaround: load via
_from_gmsh+Mesh(plex, coordinate_system_type=uw.coordinates.CoordinateSystemType.CARTESIAN, ...)(the Spiegelman-benchmark pattern), which sets the type explicitly.Suggested fix: either default the coordinate system to CARTESIAN when loading a plain gmsh file (matching what the
uw.meshing.*constructors do), or makeMesh.writetolerate/refuse-legibly a missing coordinate system rather than tracebacking in the metadata writer.Underworld development team with AI support from Claude Code