Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .agents/skills/thincurr-model/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
```
Expand Down
8 changes: 8 additions & 0 deletions .agents/skills/thincurr-model/scripts/inspect_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
failed hole verification).
"""
import argparse
import inspect
import json
import os
import sys
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions .agents/skills/thincurr-run/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
```
Expand Down
8 changes: 8 additions & 0 deletions .agents/skills/thincurr-run/scripts/run_thincurr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
examples. Build and verify the model first (thincurr-model skill).
"""
import argparse
import inspect
import json
import os
import sys
Expand All @@ -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


Expand Down
4 changes: 3 additions & 1 deletion .agents/skills/tokamaker-equilibrium/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down