Skip to content

Commit 1a53cd1

Browse files
committed
Rename package
1 parent 925bcc5 commit 1a53cd1

25 files changed

Lines changed: 195 additions & 195 deletions

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
parallel = true
3-
source = adios4dolfinx
3+
source = io4dolfinx
44

55
[html]
66
directory= htmlcov

docs/backends/adios2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ADIOS2-backend
22
--------------
33

4-
.. automodule:: adios4dolfinx.backends.adios2.backend
4+
.. automodule:: io4dolfinx.backends.adios2.backend
55
:members:
66
:exclude-members: read_point_data

docs/backends/h5py.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
H5PY-backend
22
-------------
33

4-
.. automodule:: adios4dolfinx.backends.h5py.backend
4+
.. automodule:: io4dolfinx.backends.h5py.backend
55
:members:
66
:exclude-members: read_point_data

docs/backends/pyvista.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PyvVsta-backend
22
----------------
33

4-
.. automodule:: adios4dolfinx.backends.pyvista.backend
4+
.. automodule:: io4dolfinx.backends.pyvista.backend
55
:members:
66
:exclude-members: read_attributes, read_timestamps, write_attributes, write_mesh, write_meshtags, read_meshtags_data, read_dofmap, read_dofs, read_cell_perms, write_function, read_legacy_mesh, snapshot_checkpoint, read_hdf5_array

docs/backends/xdmf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
XDMF-backend
22
-------------
33

4-
.. automodule:: adios4dolfinx.backends.xdmf.backend
4+
.. automodule:: io4dolfinx.backends.xdmf.backend
55
:members:
66
:exclude-members: read_attributes, read_timestamps, write_attributes, write_mesh, write_meshtags, read_meshtags_data, read_dofmap, read_dofs, read_cell_perms, write_function, read_legacy_mesh, snapshot_checkpoint, read_hdf5_array

docs/original_checkpoint.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# # Checkpoint on input mesh
22
# As we have discussed earlier, one can choose to store function data in a way that
3-
# is N-to-M compatible by using {py:func}`adios4dolfinx.write_checkpoint`.
3+
# is N-to-M compatible by using {py:func}`io4dolfinx.write_checkpoint`.
44
# This stores the distributed mesh in it's current (partitioned) ordering, and does
55
# use the original input data ordering for the cells and connectivity.
66
# This means that you cannot use your original mesh (from `.xdmf` files) or mesh tags
@@ -10,7 +10,7 @@
1010
# An optional way of store an N-to-M checkpoint is to store the function data in the same
1111
# ordering as the mesh. The write operation will be more expensive, as it requires data
1212
# communication to ensure contiguous data being written to the checkpoint.
13-
# The method is exposed as {py:func}`adios4dolfinx.write_function_on_input_mesh`.
13+
# The method is exposed as {py:func}`io4dolfinx.write_function_on_input_mesh`.
1414
# Below we will demonstrate this method.
1515

1616
# +
@@ -65,18 +65,18 @@ def write_function(
6565

6666
import dolfinx
6767

68-
import adios4dolfinx
68+
import io4dolfinx
6969

7070
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, mesh_filename, "r") as xdmf:
7171
mesh = xdmf.read_mesh()
7272
V = dolfinx.fem.functionspace(mesh, element)
7373
u = dolfinx.fem.Function(V)
7474
u.interpolate(f)
7575

