io4dolfinx 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. io4dolfinx-1.1.0/LICENSE +7 -0
  2. io4dolfinx-1.1.0/PKG-INFO +158 -0
  3. io4dolfinx-1.1.0/README.md +110 -0
  4. io4dolfinx-1.1.0/pyproject.toml +107 -0
  5. io4dolfinx-1.1.0/setup.cfg +4 -0
  6. io4dolfinx-1.1.0/src/io4dolfinx/__init__.py +65 -0
  7. io4dolfinx-1.1.0/src/io4dolfinx/backends/__init__.py +437 -0
  8. io4dolfinx-1.1.0/src/io4dolfinx/backends/adios2/__init__.py +3 -0
  9. io4dolfinx-1.1.0/src/io4dolfinx/backends/adios2/backend.py +1051 -0
  10. io4dolfinx-1.1.0/src/io4dolfinx/backends/adios2/helpers.py +304 -0
  11. io4dolfinx-1.1.0/src/io4dolfinx/backends/h5py/__init__.py +3 -0
  12. io4dolfinx-1.1.0/src/io4dolfinx/backends/h5py/backend.py +830 -0
  13. io4dolfinx-1.1.0/src/io4dolfinx/backends/pyvista/__init__.py +3 -0
  14. io4dolfinx-1.1.0/src/io4dolfinx/backends/pyvista/backend.py +604 -0
  15. io4dolfinx-1.1.0/src/io4dolfinx/backends/vtkhdf/__init__.py +3 -0
  16. io4dolfinx-1.1.0/src/io4dolfinx/backends/vtkhdf/backend.py +1244 -0
  17. io4dolfinx-1.1.0/src/io4dolfinx/backends/xdmf/__init__.py +3 -0
  18. io4dolfinx-1.1.0/src/io4dolfinx/backends/xdmf/backend.py +563 -0
  19. io4dolfinx-1.1.0/src/io4dolfinx/checkpointing.py +653 -0
  20. io4dolfinx-1.1.0/src/io4dolfinx/comm_helpers.py +260 -0
  21. io4dolfinx-1.1.0/src/io4dolfinx/original_checkpoint.py +414 -0
  22. io4dolfinx-1.1.0/src/io4dolfinx/py.typed +0 -0
  23. io4dolfinx-1.1.0/src/io4dolfinx/readers.py +466 -0
  24. io4dolfinx-1.1.0/src/io4dolfinx/snapshot.py +39 -0
  25. io4dolfinx-1.1.0/src/io4dolfinx/structures.py +106 -0
  26. io4dolfinx-1.1.0/src/io4dolfinx/utils.py +198 -0
  27. io4dolfinx-1.1.0/src/io4dolfinx/writers.py +156 -0
  28. io4dolfinx-1.1.0/src/io4dolfinx.egg-info/PKG-INFO +158 -0
  29. io4dolfinx-1.1.0/src/io4dolfinx.egg-info/SOURCES.txt +44 -0
  30. io4dolfinx-1.1.0/src/io4dolfinx.egg-info/dependency_links.txt +1 -0
  31. io4dolfinx-1.1.0/src/io4dolfinx.egg-info/requires.txt +38 -0
  32. io4dolfinx-1.1.0/src/io4dolfinx.egg-info/top_level.txt +1 -0
  33. io4dolfinx-1.1.0/tests/test_attributes.py +53 -0
  34. io4dolfinx-1.1.0/tests/test_checkpointing.py +315 -0
  35. io4dolfinx-1.1.0/tests/test_checkpointing_vector.py +227 -0
  36. io4dolfinx-1.1.0/tests/test_geometry_dofmap_reconstruction.py +40 -0
  37. io4dolfinx-1.1.0/tests/test_legacy_readers.py +268 -0
  38. io4dolfinx-1.1.0/tests/test_mesh_writer.py +275 -0
  39. io4dolfinx-1.1.0/tests/test_meshtags.py +269 -0
  40. io4dolfinx-1.1.0/tests/test_numpy_vectorization.py +164 -0
  41. io4dolfinx-1.1.0/tests/test_original_checkpoint.py +632 -0
  42. io4dolfinx-1.1.0/tests/test_pyvista.py +50 -0
  43. io4dolfinx-1.1.0/tests/test_snapshot_checkpoint.py +122 -0
  44. io4dolfinx-1.1.0/tests/test_version.py +5 -0
  45. io4dolfinx-1.1.0/tests/test_vtkhdf.py +523 -0
  46. io4dolfinx-1.1.0/tests/test_xdmf.py +68 -0
