Skip to content

Add explicit output format override#8

Merged
houjun merged 2 commits into
mainfrom
feat/output-format-override
Apr 17, 2026
Merged

Add explicit output format override#8
houjun merged 2 commits into
mainfrom
feat/output-format-override

Conversation

@houjun
Copy link
Copy Markdown
Owner

@houjun houjun commented Apr 17, 2026

Summary

  • add an explicit --output-format override with validated point, opensees, and essi modes
  • keep the current defaults when no override is provided, but reject unsupported input/output combinations early
  • document the new behavior and add regression coverage for parser, helper, and real-data conversion paths

Testing

  • /global/cfs/cdirs/m3354/perl/conda_eqsim/bin/python -m unittest discover -s tests -p 'test_*.py'
  • python3 -m py_compile convert.py tests/test_convert_cli.py tests/test_convert_helpers.py tests/test_convert_fixture_data.py

Copilot AI review requested due to automatic review settings April 17, 2026 04:10
Copy link
Copy Markdown

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 adds an explicit --output-format override to the conversion CLI, while preserving existing defaults per input type and rejecting unsupported input/output combinations early.

Changes:

  • Introduces --output-format {point,opensees,essi} and centralizes validation/defaulting via resolve_output_mode().
  • Refactors output file naming/copy behavior via get_output_filename() and prepare_essi_output_file().
  • Updates documentation and expands regression tests covering CLI parsing, helper behavior, and real-data conversion paths.

Reviewed changes

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

Show a summary per file
File Description
convert.py Adds output-format override support, validation, output naming, and ESSI template preparation logic.
README.md Documents default output behavior and constraints for --output-format.
tests/test_convert_cli.py Adds CLI parser coverage for the new --output-format flag.
tests/test_convert_helpers.py Adds unit tests for output-mode resolution and output filename behavior.
tests/test_convert_fixture_data.py Adds integration/regression tests for explicit output mode support and rejection of invalid combos.

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

Comment thread convert.py Outdated
Comment thread convert.py
@houjun
Copy link
Copy Markdown
Owner Author

houjun commented Apr 17, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot apply changes based on the comments in this thread

Implemented in commit 54548af. I applied the review-thread MPI fixes in both paths: ESSI file copy now runs only on rank 0, followed by an MPI barrier before generate_acc_dis_time(), and validated with full unit tests plus parallel validation.

@houjun houjun merged commit 0aa6554 into main Apr 17, 2026
1 check passed
@houjun houjun deleted the feat/output-format-override branch April 17, 2026 20:46
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.

3 participants