fluxopt.math.solve
¶
Run a :class:~fluxopt.model_data.ModelData through the streaming engine.
Functions:
| Name | Description |
|---|---|
solve |
Build data as a streaming program and solve it. |
solve
¶
solve(
data: ModelData,
objective: str | dict[str, float],
*,
solver_name: str = 'highs',
solver_options: Mapping[str, Any] | None = None,
math: Spec | None = None,
dimensions: Mapping[str, Any] | None = None,
lookups: Mapping[str, Any] | None = None,
parameters: Mapping[str, Any] | None = None,
) -> Result
Build data as a streaming program and solve it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
ModelData
|
The model data. The same object the linopy backend consumes. |
required |
|
str | dict[str, float]
|
Effect id, or effect ids mapped to objective weights. |
required |
|
str
|
|
'highs'
|
|
Mapping[str, Any] | None
|
Forwarded to the solver verbatim, in its own
vocabulary rather than linopy's ( |
None
|
|
Spec | None
|
An edited program to solve instead of the shipped one — the
model returned by :meth: |
None
|
|
Mapping[str, Any] | None
|
Labels for the dimensions math adds, as
|
None
|
|
Mapping[str, Any] | None
|
Data for the lookups math adds, as |
None
|
|
Mapping[str, Any] | None
|
Data for the parameters math adds, as
The three are the language's own declaration blocks, and
:class: None of the three may overwrite a name the program already binds:
a caller who could silently replace |
None
|
Returns:
| Type | Description |
|---|---|
Result
|
The same :class: |
Raises:
| Type | Description |
|---|---|
UnsupportedFeatureError
|
If data uses a feature the program does not express yet. |
NoSolutionError
|
If the solve produced no primal solution — lpspec's own, so one class covers a sweep whichever lane ran. |