76-
adios4dolfinx.write_function_on_input_mesh(
76+
io4dolfinx.write_function_on_input_mesh(
7777
function_filename.with_suffix(".bp"),
7878
u,
79-
mode=adios4dolfinx.FileMode.write,
79+
mode=io4dolfinx.FileMode.write,
8080
time=0.0,
8181
name="Output",
8282
)
@@ -112,13 +112,13 @@ def verify_checkpoint(
112112
import dolfinx
113113
import numpy as np
114114

115-
import adios4dolfinx
115+
import io4dolfinx
116116

117117
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, mesh_filename, "r") as xdmf:
118118
in_mesh = xdmf.read_mesh()
119119
V = dolfinx.fem.functionspace(in_mesh, element)
120120
u_in = dolfinx.fem.Function(V)
121-
adios4dolfinx.read_function(function_filename.with_suffix(".bp"), u_in, time=0.0, name="Output")
121+
io4dolfinx.read_function(function_filename.with_suffix(".bp"), u_in, time=0.0, name="Output")
122122

123123
# Compute exact interpolation
124124
u_ex = dolfinx.fem.Function(V)

docs/snapshot_checkpoint.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# does not require extra RAM.
1313

1414
# In this example, we will demonstrate how to write a
15-
# {py:func}`snapshot checkpoint<adios4dolfinx.snapshot_checkpoint>` to disk.
15+
# {py:func}`snapshot checkpoint<io4dolfinx.snapshot_checkpoint>` to disk.
1616

1717
# First we define a {py:class}`function<dolfinx.fem.Function>` `f` that we want to represent in
1818
# the {py:class}`function space<dolfinx.fem.FunctionSpace>`.
@@ -33,7 +33,7 @@ def f(x):
3333
# -
3434

3535
# Next, we create a mesh and an appropriate function space and read and write from file.
36-
# Note that for both these operations, we use {py:func}`adios4dolfinx.snapshot_checkpoint`,
36+
# Note that for both these operations, we use {py:func}`io4dolfinx.snapshot_checkpoint`,
3737
# with different read and write modes.
3838

3939

@@ -43,20 +43,20 @@ def read_write_snapshot(filename: Path):
4343
import dolfinx
4444
import numpy as np
4545

46-
import adios4dolfinx
46+
import io4dolfinx
4747

4848
mesh = dolfinx.mesh.create_unit_cube(MPI.COMM_WORLD, 3, 7, 4)
4949
V = dolfinx.fem.functionspace(mesh, ("Lagrange", 5))
5050
u = dolfinx.fem.Function(V)
5151
u.interpolate(f)
5252
u.name = "Current_solution"
5353
# Next, we store the solution to file
54-
adios4dolfinx.snapshot_checkpoint(u, filename, adios4dolfinx.FileMode.write)
54+
io4dolfinx.snapshot_checkpoint(u, filename, io4dolfinx.FileMode.write)
5555

5656
# Next, we create a new function and load the solution into it
5757
u_new = dolfinx.fem.Function(V)
5858
u_new.name = "Read_solution"
59-
adios4dolfinx.snapshot_checkpoint(u_new, filename, adios4dolfinx.FileMode.read)
59+
io4dolfinx.snapshot_checkpoint(u_new, filename, io4dolfinx.FileMode.read)
6060

6161
# Next, we verify that the solution is correct
6262
np.testing.assert_allclose(u_new.x.array, u.x.array, atol=np.finfo(float).eps)

docs/time_dependent_mesh.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import ipyparallel as ipp
1818

19-
import adios4dolfinx
19+
import io4dolfinx
2020

2121

2222
def compute_volume(mesh, time_stamp):
@@ -39,7 +39,7 @@ def write_meshes(filename: Path):
3939
import dolfinx
4040
import numpy as np
4141

42-
import adios4dolfinx
42+
import io4dolfinx
4343

4444
# Create a unit cube
4545
mesh = dolfinx.mesh.create_unit_cube(
@@ -52,15 +52,15 @@ def write_meshes(filename: Path):
5252
)
5353

5454
# Write mesh to file, associated with time stamp 1.5
55-
adios4dolfinx.write_mesh(filename, mesh, time=1.5)
55+
io4dolfinx.write_mesh(filename, mesh, time=1.5)
5656
compute_volume(mesh, 1.5)
5757
mesh.geometry.x[:, 0] += 0.1 * mesh.geometry.x[:, 0]
5858
mesh.geometry.x[:, 1] += 0.3 * mesh.geometry.x[:, 1] * np.sin(mesh.geometry.x[:, 2])
5959
compute_volume(mesh, 3.3)
6060
# Write mesh to file, associated with time stamp 3.3
6161
# Note that we set the mode to append, as we have already created the file
6262
# and we do not want to overwrite the existing data
63-
adios4dolfinx.write_mesh(filename, mesh, time=3.3, mode=adios4dolfinx.FileMode.append)
63+
io4dolfinx.write_mesh(filename, mesh, time=3.3, mode=io4dolfinx.FileMode.append)
6464

6565

6666
# -
@@ -82,14 +82,14 @@ def write_meshes(filename: Path):
8282

8383
# # Reading a time dependent mesh
8484
# The only thing we need to do to read the mesh is to send in the associated time stamp,
85-
# which we do by adding `time=time_stamp` when calling {py:func}`adios4dolfinx.read_mesh`.
85+
# which we do by adding `time=time_stamp` when calling {py:func}`io4dolfinx.read_mesh`.
8686

87-
second_mesh = adios4dolfinx.read_mesh(
87+
second_mesh = io4dolfinx.read_mesh(
8888
mesh_file, comm=MPI.COMM_WORLD, backend="adios2", backend_args={"engine": "BP4"}, time=3.3
8989
)
9090
compute_volume(second_mesh, 3.3)
9191

92-
first_mesh = adios4dolfinx.read_mesh(
92+
first_mesh = io4dolfinx.read_mesh(
9393
mesh_file, comm=MPI.COMM_WORLD, backend="adios2", backend_args={"engine": "BP4"}, time=1.5
9494
)
9595
compute_volume(first_mesh, 1.5)

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
requires = ["setuptools>=61.0.0", "wheel"]
33

44
[project]
5-
name = "adios4dolfinx"
5+
name = "io4dolfinx"
66
version = "0.11.0.dev0"
77
description = "Checkpointing functionality for DOLFINx meshes/functions with ADIOS2"
88
authors = [{ name = "Jørgen S. Dokken", email = "dokken@simula.no" }]
@@ -15,9 +15,9 @@ test = [
1515
"pytest",
1616
"coverage",
1717
"ipyparallel",
18-
"adios4dolfinx[h5py]",
19-
"adios4dolfinx[pyvista]",
20-
"adios4dolfinx[xdmf]"
18+
"io4dolfinx[h5py]",
19+
"io4dolfinx[pyvista]",
20+
"io4dolfinx[xdmf]"
2121
]
2222
dev = ["pdbpp", "ipython", "mypy", "ruff"]
2323
h5py = ["h5py"]
@@ -30,10 +30,10 @@ docs = [
3030
"jupytext",
3131
"ipykernel<7.0.0", # Note: Remove once https://github.com/ipython/ipykernel/issues/1450 is in a release
3232
"sphinx-codeautolink",
33-
"adios4dolfinx[h5py]",
33+
"io4dolfinx[h5py]",
3434
"sphinx_external_toc<1.1.0",
3535
]
36-
all = ["adios4dolfinx[test,dev,docs]"]
36+
all = ["io4dolfinx[test,dev,docs]"]
3737

3838
[tool.pytest.ini_options]
3939
addopts = ["--import-mode=importlib"]
@@ -64,7 +64,7 @@ select = [
6464

6565

6666
[tool.ruff.lint.isort]
67-
known-first-party = ["adios4dolfinx"]
67+
known-first-party = ["io4dolfinx"]
6868
known-third-party = [
6969
"basix",
7070
"dolfinx",

tests/conftest.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import numpy.typing as npt
1313
import pytest
1414

15-
import adios4dolfinx
15+
import io4dolfinx
1616

1717

1818
def find_backends():
@@ -71,7 +71,7 @@ def _write_function(
7171
uh.interpolate(f)
7272
uh.name = name
7373
el_hash = (
74-
adios4dolfinx.utils.element_signature(V)
74+
io4dolfinx.utils.element_signature(V)
7575
.replace(" ", "")
7676
.replace(",", "")
7777
.replace("(", "")
@@ -90,13 +90,13 @@ def _write_function(
9090
filename = (f_path / f"mesh_{file_hash}").with_suffix(suffix)
9191
if mesh.comm.size != 1:
9292
if not append:
93-
adios4dolfinx.write_mesh(filename, mesh, backend=backend)
94-
adios4dolfinx.write_function(filename, uh, time=0.0, backend=backend)
93+
io4dolfinx.write_mesh(filename, mesh, backend=backend)
94+
io4dolfinx.write_function(filename, uh, time=0.0, backend=backend)
9595
else:
9696
if MPI.COMM_WORLD.rank == 0:
9797
if not append:
98-
adios4dolfinx.write_mesh(filename, mesh, backend=backend)
99-
adios4dolfinx.write_function(filename, uh, time=0.0, backend=backend)
98+
io4dolfinx.write_mesh(filename, mesh, backend=backend)
99+
io4dolfinx.write_function(filename, uh, time=0.0, backend=backend)
100100

101101
return filename
102102

@@ -108,7 +108,7 @@ def read_function():
108108
def _read_function(
109109
comm, el, f, path, dtype, backend: typing.Literal["adios2", "h5py"], name="uh"
110110
):
111-
mesh = adios4dolfinx.read_mesh(
111+
mesh = io4dolfinx.read_mesh(
112112
path,
113113
comm,
114114
ghost_mode=dolfinx.mesh.GhostMode.shared_facet,
@@ -117,7 +117,7 @@ def _read_function(
117117
V = dolfinx.fem.functionspace(mesh, el)
118118
v = dolfinx.fem.Function(V, dtype=dtype)
119119
v.name = name
120-
adios4dolfinx.read_function(path, v, backend=backend)
120+
io4dolfinx.read_function(path, v, backend=backend)
121121
v_ex = dolfinx.fem.Function(V, dtype=dtype)
122122
v_ex.interpolate(f)
123123

@@ -157,7 +157,7 @@ def _write_function_time_dep(
157157
uh = dolfinx.fem.Function(V, dtype=dtype)
158158
uh.interpolate(f0)
159159
el_hash = (
160-
adios4dolfinx.utils.element_signature(V)
160+
io4dolfinx.utils.element_signature(V)
161161
.replace(" ", "")
162162
.replace(",", "")
163163
.replace("(", "")
@@ -174,17 +174,17 @@ def _write_function_time_dep(
174174
suffix = ".h5"
175175
filename = (f_path / f"mesh_{file_hash}").with_suffix(suffix)
176176
if mesh.comm.size != 1:
177-
adios4dolfinx.write_mesh(filename, mesh, backend=backend)
178-
adios4dolfinx.write_function(filename, uh, time=t0, backend=backend)
177+
io4dolfinx.write_mesh(filename, mesh, backend=backend)
178+
io4dolfinx.write_function(filename, uh, time=t0, backend=backend)
179179
uh.interpolate(f1)
180-
adios4dolfinx.write_function(filename, uh, time=t1, backend=backend)
180+
io4dolfinx.write_function(filename, uh, time=t1, backend=backend)
181181

182182
else:
183183
if MPI.COMM_WORLD.rank == 0:
184-
adios4dolfinx.write_mesh(filename, mesh, backend=backend)
185-
adios4dolfinx.write_function(filename, uh, time=t0, backend=backend)
184+
io4dolfinx.write_mesh(filename, mesh, backend=backend)
185+
io4dolfinx.write_function(filename, uh, time=t0, backend=backend)
186186
uh.interpolate(f1)
187-
adios4dolfinx.write_function(filename, uh, time=t1, backend=backend)
187+
io4dolfinx.write_function(filename, uh, time=t1, backend=backend)
188188

189189
return filename
190190

@@ -196,7 +196,7 @@ def read_function_time_dep():
196196
def _read_function_time_dep(
197197
comm, el, f0, f1, t0, t1, path, dtype, backend: typing.Literal["adios2", "h5py"]
198198
):
199-
mesh = adios4dolfinx.read_mesh(
199+
mesh = io4dolfinx.read_mesh(
200200
path,
201201
comm,
202202
ghost_mode=dolfinx.mesh.GhostMode.shared_facet,
@@ -205,14 +205,14 @@ def _read_function_time_dep(
205205
V = dolfinx.fem.functionspace(mesh, el)
206206
v = dolfinx.fem.Function(V, dtype=dtype)
207207

208-
adios4dolfinx.read_function(path, v, time=t1, backend=backend)
208+
io4dolfinx.read_function(path, v, time=t1, backend=backend)
209209
v_ex = dolfinx.fem.Function(V, dtype=dtype)
210210
v_ex.interpolate(f1)
211211

212212
res = np.finfo(dtype).resolution
213213
assert np.allclose(v.x.array, v_ex.x.array, atol=10 * res, rtol=10 * res)
214214

215-
adios4dolfinx.read_function(path, v, time=t0, backend=backend)
215+
io4dolfinx.read_function(path, v, time=t0, backend=backend)
216216
v_ex = dolfinx.fem.Function(V, dtype=dtype)
217217
v_ex.interpolate(f0)
218218

0 commit comments

Comments
 (0)