Python API¶
The top-level continuo package exposes a small, focused API: a
parser, a model object that wraps the parsed file with its solvers, and
a solution object that wraps the solved path. The remaining modules
(parser, IR, codegen, solve) are public to the extent that their
exceptions are catchable by the user, but their internals are
implementation details.
Entry points¶
The Model object¶
The Solution object¶
- class continuo.io.solution.Solution(segments, names, diagnostics=<factory>, converged=True)[source]¶
Bases:
objectA solved path over
[0, T], glued from one or more segments.- Parameters:
A Solution aggregates one or more Segment
records (one per active belief — see The shocks block):
Exceptions¶
Each pipeline stage raises a dedicated exception so user code can
distinguish where a problem originated. All four inherit from
Exception (not from one another); a CLI-style “any pipeline error”
catch is except (MacroError, LarkError, IRError, CodegenError,
SolveError).
- exception continuo.macro.MacroError(message, *, file=None, line=None)[source]¶
Bases:
ExceptionA macro-layer error, optionally carrying a source position.
The expression layer raises these without a position; the expansion driver attaches
file/lineas it unwinds.
- exception continuo.ir.IRError(message, pos=None)[source]¶
Bases:
ExceptionA semantic error, optionally carrying a source position.
posrefers to the post-macroexpansion source; callers holding the macro line map format it back to the user’s original file.- Parameters:
message (str)
pos (SourcePos | None)