io4dolfinx 2.2.0__tar.gz → 2.2.1__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 (89) hide show
  1. {io4dolfinx-2.2.0/src/io4dolfinx.egg-info → io4dolfinx-2.2.1}/PKG-INFO +17 -2
  2. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/README.md +16 -1
  3. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/pyproject.toml +2 -2
  4. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/vtkhdf/backend.py +8 -5
  5. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1/src/io4dolfinx.egg-info}/PKG-INFO +17 -2
  6. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_vtkhdf_compression.py +37 -2
  7. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/LICENSE +0 -0
  8. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/setup.cfg +0 -0
  9. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/__init__.py +0 -0
  10. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/ascii_helpers.py +0 -0
  11. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/__init__.py +0 -0
  12. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/adios2/__init__.py +0 -0
  13. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/adios2/backend.py +0 -0
  14. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/adios2/helpers.py +0 -0
  15. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/adios2_serial/__init__.py +0 -0
  16. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/adios2_serial/backend.py +0 -0
  17. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/exodus/__init__.py +0 -0
  18. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/exodus/backend.py +0 -0
  19. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/gmsh/__init__.py +0 -0
  20. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/gmsh/backend.py +0 -0
  21. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/h5py/__init__.py +0 -0
  22. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/h5py/backend.py +0 -0
  23. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/h5py/storage.py +0 -0
  24. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/h5py_serial/__init__.py +0 -0
  25. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/h5py_serial/backend.py +0 -0
  26. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/med/__init__.py +0 -0
  27. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/med/backend.py +0 -0
  28. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/nastran/__init__.py +0 -0
  29. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/nastran/backend.py +0 -0
  30. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/nastran/helpers.py +0 -0
  31. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/opencarp/__init__.py +0 -0
  32. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/opencarp/backend.py +0 -0
  33. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/opencarp/helpers.py +0 -0
  34. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/openfoam/__init__.py +0 -0
  35. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/openfoam/backend.py +0 -0
  36. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/openfoam/helpers.py +0 -0
  37. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/pyvista/__init__.py +0 -0
  38. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/pyvista/backend.py +0 -0
  39. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/pyvista/helpers.py +0 -0
  40. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/serial.py +0 -0
  41. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/vtk_cell_types.py +0 -0
  42. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/vtkhdf/__init__.py +0 -0
  43. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/vtkhdf_serial/__init__.py +0 -0
  44. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/vtkhdf_serial/backend.py +0 -0
  45. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/xdmf/__init__.py +0 -0
  46. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/backends/xdmf/backend.py +0 -0
  47. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/checkpointing.py +0 -0
  48. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/comm_helpers.py +0 -0
  49. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/converter.py +0 -0
  50. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/format.py +0 -0
  51. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/original_checkpoint.py +0 -0
  52. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/py.typed +0 -0
  53. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/readers.py +0 -0
  54. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/snapshot.py +0 -0
  55. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/structures.py +0 -0
  56. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/submesh.py +0 -0
  57. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/utils.py +0 -0
  58. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx/writers.py +0 -0
  59. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx.egg-info/SOURCES.txt +0 -0
  60. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx.egg-info/dependency_links.txt +0 -0
  61. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx.egg-info/entry_points.txt +0 -0
  62. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx.egg-info/requires.txt +0 -0
  63. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/src/io4dolfinx.egg-info/top_level.txt +0 -0
  64. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_attributes.py +0 -0
  65. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_backends.py +0 -0
  66. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_checkpointing.py +0 -0
  67. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_checkpointing_vector.py +0 -0
  68. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_converter.py +0 -0
  69. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_exodus.py +0 -0
  70. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_format_version.py +0 -0
  71. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_geometry_dofmap_reconstruction.py +0 -0
  72. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_gmsh.py +0 -0
  73. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_h5py_compression.py +0 -0
  74. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_legacy_readers.py +0 -0
  75. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_med.py +0 -0
  76. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_mesh_writer.py +0 -0
  77. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_meshtags.py +0 -0
  78. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_nastran.py +0 -0
  79. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_numpy_vectorization.py +0 -0
  80. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_opencarp.py +0 -0
  81. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_openfoam.py +0 -0
  82. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_original_checkpoint.py +0 -0
  83. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_pyvista.py +0 -0
  84. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_snapshot_checkpoint.py +0 -0
  85. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_submesh.py +0 -0
  86. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_version.py +0 -0
  87. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_vtkhdf.py +0 -0
  88. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_write_data_input_order.py +0 -0
  89. {io4dolfinx-2.2.0 → io4dolfinx-2.2.1}/tests/test_xdmf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: io4dolfinx
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Checkpointing functionality for DOLFINx meshes/functions with ADIOS2
5
5
  Author-email: "Jørgen S. Dokken" <dokken@simula.no>, "Henrik N.T. Finsberg" <henriknf@simula.no>
