File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ def _normalize_mesh_part_ids(
9898 volume_tags : Sequence [VolumeTag ],
9999 mpi_communicator : Optional ["mpi4py.MPI.Intracomm" ] = None ):
100100 """Convert a mesh's configuration-dependent "part ID" into a fixed type."""
101+ from numbers import Integral
101102 if VTAG_ALL not in volume_tags :
102103 # Multi-volume
103104 if mpi_communicator is not None :
@@ -123,8 +124,8 @@ def as_part_id(mesh_part_id):
123124 def as_part_id (mesh_part_id ):
124125 if isinstance (mesh_part_id , PartID ):
125126 return mesh_part_id
126- elif isinstance (mesh_part_id , int ):
127- return PartID (VTAG_ALL , mesh_part_id )
127+ elif isinstance (mesh_part_id , Integral ):
128+ return PartID (VTAG_ALL , int ( mesh_part_id ) )
128129 else :
129130 raise TypeError (f"Unable to convert { mesh_part_id } to PartID." )
130131 else :
You can’t perform that action at this time.
0 commit comments