Skip to content

Use model-declared ION variable names#4

Open
cjc0013 wants to merge 2 commits into
NSA-Computer-Exchange:mainfrom
cjc0013:fix-run-variable-names-1
Open

Use model-declared ION variable names#4
cjc0013 wants to merge 2 commits into
NSA-Computer-Exchange:mainfrom
cjc0013:fix-run-variable-names-1

Conversation

@cjc0013
Copy link
Copy Markdown

@cjc0013 cjc0013 commented May 9, 2026

Summary:

  • Read the model input and output variable names from model.json.
  • Keep data_in / data_out as fallbacks for older models that omit variable metadata.

Test plan:

  • python -m py_compile tools\run.py
  • git diff --check

Closes #1

Copy link
Copy Markdown
Contributor

@theblackapple5150 theblackapple5150 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — this is the right direction and fixes an issue I wanted to address.

I’m going to request a couple small cleanup changes before merging:

  • Add the missing comma in the payload dict
  • Remove the duplicate meta.json loading block
  • Remove the duplicate “Saved as” print
  • Adjust output validation so it accepts either the model-defined output variable or data_out as a fallback, instead of requiring both

Once that’s cleaned up, I’m good with merging this.

@cjc0013
Copy link
Copy Markdown
Author

cjc0013 commented May 20, 2026

Thanks, fixed those cleanup items in the latest commit.

What changed:

  • Added the payload dict comma.
  • Kept the single metadata-loading path and single final saved-output print.
  • Updated output validation so the response can contain either the model-declared output variable or the legacy data_out fallback.

Verified locally with:

  • python -m py_compile tools\run.py
  • python -m compileall -q tools ioncli security
  • git diff --check

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.

ION Scripts require fixed variable names (data_in / data_out)

2 participants