@@ -0,0 +1,7 @@
1
+ Copyright 2023 Jørgen S. Dokken, Henrik N.T. Finsberg and Simula Research Laboratory
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.4
2
+ Name: io4dolfinx
3
+ Version: 1.1.0
4
+ Summary: Checkpointing functionality for DOLFINx meshes/functions with ADIOS2
5
+ Author-email: "Jørgen S. Dokken" <dokken@simula.no>, "Henrik N.T. Finsberg" <henriknf@simula.no>
6
+ License: Copyright 2023 Jørgen S. Dokken, Henrik N.T. Finsberg and Simula Research Laboratory
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: fenics-dolfinx>=0.10.0
17
+ Requires-Dist: packaging
18
+ Provides-Extra: test
19
+ Requires-Dist: pytest; extra == "test"
20
+ Requires-Dist: coverage; extra == "test"
21
+ Requires-Dist: ipyparallel; extra == "test"
22
+ Requires-Dist: io4dolfinx[h5py]; extra == "test"
23
+ Requires-Dist: io4dolfinx[pyvista]; extra == "test"
24
+ Requires-Dist: io4dolfinx[xdmf]; extra == "test"
25
+ Provides-Extra: dev
26
+ Requires-Dist: pdbpp; extra == "dev"
27
+ Requires-Dist: ipython; extra == "dev"
28
+ Requires-Dist: mypy; extra == "dev"
29
+ Requires-Dist: ruff; extra == "dev"
30
+ Provides-Extra: h5py
31
+ Requires-Dist: h5py; extra == "h5py"
32
+ Provides-Extra: pyvista
33
+ Requires-Dist: pyvista; extra == "pyvista"
34
+ Provides-Extra: xdmf
35
+ Requires-Dist: h5py; extra == "xdmf"
36
+ Provides-Extra: docs
37
+ Requires-Dist: jupyter-book<2.0.0; extra == "docs"
38
+ Requires-Dist: ipyparallel; extra == "docs"
39
+ Requires-Dist: ipywidgets; extra == "docs"
40
+ Requires-Dist: jupytext; extra == "docs"
41
+ Requires-Dist: ipykernel<7.0.0; extra == "docs"
42
+ Requires-Dist: sphinx-codeautolink; extra == "docs"
43
+ Requires-Dist: io4dolfinx[h5py]; extra == "docs"
44
+ Requires-Dist: sphinx_external_toc<1.1.0; extra == "docs"
45
+ Provides-Extra: all
46
+ Requires-Dist: io4dolfinx[dev,docs,test]; extra == "all"
47
+ Dynamic: license-file
48
+
49
+ # io4dolfinx - A framework for reading and writing data to various mesh formats
50
+
51
+ **io4dolfinx** is an extension for [DOLFINx](https://github.com/FEniCS/dolfinx/) that provides advanced input/output capabilities. It focuses on **N-to-M checkpointing** (writing data on N processors, reading on M processors) and supports reading/writing various mesh formats using interchangeable backends.
52
+
53
+
54
+ ## Installation
55
+
56
+ The library is compatible with the DOLFINx nightly release, v0.10.0, and v0.9.0.
57
+
58
+ ```bash
59
+ python3 -m pip install io4dolfinx
60
+ ```
61
+
62
+ For specific backend requirements (like ADIOS2 or H5PY), see the [Installation Guide](./docs/installation.md).
63
+
64
+
65
+ ## Quick Start
66
+
67
+ Here is a minimal example of saving and loading a simulation state (Checkpointing).
68
+
69
+ ```python
70
+ from pathlib import Path
71
+ from mpi4py import MPI
72
+ import dolfinx
73
+ import io4dolfinx
74
+
75
+ # 1. Create a mesh and function
76
+ comm = MPI.COMM_WORLD
77
+ mesh = dolfinx.mesh.create_unit_square(comm, 10, 10)
78
+ V = dolfinx.fem.functionspace(mesh, ("Lagrange", 1))
79
+ u = dolfinx.fem.Function(V)
80
+ u.interpolate(lambda x: x[0] + x[1])
81
+ u.name = "my_function"
82
+
83
+ # 2. Write checkpoint
84
+ # The mesh must be written before the function
85
+ filename = Path("checkpoint.bp")
86
+ io4dolfinx.write_mesh(filename, mesh)
87
+ io4dolfinx.write_function(filename, u, time=0.0)
88
+
89
+ # 3. Read checkpoint
90
+ # This works even if the number of MPI processes changes (N-to-M)
91
+ mesh_new = io4dolfinx.read_mesh(filename, comm)
92
+ V_new = dolfinx.fem.functionspace(mesh_new, ("Lagrange", 1))
93
+ u_new = dolfinx.fem.Function(V_new)
94
+ io4dolfinx.read_function(filename, u_new, time=0.0, name="my_function")
95
+ ```
96
+
97
+
98
+ ## Features and Backends
99
+
100
+ `io4dolfinx` supports custom user backends. You can switch backends by passing `backend="name"` to IO functions.
101
+
102
+ ### Checkpointing (N-to-M)
103
+ Many finite element applications requires storage of functions that cannot be associated with the nodes or cells of the mesh. Therefore, we have implemented our own, native checkpointing format that supports N-to-M checkpointing (write data on N processors, read in on M) through the following backends:
104
+
105
+ - [h5py](./docs/backends/h5py.rst): Requires HDF5 with MPI support to work, but can store, meshes, partitioning info, meshtags, function data and more.
106
+ - [adios2](./docs/backends/adios2.rst): Requires [ADIOS 2](https://adios2.readthedocs.io/en/latest/) compiled with MPI support and Python bindings. Supports the same set of operations as the `h5py` backend.
107
+
108
+ The code uses the ADIOS2/Python-wrappers and h5py module to write DOLFINx objects to file, supporting N-to-M (_recoverable_) and N-to-N (_snapshot_) checkpointing.
109
+ See: [Checkpointing in DOLFINx - FEniCS 23](https://jsdokken.com/checkpointing-presentation/#/) or the examples in the [Documentation](https://jsdokken.com/io4dolfinx/) for more information.
110
+
111
+ For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node200.htm) for communication across processes.
112
+
113
+
114
+ ### Mesh IO (Import/Export)
115
+ Most meshing formats supports associating data with the nodes of the mesh (the mesh can be higher order) and the cells of the mesh. The node data can be read in as P-th order Lagrange functions (where P is the order of the grid), while the cell data can be read in as piecewise constant (DG-0) functions.
116
+
117
+ - [VTKHDF](./docs/backends/vtkhdf.rst): The new scalable format from VTK, called [VTKHDF](https://docs.vtk.org/en/latest/vtk_file_formats/vtkhdf_file_format/index.html) is supported by the `vtkhdf` backend.
118
+ - [XDMF](./docs/backends/xdmf.rst) (eXtensible Model Data Format): `.xdmf`. The `xdmf` backend supports the `HDF5` encoding, to ensure performance in parallel.
119
+ - [PyVista](./docs/backends/pyvista.rst) (IO backend is meshio): The [pyvista](https://pyvista.org/) backend uses {py:func}`pyvista.read` to read in meshes, point data and cell data. `pyvista` relies on [meshio](https://github.com/nschloe/meshio) for most reading operations (including the XDMF ascii format).
120
+
121
+
122
+
123
+ ## Advanced Usage
124
+
125
+ The repository contains detailed documented examples in the `docs` folder:
126
+
127
+ * [Reading and writing mesh checkpoints](./docs/writing_mesh_checkpoint.py)
128
+ * [Storing mesh partitioning data](./docs/partitioned_mesh.py) (Avoid re-partitioning when restarting)
129
+ * [Writing mesh-tags](./docs/meshtags.py)
130
+ * [Writing function checkpoints](./docs/writing_functions_checkpoint.py)
131
+ * [Checkpoint on input mesh](./docs/original_checkpoint.py)
132
+
133
+ For a full API reference and backend details, see the [Documentation](https://jsdokken.com/io4dolfinx/).
134
+
135
+ ### Legacy DOLFIN Support
136
+ `io4dolfinx` can read checkpoints created by the legacy version of DOLFIN (Lagrange or DG functions).
137
+ * Reading meshes from DOLFIN HDF5File-format.
138
+ * Reading checkpoints from DOLFIN HDF5File and XDMFFile.
139
+
140
+ ## Project Background
141
+
142
+ ### Relation to adios4dolfinx
143
+ This library is an evolution of [adios4dolfinx](https://doi.org/10.21105/joss.06451). It includes all functionality of the original library but has been refactored to support multiple IO backends (not just ADIOS2), making it easier to interface with different meshing formats while keeping the library structure sane.
144
+
145
+ ### Statement of Need
146
+ As large-scale, long-running simulations on HPC clusters become more common, the need to store intermediate solutions is crucial. If a system crashes or a computational budget is exceeded, checkpoints allow the simulation to resume without restarting from scratch. `io4dolfinx` extends DOLFINx with this essential functionality.
147
+
148
+ ## Contributing
149
+
150
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
151
+
152
+ ## Testing
153
+
154
+ `io4dolfinx` includes a comprehensive test suite that ensures functionality across different backends and compatibility with legacy data formats, see the [Testing Guide](./docs/testing.md) for details.
155
+
156
+
157
+ ## LICENSE
158
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,110 @@
1
+ # io4dolfinx - A framework for reading and writing data to various mesh formats
2
+
3
+ **io4dolfinx** is an extension for [DOLFINx](https://github.com/FEniCS/dolfinx/) that provides advanced input/output capabilities. It focuses on **N-to-M checkpointing** (writing data on N processors, reading on M processors) and supports reading/writing various mesh formats using interchangeable backends.
4
+
5
+
6
+ ## Installation
7
+
8
+ The library is compatible with the DOLFINx nightly release, v0.10.0, and v0.9.0.
9
+
10
+ ```bash
11
+ python3 -m pip install io4dolfinx
12
+ ```
13
+
14
+ For specific backend requirements (like ADIOS2 or H5PY), see the [Installation Guide](./docs/installation.md).
15
+
16
+
17
+ ## Quick Start
18
+
19
+ Here is a minimal example of saving and loading a simulation state (Checkpointing).
20
+
21
+ ```python
22
+ from pathlib import Path
23
+ from mpi4py import MPI
24
+ import dolfinx
25
+ import io4dolfinx
26
+
27
+ # 1. Create a mesh and function
28
+ comm = MPI.COMM_WORLD
29
+ mesh = dolfinx.mesh.create_unit_square(comm, 10, 10)
30
+ V = dolfinx.fem.functionspace(mesh, ("Lagrange", 1))
31
+ u = dolfinx.fem.Function(V)
32
+ u.interpolate(lambda x: x[0] + x[1])
33
+ u.name = "my_function"
34
+
35
+ # 2. Write checkpoint
36
+ # The mesh must be written before the function
37
+ filename = Path("checkpoint.bp")
38
+ io4dolfinx.write_mesh(filename, mesh)
39
+ io4dolfinx.write_function(filename, u, time=0.0)
40
+
41
+ # 3. Read checkpoint
42
+ # This works even if the number of MPI processes changes (N-to-M)
43
+ mesh_new = io4dolfinx.read_mesh(filename, comm)
44
+ V_new = dolfinx.fem.functionspace(mesh_new, ("Lagrange", 1))
45
+ u_new = dolfinx.fem.Function(V_new)
46
+ io4dolfinx.read_function(filename, u_new, time=0.0, name="my_function")
47
+ ```
48
+
49
+
50
+ ## Features and Backends
51
+
52
+ `io4dolfinx` supports custom user backends. You can switch backends by passing `backend="name"` to IO functions.
53
+
54
+ ### Checkpointing (N-to-M)
55
+ Many finite element applications requires storage of functions that cannot be associated with the nodes or cells of the mesh. Therefore, we have implemented our own, native checkpointing format that supports N-to-M checkpointing (write data on N processors, read in on M) through the following backends:
56
+
57
+ - [h5py](./docs/backends/h5py.rst): Requires HDF5 with MPI support to work, but can store, meshes, partitioning info, meshtags, function data and more.
58
+ - [adios2](./docs/backends/adios2.rst): Requires [ADIOS 2](https://adios2.readthedocs.io/en/latest/) compiled with MPI support and Python bindings. Supports the same set of operations as the `h5py` backend.
59
+
60
+ The code uses the ADIOS2/Python-wrappers and h5py module to write DOLFINx objects to file, supporting N-to-M (_recoverable_) and N-to-N (_snapshot_) checkpointing.
61
+ See: [Checkpointing in DOLFINx - FEniCS 23](https://jsdokken.com/checkpointing-presentation/#/) or the examples in the [Documentation](https://jsdokken.com/io4dolfinx/) for more information.
62
+
63
+ For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node200.htm) for communication across processes.
64
+
65
+
66
+ ### Mesh IO (Import/Export)
67
+ Most meshing formats supports associating data with the nodes of the mesh (the mesh can be higher order) and the cells of the mesh. The node data can be read in as P-th order Lagrange functions (where P is the order of the grid), while the cell data can be read in as piecewise constant (DG-0) functions.
68
+
69
+ - [VTKHDF](./docs/backends/vtkhdf.rst): The new scalable format from VTK, called [VTKHDF](https://docs.vtk.org/en/latest/vtk_file_formats/vtkhdf_file_format/index.html) is supported by the `vtkhdf` backend.
70
+ - [XDMF](./docs/backends/xdmf.rst) (eXtensible Model Data Format): `.xdmf`. The `xdmf` backend supports the `HDF5` encoding, to ensure performance in parallel.
71
+ - [PyVista](./docs/backends/pyvista.rst) (IO backend is meshio): The [pyvista](https://pyvista.org/) backend uses {py:func}`pyvista.read` to read in meshes, point data and cell data. `pyvista` relies on [meshio](https://github.com/nschloe/meshio) for most reading operations (including the XDMF ascii format).
72
+
73
+
74
+
75
+ ## Advanced Usage
76
+
77
+ The repository contains detailed documented examples in the `docs` folder:
78
+
79
+ * [Reading and writing mesh checkpoints](./docs/writing_mesh_checkpoint.py)
80
+ * [Storing mesh partitioning data](./docs/partitioned_mesh.py) (Avoid re-partitioning when restarting)
81
+ * [Writing mesh-tags](./docs/meshtags.py)
82
+ * [Writing function checkpoints](./docs/writing_functions_checkpoint.py)
83
+ * [Checkpoint on input mesh](./docs/original_checkpoint.py)
84
+
85
+ For a full API reference and backend details, see the [Documentation](https://jsdokken.com/io4dolfinx/).
86
+
87
+ ### Legacy DOLFIN Support
88
+ `io4dolfinx` can read checkpoints created by the legacy version of DOLFIN (Lagrange or DG functions).
89
+ * Reading meshes from DOLFIN HDF5File-format.
90
+ * Reading checkpoints from DOLFIN HDF5File and XDMFFile.
91
+
92
+ ## Project Background
93
+
94
+ ### Relation to adios4dolfinx
95
+ This library is an evolution of [adios4dolfinx](https://doi.org/10.21105/joss.06451). It includes all functionality of the original library but has been refactored to support multiple IO backends (not just ADIOS2), making it easier to interface with different meshing formats while keeping the library structure sane.
96
+
97
+ ### Statement of Need
98
+ As large-scale, long-running simulations on HPC clusters become more common, the need to store intermediate solutions is crucial. If a system crashes or a computational budget is exceeded, checkpoints allow the simulation to resume without restarting from scratch. `io4dolfinx` extends DOLFINx with this essential functionality.
99
+
100
+ ## Contributing
101
+
102
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
103
+
104
+ ## Testing
105
+
106
+ `io4dolfinx` includes a comprehensive test suite that ensures functionality across different backends and compatibility with legacy data formats, see the [Testing Guide](./docs/testing.md) for details.
107
+
108
+
109
+ ## LICENSE
110
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,107 @@
1
+ [build-system] # Require setuptool version due to https://github.com/pypa/setuptools/issues/2938
2
+ requires = ["setuptools>=61.0.0", "wheel"]
3
+
4
+ [project]
5
+ name = "io4dolfinx"
6
+ version = "1.1.0"
7
+ description = "Checkpointing functionality for DOLFINx meshes/functions with ADIOS2"
8
+ authors = [
9
+ { name = "Jørgen S. Dokken", email = "dokken@simula.no" },
10
+ { name = "Henrik N.T. Finsberg", email = "henriknf@simula.no" }
11
+ ]
12
+ license = { file = "LICENSE" }
13
+ readme = "README.md"
14
+ dependencies = ["fenics-dolfinx>=0.10.0", "packaging"]
15
+
16
+ [project.optional-dependencies]
17
+ test = [
18
+ "pytest",
19
+ "coverage",
20
+ "ipyparallel",
21
+ "io4dolfinx[h5py]",
22
+ "io4dolfinx[pyvista]",
23
+ "io4dolfinx[xdmf]"
24
+ ]
25
+ dev = ["pdbpp", "ipython", "mypy", "ruff"]
26
+ h5py = ["h5py"]
27
+ pyvista = ["pyvista"]
28
+ xdmf = ["h5py"]
29
+ docs = [
30
+ "jupyter-book<2.0.0",
31
+ "ipyparallel",
32
+ "ipywidgets",
33
+ "jupytext",
34
+ "ipykernel<7.0.0", # Note: Remove once https://github.com/ipython/ipykernel/issues/1450 is in a release
35
+ "sphinx-codeautolink",
36
+ "io4dolfinx[h5py]",
37
+ "sphinx_external_toc<1.1.0",
38
+ ]
39
+ all = ["io4dolfinx[test,dev,docs]"]
40
+
41
+ [tool.pytest.ini_options]
42
+ addopts = ["--import-mode=importlib"]
43
+ testpaths = ["tests"]
44
+
45
+ [tool.mypy]
46
+ ignore_missing_imports = true
47
+ # Folders to exclude
48
+ exclude = ["docs/", "build/"]
49
+ # Folder to check with mypy
50
+ files = ["src", "tests"]
51
+
52
+ [tool.ruff]
53
+ src = ["src", "tests", "docs"]
54
+ line-length = 100
55
+ indent-width = 4
56
+
57
+ [tool.ruff.lint]
58
+ select = [
59
+ # Pyflakes
60
+ "F",
61
+ # Pycodestyle
62
+ "E",
63
+ "W",
64
+ # isort
65
+ "I001",
66
+ ]
67
+
68
+
69
+ [tool.ruff.lint.isort]
70
+ known-first-party = ["io4dolfinx"]
71
+ known-third-party = [
72
+ "basix",
73
+ "dolfinx",
74
+ "ffcx",
75
+ "ufl",
76
+ "gmsh",
77
+ "numpy",
78
+ "pytest",
79
+ ]
80
+ section-order = [
81
+ "future",
82
+ "standard-library",
83
+ "mpi",
84
+ "third-party",
85
+ "first-party",
86
+ "local-folder",
87
+ ]
88
+
89
+ [tool.ruff.lint.isort.sections]
90
+ "mpi" = ["mpi4py", "petsc4py"]
91
+
92
+
93
+ [tool.bumpversion]
94
+ allow_dirty = false
95
+ commit = true
96
+ message = "Bump version: {current_version} → {new_version}"
97
+ tag = true
98
+ sign_tags = false
99
+ tag_name = "v{new_version}"
100
+ tag_message = "Bump version: {current_version} → {new_version}"
101
+ current_version = "1.1.0"
102
+
103
+
104
+ [[tool.bumpversion.files]]
105
+ filename = "pyproject.toml"
106
+ search = 'version = "{current_version}"'
107
+ replace = 'version = "{new_version}"'
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,65 @@
1
+ # Copyright (C) 2023 Jørgen Schartum Dokken
2
+ #
3
+ # This file is part of io4dolfinx
4
+ #
5
+ # SPDX-License-Identifier: MIT
6
+
7
+ """Top-level package for ADIOS2Wrappers."""
8
+
9
+ from importlib.metadata import metadata
10
+
11
+ from .backends import FileMode, get_backend
12
+ from .checkpointing import (
13
+ read_attributes,
14
+ read_function,
15
+ read_function_names,
16
+ read_mesh,
17
+ read_meshtags,
18
+ read_timestamps,
19
+ write_attributes,
20
+ write_cell_data,
21
+ write_function,
22
+ write_mesh,
23
+ write_meshtags,
24
+ write_point_data,
25
+ )
26
+ from .original_checkpoint import write_function_on_input_mesh, write_mesh_input_order
27
+ from .readers import (
28
+ read_cell_data,
29
+ read_function_from_legacy_h5,
30
+ read_mesh_from_legacy_h5,
31
+ read_point_data,
32
+ )
33
+ from .snapshot import snapshot_checkpoint
34
+
35
+ meta = metadata("io4dolfinx")
36
+ __version__ = meta["Version"]
37
+ __author__ = meta.get("Author", "")
38
+ __license__ = meta["License"]
39
+ __email__ = meta["Author-email"]
40
+ __program_name__ = meta["Name"]
41
+
42
+ __all__ = [
43
+ "FileMode",
44
+ "write_meshtags",
45
+ "read_meshtags",
46
+ "read_cell_data",
47
+ "read_mesh",
48
+ "write_mesh",
49
+ "read_function_from_legacy_h5",
50
+ "read_mesh_from_legacy_h5",
51
+ "write_function",
52
+ "read_function",
53
+ "snapshot_checkpoint",
54
+ "write_function_on_input_mesh",
55
+ "write_mesh_input_order",
56
+ "write_attributes",
57
+ "write_data",
58
+ "read_attributes",
59
+ "read_function_names",
60
+ "read_point_data",
61
+ "read_timestamps",
62
+ "get_backend",
63
+ "write_cell_data",
64
+ "write_point_data",
65
+ ]