6
6
  License: Copyright 2023 Jørgen S. Dokken, Henrik N.T. Finsberg and Simula Research Laboratory
@@ -153,6 +153,8 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
153
153
  ## Releasing
154
154
  Versions are managed with [bump-my-version](https://callowayproject.github.io/bump-my-version/), configured in `pyproject.toml`. Between releases the version is a development version, `X.Y.Z.devN`; a release drops the suffix. Each bump commits the version change, so start from a clean working tree.
155
155
 
156
+ ### Releasing the development version
157
+
156
158
  To release the current development version, e.g. `2.1.0.dev0`, and start the next one:
157
159
 
158
160
  ```bash
@@ -162,7 +164,20 @@ bump-my-version bump minor --no-tag # 2.1.0 -> 2.2.0.dev0
162
164
 
163
165
  For a patch release of 2.1, bump `patch` instead of `minor` (`2.1.0 -> 2.1.1.dev0`), then `release` (`2.1.1.dev0 -> 2.1.1`). `bump-my-version show-bump` previews what each bump gives.
164
166
 
165
- The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`) as `v2.1.0`, for instance by creating a GitHub release from it.
167
+ ### Patch release of the previous version
168
+
169
+ To release `main` as a patch of the previous release, e.g. `2.0.1` while `main` is at `2.1.0.dev0`, set the version directly and then restore the development version:
170
+
171
+ ```bash
172
+ bump-my-version bump --new-version 2.0.1 --no-tag # 2.1.0.dev0 -> 2.0.1
173
+ bump-my-version bump minor --no-tag # 2.0.1 -> 2.1.0.dev0
174
+ ```
175
+
176
+ This releases everything on `main`, so use it only if `main` holds nothing but fixes since `v2.0.0`. The first bump warns that `2.1.0.dev0` does not match the last tag, `v2.0.0`; this is expected, as development versions are not tagged.
177
+
178
+ ### Tagging
179
+
180
+ The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`, or `Bump version: 2.1.0.dev0 → 2.0.1`) as `v2.1.0` or `v2.0.1`, for instance by creating a GitHub release from it.
166
181
 
167
182
  Releasing a new minor version also adds it to `.github/docs-versions.toml`, which lists the versions on the documentation website, built in the DOLFINx image of the previous one; edit that image afterwards if a newer DOLFINx release should be used. A patch release needs no entry, as each minor version is built from its newest tag.
168
183
 
@@ -114,6 +114,8 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
114
114
  ## Releasing
115
115
  Versions are managed with [bump-my-version](https://callowayproject.github.io/bump-my-version/), configured in `pyproject.toml`. Between releases the version is a development version, `X.Y.Z.devN`; a release drops the suffix. Each bump commits the version change, so start from a clean working tree.
116
116
 
117
+ ### Releasing the development version
118
+
117
119
  To release the current development version, e.g. `2.1.0.dev0`, and start the next one:
118
120
 
119
121
  ```bash
@@ -123,7 +125,20 @@ bump-my-version bump minor --no-tag # 2.1.0 -> 2.2.0.dev0
123
125
 
124
126
  For a patch release of 2.1, bump `patch` instead of `minor` (`2.1.0 -> 2.1.1.dev0`), then `release` (`2.1.1.dev0 -> 2.1.1`). `bump-my-version show-bump` previews what each bump gives.
125
127
 
126
- The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`) as `v2.1.0`, for instance by creating a GitHub release from it.
128
+ ### Patch release of the previous version
129
+
130
+ To release `main` as a patch of the previous release, e.g. `2.0.1` while `main` is at `2.1.0.dev0`, set the version directly and then restore the development version:
131
+
132
+ ```bash
133
+ bump-my-version bump --new-version 2.0.1 --no-tag # 2.1.0.dev0 -> 2.0.1
134
+ bump-my-version bump minor --no-tag # 2.0.1 -> 2.1.0.dev0
135
+ ```
136
+
137
+ This releases everything on `main`, so use it only if `main` holds nothing but fixes since `v2.0.0`. The first bump warns that `2.1.0.dev0` does not match the last tag, `v2.0.0`; this is expected, as development versions are not tagged.
138
+
139
+ ### Tagging
140
+
141
+ The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`, or `Bump version: 2.1.0.dev0 → 2.0.1`) as `v2.1.0` or `v2.0.1`, for instance by creating a GitHub release from it.
127
142
 
