Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

Migrates the legacy Java-based Modelica plugin to the Python-based fz framework structure, following the pattern established by other fz model plugins.

Changes

Core Plugin Structure

  • .fz/models/Modelica.json - Model definition with variable prefix $, delimiter {}, and CSV output parsing via pandas
  • .fz/calculators/Modelica.sh - Execution script with enhanced directory/multi-file handling (previously single-file only)
  • .fz/calculators/localhost.json - Calculator configuration mapping model to execution script

Configuration Migration

Old .ioplugin DSL → JSON configuration:

  • variableStartSymbolvarprefix
  • variableLimitdelim
  • Custom output DSL (>> operators) → Shell commands with Python/pandas
  • Variable syntax remains ${var~default} (backward compatible)

Documentation & Examples

  • README.md - Installation, usage, API reference
  • MIGRATION.md - Old vs new plugin comparison, upgrade path
  • INSTALL_OPENMODELICA.md - Platform-specific omc installation
  • examples/ - Single case, parametric study, cache usage demonstrations
  • tests/verify_installation.py - Automated structure validation

Sample Model

model NewtonCooling "An example of Newton's law of cooling"
  parameter Real h=${convection~0.7} "Convective cooling coefficient";
  ...
end NewtonCooling;

Usage:

import fz

results = fz.fzr(
    "samples/NewtonCooling.mo",
    {"convection": [0.1, 0.3, 0.5, 0.7, 0.9]},
    "Modelica",
    calculators="localhost",
    results_dir="results"
)

CI/CD

GitHub Actions workflow validates JSON files, shell syntax, and directory structure on push/PR.

Original prompt

Create a repository porting old modelica plugin (https://github.com/Funz/plugin-modelica) to new fz. See https://github.com/Funz/fz to get details of new fz "model" plugins (mostly files in .fz/models/... and .fz/calculators/...)


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

Copilot AI changed the title [WIP] Port old Modelica plugin to new fz framework Port Modelica plugin to fz framework Oct 28, 2025
Copilot AI requested a review from yannrichet-asnr October 28, 2025 08:45
@yannrichet-asnr yannrichet-asnr merged commit 41fd15a into main Oct 28, 2025
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