diff --git a/.agents/skills/thincurr-model/SKILL.md b/.agents/skills/thincurr-model/SKILL.md index 020e969a0..a22dc5270 100644 --- a/.agents/skills/thincurr-model/SKILL.md +++ b/.agents/skills/thincurr-model/SKILL.md @@ -33,6 +33,11 @@ of a `thincurr-run` case file (`mesh_file`, `xml_file`, `jumper_start`, ## Before anything else +To verify a model with native setup, use an OFT source build whose +`ThinCurr.setup_model()` accepts `insulated_junctions`. The 26.9 release +can import successfully but lacks this option. File-only inspection +(`--no-setup`) does not need an OFT build. + ```bash python -c "from OpenFUSIONToolkit.ThinCurr import ThinCurr; print('ok')" ``` diff --git a/.agents/skills/thincurr-model/scripts/inspect_model.py b/.agents/skills/thincurr-model/scripts/inspect_model.py index 19fead825..a5f3e8c3a 100644 --- a/.agents/skills/thincurr-model/scripts/inspect_model.py +++ b/.agents/skills/thincurr-model/scripts/inspect_model.py @@ -17,6 +17,7 @@ failed hole verification). """ import argparse +import inspect import json import os import sys @@ -228,6 +229,13 @@ def setup_and_query(mesh_file, xml_file, jumper_start, insulated, nthreads): _load_oft() from OpenFUSIONToolkit import OFT_env from OpenFUSIONToolkit.ThinCurr import ThinCurr + setup_model = getattr(ThinCurr, 'setup_model', None) + parameters = inspect.signature(setup_model).parameters if callable(setup_model) else {} + insulated_parameter = parameters.get('insulated_junctions') + if (insulated_parameter is None or + insulated_parameter.kind in (inspect.Parameter.POSITIONAL_ONLY, inspect.Parameter.VAR_POSITIONAL)): + raise ValueError('This skill requires ThinCurr.setup_model() with insulated_junctions. ' + 'Use an OpenFUSIONToolkit source build that provides it. See the oft-build skill.') myOFT = OFT_env(nthreads=nthreads) tw_model = ThinCurr(myOFT) tw_model.setup_model(mesh_file=oft_path(mesh_file), xml_filename=oft_path(xml_file), jumper_start=jumper_start, diff --git a/.agents/skills/thincurr-run/SKILL.md b/.agents/skills/thincurr-run/SKILL.md index 4e917ebc1..8d02d9eb2 100644 --- a/.agents/skills/thincurr-run/SKILL.md +++ b/.agents/skills/thincurr-run/SKILL.md @@ -18,6 +18,10 @@ Supported analyses: ## Before anything else +Use an OFT source build whose `ThinCurr.setup_model()` accepts +`insulated_junctions`. The 26.9 release can import successfully but lacks +this option. The driver checks for it before setting up the model. + ```bash python -c "from OpenFUSIONToolkit.ThinCurr import ThinCurr; print('ok')" ``` diff --git a/.agents/skills/thincurr-run/scripts/run_thincurr.py b/.agents/skills/thincurr-run/scripts/run_thincurr.py index c79f3d234..23ca419cc 100644 --- a/.agents/skills/thincurr-run/scripts/run_thincurr.py +++ b/.agents/skills/thincurr-run/scripts/run_thincurr.py @@ -12,6 +12,7 @@ examples. Build and verify the model first (thincurr-model skill). """ import argparse +import inspect import json import os import sys @@ -36,6 +37,13 @@ def _load_thincurr(): sys.path.append(os.path.join(root_path, 'python')) from OpenFUSIONToolkit import OFT_env from OpenFUSIONToolkit.ThinCurr import ThinCurr + setup_model = getattr(ThinCurr, 'setup_model', None) + parameters = inspect.signature(setup_model).parameters if callable(setup_model) else {} + insulated_parameter = parameters.get('insulated_junctions') + if (insulated_parameter is None or + insulated_parameter.kind in (inspect.Parameter.POSITIONAL_ONLY, inspect.Parameter.VAR_POSITIONAL)): + raise SystemExit('ERROR: This skill requires ThinCurr.setup_model() with insulated_junctions. ' + 'Use an OpenFUSIONToolkit source build that provides it. See the oft-build skill.') return OFT_env, ThinCurr diff --git a/.agents/skills/tokamaker-equilibrium/SKILL.md b/.agents/skills/tokamaker-equilibrium/SKILL.md index 768407e64..de5aba2ba 100644 --- a/.agents/skills/tokamaker-equilibrium/SKILL.md +++ b/.agents/skills/tokamaker-equilibrium/SKILL.md @@ -13,7 +13,9 @@ Two modes: ## Before anything else -Check that the Python package imports. It needs a built/installed OFT: +Use an OFT source build that provides `TokaMaker.setup_model()`. The 26.9 +release can import successfully but lacks this method. The driver checks +for the method before setting up the model. ```bash python -c "from OpenFUSIONToolkit.TokaMaker import TokaMaker; print('ok')" diff --git a/.agents/skills/tokamaker-equilibrium/scripts/run_equilibrium.py b/.agents/skills/tokamaker-equilibrium/scripts/run_equilibrium.py index 35d5b2701..9d8cbead0 100644 --- a/.agents/skills/tokamaker-equilibrium/scripts/run_equilibrium.py +++ b/.agents/skills/tokamaker-equilibrium/scripts/run_equilibrium.py @@ -28,6 +28,9 @@ def _load_tokamaker(): sys.path.append(os.path.join(root_path, 'python')) from OpenFUSIONToolkit import OFT_env from OpenFUSIONToolkit.TokaMaker import TokaMaker + if not callable(getattr(TokaMaker, 'setup_model', None)): + raise SystemExit('ERROR: This skill requires TokaMaker.setup_model(). Use an OpenFUSIONToolkit ' + 'source build that provides it. See the oft-build skill.') from OpenFUSIONToolkit.TokaMaker.meshing import gs_Domain, load_gs_mesh from OpenFUSIONToolkit.TokaMaker.util import (create_isoflux, create_isoflux_xpts,