128
143
  Releasing a new minor version also adds it to `.github/docs-versions.toml`, which lists the versions on the documentation website, built in the DOLFINx image of the previous one; edit that image afterwards if a newer DOLFINx release should be used. A patch release needs no entry, as each minor version is built from its newest tag.
129
144
 
@@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"
11
11
 
12
12
  [project]
13
13
  name = "io4dolfinx"
14
- version = "2.2.0"
14
+ version = "2.2.1"
15
15
  description = "Checkpointing functionality for DOLFINx meshes/functions with ADIOS2"
16
16
  authors = [
17
17
  { name = "Jørgen S. Dokken", email = "dokken@simula.no" },
@@ -141,7 +141,7 @@ tag = true
141
141
  sign_tags = false
142
142
  tag_name = "v{new_version}"
143
143
  tag_message = "Bump version: {current_version} → {new_version}"
144
- current_version = "2.2.0"
144
+ current_version = "2.2.1"
145
145
  # X.Y.Z.devN while developing, X.Y.Z when released
146
146
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>dev)(?P<pre_n>\d+))?'
147
147
  serialize = ["{major}.{minor}.{patch}.{release}{pre_n}", "{major}.{minor}.{patch}"]
@@ -45,6 +45,8 @@ _lagrange_variant_attr = "LagrangeVariant"
45
45
  #: first write share the data of the first write, and the offsets alone cannot tell at
46
46
  #: which step that was. The writer needs it to fill in steps written out of order.
47
47
  _written_steps = "Steps"
48
+ #: Chunk length of the per-step datasets (time stamps, offsets, written steps).
49
+ _step_chunk = 1024
48
50
 
49
51
 
50
52
  def _array_metadata_group(mesh_name: str, extension: str, name: str) -> str:
