Skip to content

Commit

Permalink
Fix import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ampdes committed Aug 16, 2024
1 parent ede32a2 commit c9c85aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion python/test/unit/io/test_adios2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from dolfinx import default_real_type, default_scalar_type
from dolfinx.fem import Function, assemble_scalar, form, functionspace
from dolfinx.graph import adjacencylist
from dolfinx.io import ADIOS2, read_mesh, write_mesh
from dolfinx.mesh import CellType, GhostMode, create_mesh, create_unit_cube, create_unit_square


Expand Down Expand Up @@ -47,6 +46,9 @@ def generate_mesh(dim: int, simplex: bool, N: int = 5, dtype=None):
@pytest.mark.parametrize("dim", [2, 3])
@pytest.mark.parametrize("simplex", [True, False])
def test_mesh_read_write(encoder, suffix, ghost_mode, dtype, dim, simplex, tmp_path):
"Test writing of a mesh"
from dolfinx.io import ADIOS2, read_mesh, write_mesh

N = 5
# Consistent tmp dir across processes
fname = MPI.COMM_WORLD.bcast(tmp_path, root=0)
Expand Down
6 changes: 3 additions & 3 deletions python/test/unit/io/test_xdmf_meshtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later

from pathlib import Path
from xml.etree import ElementTree
from xml.etree import ElementTree as ET

from mpi4py import MPI

Expand Down Expand Up @@ -93,8 +93,8 @@ def test_3d(tempdir, cell_type, encoding):
facets_local = comm.allreduce(
(mt.indices < mesh.topology.index_map(2).size_local).sum(), op=MPI.SUM
)
parser = ElementTree.XMLParser()
tree = ElementTree.parse(Path(tempdir, "meshtags_3d_out.xdmf"), parser)
parser = ET.XMLParser()
tree = ET.parse(Path(tempdir, "meshtags_3d_out.xdmf"), parser)
num_lines = int(tree.findall(".//Grid[@Name='lines']/Topology")[0].get("NumberOfElements"))
num_facets = int(tree.findall(".//Grid[@Name='facets']/Topology")[0].get("NumberOfElements"))
assert num_lines == lines_local
Expand Down

0 comments on commit c9c85aa

Please sign in to comment.