Skip to content

Keep dotted names when building study aggregate paths - #1013

Open
SajalDevX wants to merge 1 commit into
gprMax:masterfrom
SajalDevX:fix/study-aggregate-dotted-names
Open

SajalDevX wants to merge 1 commit into
gprMax:masterfrom
SajalDevX:fix/study-aggregate-dotted-names

Conversation

@SajalDevX

Copy link
Copy Markdown
Contributor

Fixes #1012

PortStudy and EigenmodeStudy built the aggregate path with base.with_name(base.name + "_study").with_suffix(".h5"). For a base name with a dot, with_suffix replaced everything after that dot, so patch_v1.2 wrote its S matrix to patch_v1.h5 instead of patch_v1.2_study.h5. Sibling studies (patch_v1.2, patch_v1.3) then shared one aggregate file, a plain patch_v1.h5 output got overwritten, and a -i N restart reused columns from the other experiment's file.

Changes:

  • Both studies now append _study.h5 to the base name (base.with_name(base.name + "_study.h5")). Names without a dot give the same path as before (ports_study.h5, hash_ports_study.h5, ...).
  • Added test_port_study_aggregate_keeps_dotted_output_name (two port studies patch_v1.2 and patch_v1.3 in one folder) and test_eigenmode_study_aggregate_keeps_dotted_output_name (guide_v1.2). They check the result's output_file, that each aggregate is complete, and that no patch_v1.h5 / guide_v1.h5 is written.

Testing:

  • On master both new tests fail (PosixPath('.../patch_v1.h5') == '.../patch_v1.2_study.h5', PosixPath('.../guide_v1.h5') == '.../guide_v1.2_study.h5') and pass with the fix.
  • pytest tests/ports/test_port_study.py tests/test_eigenmode_study.py tests/test_studies.py tests/test_documentation_workflows.py::test_documented_hash_and_api_models_agree_and_plot: 41 passed, 10 skipped (no CUDA/OpenCL here).
  • Real runs with the example port.in/port.csv: python -m gprMax patch_v1.2.in now writes patch_v1.2_study.h5, python -m gprMax patch_v1.3.in -i 2 writes its own patch_v1.3_study.h5 and no longer touches the patch_v1.2 result, and -o results/run.out gives results/run.out_study.h5 next to run.out1.h5 and run.out2.h5.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PortStudy and EigenmodeStudy write <output>_study.h5 to the wrong file when the output name has a dot

1 participant