Skip to content

Decoupling HDF5 to EMOD3D format conversion from from generate_velocity_model#101

Merged
sungeunbae merged 25 commits intopegasusfrom
copilot/refactor-run-nzcvm-into-commands
Apr 1, 2026
Merged

Decoupling HDF5 to EMOD3D format conversion from from generate_velocity_model#101
sungeunbae merged 25 commits intopegasusfrom
copilot/refactor-run-nzcvm-into-commands

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

This pull request introduces a new workflow step to convert velocity model HDF5 files to EMOD3D binary format, decoupling this conversion from the velocity model generation.

It also updates the workflow configuration and command-line interface to support this new step.

Additionally, the velocity model generation script is refactored to remove the embedded conversion logic, streamlining responsibilities and improving maintainability.

Workflow enhancements:

  • Added a new convert_vm_hdf5_to_emod3d workflow step in cylc/flow.cylc to convert HDF5 velocity models to EMOD3D format as a separate, parallelized step (using 4 threads)
  • Registered the convert-vm-hdf5-to-emod3d command in the CLI by updating pyproject.toml.

New script and CLI command:

  • Introduced the workflow/scripts/convert_vm_hdf5_to_emod3d.py script, providing a standalone CLI for converting HDF5 velocity models to EMOD3D binary files, with logging and documentation.

  • Relaxed the existence check for the velocity_model_output argument in generate_velocity_model to allow for pre-existing output directories.

Copilot AI changed the title [WIP] Refactor run_nzcvm into separate commands for HDF5 generation Split velocity model generation into separate checkpointed Cylc steps Mar 31, 2026
Copilot AI requested a review from sungeunbae March 31, 2026 01:18
Copilot AI changed the title Split velocity model generation into separate checkpointed Cylc steps Deduplicate realisation setup between generate_velocity_model and generate_velocity_model_hdf5 Mar 31, 2026
Copilot AI changed the title Deduplicate realisation setup between generate_velocity_model and generate_velocity_model_hdf5 Add emod3d_convert switch to run_nzcvm() to eliminate duplication with generate_velocity_model_hdf5() Mar 31, 2026
…df5 CLI commands

Agent-Logs-Url: https://github.com/ucgmsim/workflow/sessions/6426afbd-1729-4121-ba7e-9b318ded0171

Co-authored-by: sungeunbae <466989+sungeunbae@users.noreply.github.com>
Copilot AI changed the title Add emod3d_convert switch to run_nzcvm() to eliminate duplication with generate_velocity_model_hdf5() Add generate_velocity_model_hdf5() and convert-velocity-model-hdf5 CLI to expose HDF5→EMOD3D split to Singularity Mar 31, 2026
…command reference

Agent-Logs-Url: https://github.com/ucgmsim/workflow/sessions/c68f4200-ca6d-432c-8d71-1b53fee120db

Co-authored-by: sungeunbae <466989+sungeunbae@users.noreply.github.com>
Copilot AI changed the title Add generate_velocity_model_hdf5() and convert-velocity-model-hdf5 CLI to expose HDF5→EMOD3D split to Singularity Expose HDF5→EMOD3D conversion as a standalone CLI command for Cylc split workflow Mar 31, 2026
Copilot AI changed the title Split velocity model generation into HDF5 and EMOD3D conversion Cylc tasks Remove emod3d_convert switch from generate_velocity_model — HDF5-only output Mar 31, 2026
@sungeunbae sungeunbae changed the title Remove emod3d_convert switch from generate_velocity_model — HDF5-only output Decoupling HDF5 to EMOD3D format conversion from from generate_velocity_model Mar 31, 2026
@sungeunbae sungeunbae marked this pull request as ready for review March 31, 2026 23:08
Copilot AI review requested due to automatic review settings March 31, 2026 23:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated workflow/CLI step to convert NZCVM-produced velocity model HDF5 output into EMOD3D binary format, removing the embedded conversion logic from generate_velocity_model and updating workflow configuration accordingly.

Changes:

  • Refactors generate-velocity-model to stop doing HDF5→EMOD3D conversion inline (intended to leave conversion to a new dedicated step).
  • Adds a new convert-vm-hdf5-to-emod3d Typer CLI script and registers it as a project script entrypoint.
  • Updates the Cylc flow to run the new conversion step as a separate task.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
workflow/scripts/generate_velocity_model.py Removes inline HDF5→EMOD3D conversion/move behavior from the NZCVM path.
workflow/scripts/convert_vm_hdf5_to_emod3d.py Adds a standalone CLI wrapper around velocity_modelling.tools.convert_hdf5_to_emod3d.
pyproject.toml Registers the new CLI command entrypoint.
cylc/flow.cylc Adds a new conversion task and changes the velocity model generation invocation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…tence check; fix nproc in cylc

Agent-Logs-Url: https://github.com/ucgmsim/workflow/sessions/46e17c6d-85c9-4369-ba43-c3a94218ffd3

Co-authored-by: sungeunbae <466989+sungeunbae@users.noreply.github.com>
sungeunbae and others added 4 commits April 1, 2026 14:27
…:ucgmsim/workflow into copilot/refactor-run-nzcvm-into-commands
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…:ucgmsim/workflow into copilot/refactor-run-nzcvm-into-commands
@sungeunbae sungeunbae requested a review from lispandfound April 1, 2026 01:53
@sungeunbae sungeunbae merged commit 554d3b1 into pegasus Apr 1, 2026
7 checks passed
@sungeunbae sungeunbae deleted the copilot/refactor-run-nzcvm-into-commands branch April 1, 2026 02:03
@sungeunbae sungeunbae restored the copilot/refactor-run-nzcvm-into-commands branch April 1, 2026 02:07
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.

5 participants