Skip to content

Refactor repository structure to match fz-Model template and integrate reference CATHARE script#2

Merged
yannrichet-asnr merged 6 commits intomainfrom
copilot/refactor-repo-to-match-template
Dec 5, 2025
Merged

Refactor repository structure to match fz-Model template and integrate reference CATHARE script#2
yannrichet-asnr merged 6 commits intomainfrom
copilot/refactor-repo-to-match-template

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

Aligns fz-cathare with the standard fz-Model plugin template structure for consistency across the Funz plugin ecosystem. Integrates the reference CATHARE calculator script from the original plugin-Cathare project and adds complete CNV22 test case example.

Structural Changes

  • examples/: Created examples/input.txt with parametric variable examples (flattened structure)
  • examples/CNV22/: Added complete CATHARE test case with input files (CNV22, CNV22g) and output files (FORT07, listing, etc.)
  • calculators/: Added Cathare.sh executable script based on reference implementation; renamed Localhost_Cathare.jsonlocalhost_Cathare.json
  • tests/: Added test_plugin.py for structure validation
  • docs/: Created example_usage.ipynb Jupyter notebook with interactive examples
  • ci/: Added .github/workflows/ci.yml with test, lint, and docs jobs

Removed

  • CHANGELOG.md and PORTING_SUMMARY.md - removed to match template (only README.md remains)
  • examples/Cathare/ subdirectory - flattened to examples/ directory
  • Mock references - removed from Cathare.sh; now uses production workflow

Updated Components

  • example scripts: Removed sys.path workarounds, updated paths to reference examples/CNV22/output
  • .gitignore: Added results/, *.out, *.msg, PID, .fz/tmp/
  • README: Directory structure diagram, CNV22 example documentation, expanded testing documentation, updated calculator references
  • Cathare.sh: Based on reference script from plugin-Cathare supporting full workflow (reader → cathar → postpro) with error checking and CATHARE_HOME environment variable support

CATHARE Calculator Script

The Cathare.sh script is based on the original plugin-Cathare implementation and includes:

  • Full CATHARE workflow: version check, reader (with mask support), permanent initial calculations, main calculation, post-processing
  • Environment variable support: CATHARE_HOME (defaults to /opt/CATHARE2_V25_3_MOD931)
  • Error checking at each step (reader, calculation, post-processing)
  • Automatic cleanup of temporary files
  • Portable exit codes

CNV22 Example

Complete CATHARE test case in examples/CNV22/:

  • input/: CNV22 main input file and CNV22g graphical specification
  • output/: Reference output files including FORT07 with EVOLUTION data, listing files, restart files
  • Demonstrates output parsing with real CATHARE results
  • FORT07 contains multiple EVOLUTION sections (ML, MV, P0, P8, QL, QV) correctly parsed by plugin

Template Alignment

Component Status
Only README.md (no extra .md files)
CI workflow
examples/ directory (flat structure)
Calculator shell script
Lowercase calculator config
test_plugin.py
example_usage.ipynb
Reference CATHARE script
CNV22 complete example

All existing test data in tests/CNV22/ and FORT07 parsing functionality preserved unchanged.

Original prompt

refactor repository to match template fz-Model


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 5, 2025 13:54
Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor repository to match template fz-Model Refactor repository structure to match fz-Model template Dec 5, 2025
Copilot AI requested a review from yannrichet-asnr December 5, 2025 14:02
@yannrichet-asnr
Copy link
Member

@copilot go closer to template fz-Model: most .md files are not needed, CI missing, notebook missing, subdir examples/cathare not needed. Do not include mock anywhre, just assume Cathare code is available.

…examples, remove mock references

Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot go closer to template fz-Model: most .md files are not needed, CI missing, notebook missing, subdir examples/cathare not needed. Do not include mock anywhre, just assume Cathare code is avail...

Done in commit b7cef3f:

✓ Removed CHANGELOG.md and PORTING_SUMMARY.md (only README.md remains)
✓ Added .github/workflows/ci.yml with test, lint, and docs jobs
✓ Notebook example_usage.ipynb already exists
✓ Flattened examples structure: examples/input.txt (removed Cathare subdirectory)
✓ Removed all mock references from Cathare.sh - now assumes CATHARE code is available

All plugin structure tests pass.

@yannrichet-asnr
Copy link
Member

@copilot use this cathare script, and https://github.com/Funz/plugin-Cathare/blob/master/src/main/scripts/Cathare.sh and check taht output is well parsed using https://github.com/Funz/plugin-Cathare/tree/master/src/test/cases/CNV22/output example (to also import in examples/)

Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot use this cathare script, and https://github.com/Funz/plugin-Cathare/blob/master/src/main/scripts/Cathare.sh and check taht output is well parsed using https://github.com/Funz/plugin-Cathare/t...

Done in commit bc73995:

✓ Updated Cathare.sh based on reference script from plugin-Cathare (supports full reader → cathar → postpro workflow)
✓ Added CNV22 complete example to examples/CNV22/ (input and output directories)
✓ Verified output parsing works with FORT07 from CNV22 example
✓ Updated example.py and example_parametric_study.py to use examples/CNV22/output
✓ Updated README with CNV22 example documentation and usage instructions
✓ Updated CI to check for CNV22 example directory

All plugin structure tests pass.

… code, fix indentation

Co-authored-by: yannrichet-asnr <148193180+yannrichet-asnr@users.noreply.github.com>
Copilot AI changed the title Refactor repository structure to match fz-Model template Refactor repository structure to match fz-Model template and integrate reference CATHARE script Dec 5, 2025
@yannrichet-asnr yannrichet-asnr marked this pull request as ready for review December 5, 2025 16:50
@yannrichet-asnr yannrichet-asnr merged commit ab1b05b into main Dec 5, 2025
6 checks 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