Skip to content
Back to skills

Data And Io

ASecurity

"Guides Pyomo users through AbstractModel loading, DataPortal

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
toolsgodebuggingbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-and-io --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data And Io?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data And Io
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-and-io/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-and-io)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-and-io
description: "Guides Pyomo users through AbstractModel loading, DataPortal
  input, and file-backed model initialization."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Data and IO

Use this sub-skill when the task begins with a data file, a spreadsheet, a
configuration file, or an `AbstractModel` that needs `create_instance()`.

## What this sub-skill covers

- `AbstractModel` and `create_instance()` workflows.
- `DataPortal` and file-backed model initialization.
- `.dat`, `.tab`, Excel, YAML, and JSON inputs.
- Tutorial-style data loading and model instantiation.

## What to route elsewhere

- Pure model construction without external data goes to `modeling-basics`.
- `pyomo solve`, `pyomo convert`, and config-template questions go to
  `solve-and-cli`.
- GDP, DAE, network, MPEC, and units go to `structured-modeling`.
- Solver/back-end or GUI dependency issues go to `solver-extensions`.

## Read these references

- `../../references/data-and-io.md` for verified file-loading patterns and data
  families.
- `../../references/cli-reference.md` when the same data file is passed through
  a Pyomo CLI command.
- `../../references/troubleshooting.md` when a load fails because of a missing
  package, a bad namespace, or a schema mismatch.

## Use this helper

- `../../scripts/check_import.py` for a quick import and metadata sanity check
  before debugging a data-loading issue.

## Typical workflow

1. Declare an `AbstractModel` with the sets and parameters the data will fill.
2. Map the data file structure to the model indices and domains.
3. Load the data with `create_instance()` or `DataPortal`.
4. Inspect the instantiated model with `pprint()`.
5. Only then connect the instance to a solver or transformation.

## Common request patterns

- "How do I load a `.dat` file into my model?"
- "How do I use namespaces with `DataPortal`?"
- "How do I read Excel or tabular inputs into Pyomo?"
- "Why does `create_instance()` complain about missing indices?"
- "How do I generate or read a JSON/YAML config for a Pyomo run?"

## Common failure modes

- A set dimension in the data does not match the model declaration.
- A parameter value is missing or appears under the wrong namespace.
- Spreadsheet helpers are unavailable because optional packages are missing.
- A file path is wrong, relative to the wrong working directory, or only valid
  inside the original checkout.

## Practical guidance

- Keep the initial data example as small as possible.
- Verify the schema before scaling to a large file.
- Prefer explicit namespaces and explicit indices when multiple data blocks are
  involved.
- Use the tutorial-style examples as a reference pattern, but do not depend on
  the original repository path at runtime.

## Examples of what belongs here

- `AbstractModel` plus one `.dat` file.
- `DataPortal` loading from a table or spreadsheet.
- A CLI invocation that loads model data from a config file.

## Examples of what does not belong here

- Solver selection and execution flags.
- DAE, GDP, network, or complementarity workflows.
- Optional solver or GUI backends that are unrelated to file loading.

## Related routes

- Move to `modeling-basics` when the data file is not the main problem.
- Move to `solve-and-cli` when the task is about CLI execution after data load.
- Move to `structured-modeling` when the model family is GDP, DAE, network,
  MPEC, or units.

Files in this skill

  • SKILL.md3.4 KB
  • references/troubleshooting.md1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.