Skip to content

Fix filenames in tests and examples, support complex float vectors in JSON schema - #1951

Open
franzpoeschel wants to merge 18 commits into
openPMD:devfrom
franzpoeschel:fix-test-example-filenames
Open

franzpoeschel wants to merge 18 commits into
openPMD:devfrom
franzpoeschel:fix-test-example-filenames

Conversation

@franzpoeschel

@franzpoeschel franzpoeschel commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Files should go under samples/, files should not be duplicate across tests.

This uncovered a gap in the JSON schema, it did not recognize complex float vectors so far.

TODO:

  • checkTestFilenames is probably too finicky. I'll let it run through the CI once and then remove it again.
  • Figure out what the agent did to the JSON schema

AI Agent and others added 14 commits October 15, 2026 15:26
Rename the config files used by the parallel JSON-config test so that they
do not clash with the identically named files written by the serial test
when CTest runs both executables in parallel.
Move the files created by the core unit tests and the Python API tests
from the current working directory into ../samples. Give the 'unavailable
backend' test files unique names so they do not collide with the ones of
the parallel I/O tests.
Add a source check that verifies that data files created by tests and
examples are written below ../samples and that no output filename is used
by more than one source file.
The serial and parallel append-mode tests both wrote to
../samples/append and removed that directory before each run, so the two
executables raced when CTest ran them in parallel. Give the parallel test
its own ../samples/append_parallel directory.
Extend the filename check to require that output directories below
../samples are not shared between source files. This catches conflicts
such as the append-mode tests whose filenames are assembled dynamically
and were therefore not seen by the filename-only check.
Filenames are frequently built as "../samples/prefix_" + extension.
Check such prefixes for uniqueness across source files too.
The static source scan was too finicky. It will be replaced by a runtime
check that verifies, after the test suite has run, that no files were
written outside the samples directory.
Add test/check_test_output.sh which scans the tests' working directory
(the build runtime output directory) for openPMD data files and
directories and fails if any were written outside of the samples
directory. Invoke it after ctest in the Linux Python/HDF5/ADIOS2 job.
…mples

This test assembled its filename dynamically and was missed when moving
the other test outputs into the samples directory, leaving electrons.h5,
electrons.bp, electrons.bp4 and electrons.json in the build directory.
The wrapper test wrote particle patches without the numParticlesOffset,
offset and extent components required by the openPMD standard. The output
constructor and modification tests wrote non-standard custom meshesPath
and particlesPath values; reset them to the defaults after the assertions
so that the written files remain valid.
Rename the config written by the parallel JSON configuration test so
that it ends in config.json and is therefore skipped by the JSON schema
check, like the equivalent file of the serial test.
The JSON backend represents complex numbers as a two-element array of
their real and imaginary part. The schema rejected these for vectors of
complex numbers (nested arrays) and for constant datasets (array instead
of number). Disambiguate by the declared datatype so that complex values
are accepted while real values are still checked strictly.
@franzpoeschel
franzpoeschel force-pushed the fix-test-example-filenames branch from ce7c518 to 697bf29 Compare October 15, 2026 13:26
AI Agent and others added 4 commits October 16, 2026 14:23
Depending on the test registration order, use_count_test can be the last
writer of new_openpmd_output.json and its incomplete particle patches
were then picked up by the JSON schema check.
This test also wrote a particlePatches group and, like the other core
tests, only populated a subset of the standard components. Depending on
the test order it could be the last writer of MyOutput_42.json, which
then failed the JSON schema check.
@franzpoeschel franzpoeschel changed the title Fix filenames in tests and examples Fix filenames in tests and examples, support complex float vectors in JSON schema Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant