What is a Block?
A block is a container that includes two or more terms (inputs or outputs) and may also contain one or more functions. Blocks help structure complex project models by grouping related logic together. Blocks can represent:- A subsystem (e.g., battery, solar panel, electrolyzer)
- A financing structure (e.g., tax equity, project finance, grants)
- A business model configuration (e.g., PPA, merchant, hybrid)
Why Use Blocks?
Blocks are optional but recommended. They help you:- Stay organized: Group related terms and functions together
- Reuse logic: Apply blocks across multiple projects or scenarios
- Compare configurations: Give a block different values, formulas, or structure in different scenarios and compare them side by side
- Work efficiently: Reduce duplication and make updates easier
Code Blocks
A code block runs your own code inside the model. Package a Python or R function as a container, publish it to your organization’s registry, and the block calls it with terms from the model and writes the results back as terms. A degradation curve fitted in Python, a dispatch optimizer, or a proprietary engineering routine then recalculates with the rest of the model instead of living in a separate file.- Inputs are terms. Each input the function declares is mapped to a term with a matching unit and value type. Aire AI can propose the mapping for you.
- Outputs are terms. Every value the function returns becomes a term in the block, so formulas elsewhere in the model reference it like any other value.
- Runs when its inputs change. Change a mapped input and the block re-runs, and everything downstream of its outputs recalculates. Until the run finishes, the last value stays on screen and is marked out of date.
- Versioned. Point the block at a GitHub build, which follows the latest successful build, or pin it to a registry image tag that never moves. A branch can run a different version from its parent, and the merge review shows the configuration change.
- Traceable. Each run keeps its inputs, outputs, and logs, and Project History records which version produced a value.
Blocks in Scenarios
When you create a scenario, anything in a block can differ from the base: term values, formulas, or structure. You can change a single input, rewire the logic entirely, or add blocks that don’t exist in the base. The scenario is its own version of the model.Example: Solar Array Block
A solar array block might include:- Inputs: System Size (MW), Panel Efficiency (%), Inverter Capacity (MW), Tilt Angle (degrees)
- Outputs: Annual Generation (MWh), Capacity Factor (%), Levelized Cost ($/MWh)
Flexibility by Design
Blocks support multiple workflows. Some users start with fully modularized models, while others introduce blocks later as complexity grows. Both approaches work. You can:- Add terms directly to a project without blocks
- Group related terms into a block when structure helps
- Nest blocks within other blocks for complex systems
- Edit terms within or outside of block views