@@ -403,7 +405,7 @@ def _create_temporal_record(h5file: h5py.File, record: str, written_steps: np.nd
403
405
  h5file[record].resize(written_steps.shape)
404
406
  h5file[record][:] = written_steps
405
407
  else:
406
- h5file.create_dataset(record, data=written_steps, chunks=True, maxshape=(None,))
408
+ h5file.create_dataset(record, data=written_steps, chunks=(_step_chunk,), maxshape=(None,))
407
409
 
408
410
 
409
411
  def _get_time_index(hdf: h5py.Group, time: float | str, filename: str | Path) -> int:
@@ -772,15 +774,16 @@ def _create_dataset(
772
774
  Args:
773
775
  storage: Storage options of a bulk dataset, from
774
776
  :func:`io4dolfinx.backends.h5py.storage.storage_options`. A new bulk dataset
775
- is chunked by rows and filtered as these options say. Omitted for small
776
- bookkeeping datasets, which every rank writes independently and which must
777
- therefore stay unfiltered; they use h5py's automatic chunking.
777
+ is chunked by rows and filtered as these options say. Omitted for the
778
+ per-step datasets, which every rank writes independently and which must
779
+ therefore stay unfiltered; they are chunked by ``_step_chunk`` entries.
778
780
  """
779
781
  if name not in root.keys():
780
782
  mode = "w"
781
783
  if mode == "w":
782
784
  if storage is None:
783
- layout: dict[str, Any] = {"chunks": True}
785
+ assert len(shape) == 1, "Only per-step datasets are created without storage options"
786
+ layout: dict[str, Any] = {"chunks": (_step_chunk,)}
784
787
  else:
785
788
  layout = {
786
789
  "chunks": h5_storage.chunk_shape(storage, shape, dtype),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: io4dolfinx
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: Checkpointing functionality for DOLFINx meshes/functions with ADIOS2
5
5
  Author-email: "Jørgen S. Dokken" <dokken@simula.no>, "Henrik N.T. Finsberg" <henriknf@simula.no>
6
6
  License: Copyright 2023 Jørgen S. Dokken, Henrik N.T. Finsberg and Simula Research Laboratory
@@ -153,6 +153,8 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
153
153
  ## Releasing
154
154
  Versions are managed with [bump-my-version](https://callowayproject.github.io/bump-my-version/), configured in `pyproject.toml`. Between releases the version is a development version, `X.Y.Z.devN`; a release drops the suffix. Each bump commits the version change, so start from a clean working tree.
155
155
 
156
+ ### Releasing the development version
157
+
156
158
  To release the current development version, e.g. `2.1.0.dev0`, and start the next one:
157
159
 
158
160
  ```bash
@@ -162,7 +164,20 @@ bump-my-version bump minor --no-tag # 2.1.0 -> 2.2.0.dev0
162
164
 
163
165
  For a patch release of 2.1, bump `patch` instead of `minor` (`2.1.0 -> 2.1.1.dev0`), then `release` (`2.1.1.dev0 -> 2.1.1`). `bump-my-version show-bump` previews what each bump gives.
164
166
 
165
- The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`) as `v2.1.0`, for instance by creating a GitHub release from it.
167
+ ### Patch release of the previous version
168
+
169
+ To release `main` as a patch of the previous release, e.g. `2.0.1` while `main` is at `2.1.0.dev0`, set the version directly and then restore the development version:
170
+
171
+ ```bash
172
+ bump-my-version bump --new-version 2.0.1 --no-tag # 2.1.0.dev0 -> 2.0.1
173
+ bump-my-version bump minor --no-tag # 2.0.1 -> 2.1.0.dev0
174
+ ```
175
+
176
+ This releases everything on `main`, so use it only if `main` holds nothing but fixes since `v2.0.0`. The first bump warns that `2.1.0.dev0` does not match the last tag, `v2.0.0`; this is expected, as development versions are not tagged.
177
+
178
+ ### Tagging
179
+
180
+ The bumps do not tag. A `v*` tag publishes to PyPI and the documentation, so tag the release commit (`Bump version: 2.1.0.dev0 → 2.1.0`, or `Bump version: 2.1.0.dev0 → 2.0.1`) as `v2.1.0` or `v2.0.1`, for instance by creating a GitHub release from it.
166
181
 
167
182
  Releasing a new minor version also adds it to `.github/docs-versions.toml`, which lists the versions on the documentation website, built in the DOLFINx image of the previous one; edit that image afterwards if a newer DOLFINx release should be used. A patch release needs no entry, as each minor version is built from its newest tag.
168
183
 
@@ -492,9 +492,44 @@ def test_row_chunks(shared_tmp_path, chunk_bytes, backend):
492
492
  min(_rows_per_chunk(target, dataset), dataset.shape[0]),
493
493
  *dataset.shape[1:],
494
494
  )
495
- # Bookkeeping arrays keep h5py's automatic chunking.
496
- assert block["NumberOfPoints"].chunks is not None
495
+ assert block["NumberOfPoints"].chunks == (vtkhdf._step_chunk,)
497
496
 
498
497
  restored = io4dolfinx.read_mesh(filename, comm, time=1.0, backend="vtkhdf")
499
498
  v = io4dolfinx.read_point_data(filename, "u", restored, time=1.0, backend="vtkhdf")
500
499
  np.testing.assert_allclose(v.x.array, 1.0)
500
+
501
+
502
+ @pytest.mark.parametrize("backend", ["vtkhdf", "vtkhdf-serial"])
503
+ def test_step_datasets_share_chunks(shared_tmp_path, backend):
504
+ """Per-step datasets hold all time steps in one chunk."""
505
+ comm = MPI.COMM_WORLD
506
+ if backend == "vtkhdf" and comm.size > 1 and not h5py.get_config().mpi:
507
+ pytest.skip("Writing in parallel needs h5py with MPI")
508
+ filename = shared_tmp_path / "steps.vtkhdf"
509
+ mesh = create_unit_square(comm, 4, 4)
510
+ io4dolfinx.write_mesh(filename, mesh, backend=backend, backend_args={})
511
+ u = Function(functionspace(mesh, ("Lagrange", 1)), name="u")
512
+ num_steps = 5
513
+ for step in range(num_steps):
514
+ io4dolfinx.write_point_data(
515
+ filename,
516
+ u,
517
+ time=float(step),
518
+ mode=io4dolfinx.FileMode.append,
519
+ backend=backend,
520
+ backend_args={},
521
+ )
522
+
523
+ step_datasets = []
524
+
525
+ def collect(name, item):
526
+ if isinstance(item, h5py.Dataset) and item.shape == (num_steps,):
527
+ step_datasets.append(item)
528
+
529
+ with h5py.File(filename, "r") as hdf:
530
+ hdf.visititems(collect)
531
+ assert {"Values", "NumberOfPoints", "u", "Steps"} <= {
532
+ d.name.rsplit("/", 1)[1] for d in step_datasets
533
+ }
534
+ for dataset in step_datasets:
535
+ assert dataset.id.get_num_chunks() == 1, dataset.name
File without changes
File without changes
File without changes