Skip to content

feat: Add unified cfd-viz CLI with entry point and batch processing (…#36

Merged
shaia merged 9 commits intomasterfrom
foundation/phase4-cli-tooling
Mar 19, 2026
Merged

feat: Add unified cfd-viz CLI with entry point and batch processing (…#36
shaia merged 9 commits intomasterfrom
foundation/phase4-cli-tooling

Conversation

@shaia
Copy link
Copy Markdown
Owner

@shaia shaia commented Mar 7, 2026

…Phase 4)

Register cfd-viz as a package entry point in pyproject.toml and create a unified CLI with argparse subcommands (animate, dashboard, vorticity, profiles, monitor, info, batch) dispatching to existing scripts.

Add batch processing module for TOML-configured multi-file operations with stderr progress indicators. Includes 23 tests covering parser structure, command dispatch, batch execution, and entry point verification.

…Phase 4)

Register cfd-viz as a package entry point in pyproject.toml and create
a unified CLI with argparse subcommands (animate, dashboard, vorticity,
profiles, monitor, info, batch) dispatching to existing scripts.

Add batch processing module for TOML-configured multi-file operations
with stderr progress indicators. Includes 23 tests covering parser
structure, command dispatch, batch execution, and entry point verification.
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

Adds a unified cfd-viz command-line interface to the cfd_viz package (registered via pyproject.toml) and introduces TOML-driven batch processing with a simple stderr progress indicator, alongside a comprehensive CLI-focused test suite.

Changes:

  • Register cfd-viz as a package entry point ([project.scripts]) and add an argparse-based CLI with subcommands that dispatch to existing script entry points.
  • Add cfd_viz/_batch.py for TOML-configured multi-file batch operations with progress output.
  • Add tests/test_cli.py to validate parser structure, dispatch, batch behavior, progress output, and entry point registration.

Reviewed changes

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

Show a summary per file
File Description
tests/test_cli.py Adds CLI/batch/entry-point tests to validate parsing and high-level dispatch behavior.
scripts/init.py Introduces scripts as a Python package (enables import scripts.* in a source checkout).
pyproject.toml Registers the cfd-viz console script entry point.
cfd_viz/cli.py Implements unified CLI parser and subcommand dispatch to existing scripts.
cfd_viz/_batch.py Implements batch processing from TOML config with progress indicator and analysis runners.
ROADMAP.md Marks Phase 4 CLI tooling as completed and documents delivered items.

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

You can also share your feedback on Copilot code review. Take the survey.

Move CLI helper functions from scripts/ into cfd_viz/_cli_impl.py so the
installed wheel works without unpackaged script modules. Also:
- Wrap animate in try/except for batch error resilience
- Handle missing/invalid config file with clear error messages
- Eliminate double VTK read in batch profiles analysis
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

Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.


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

You can also share your feedback on Copilot code review. Take the survey.

shaia added 6 commits March 18, 2026 20:51
Avoid forcing matplotlib Agg backend on Windows or systems with
DISPLAY set, so interactive commands like monitor can use GUI backends.
read_vtk_file() can raise ValueError for malformed VTK content.
Treat it as a non-fatal read failure so the monitor keeps running.
The --output flag was ambiguously used as both a file path and directory.
Add --output-dir for --export-frames to make the distinction clear.
The field animation type was listed in --type choices but omitted
from the --all loop.
Catch ValueError from malformed VTK files in animate, vorticity,
and profiles commands to show clean error messages instead of tracebacks.
Treat invalid VTK content as a non-fatal warning so other batch
jobs can continue instead of aborting the entire run.
@shaia shaia requested a review from Copilot March 19, 2026 06:15
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

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.


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

You can also share your feedback on Copilot code review. Take the survey.

- Stop monitor loop when plot window is closed (close_event + fignum_exists)
- Fix headless detection to only force Agg on Linux without DISPLAY/WAYLAND
- Use st_mtime instead of st_ctime for latest file detection (Unix compat)
@shaia shaia merged commit d673ee3 into master Mar 19, 2026
1 check passed
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.

2 participants