To use this notebook you must have a (free) FEO account, available here. You may then install the feo-client library, if necessary, and then use the package to log in. You can also run notebook in a Colab notebook via the badge below.
!pip install feo-client
from feo.client.auth import login
login()
System Models¶
Object-oriented interface for System Models via the Python Client
System Models are representations of energy and material flows, usually optimised by economic logic like least-costs-minimisation.
System models in FEO are composed of three objects - Models, Scenarios, and Runs.
- Models describe the geographic, temporal, and sectoral scope of the systems model.
- Scenarios are narrative counter-factuals of the future, which may be accompanied by numeric projections
- Runs are solutions to parameterised systems models, used to explore uncertainty
from feo.client import Model, Run, Scenario
The Model
client can be used to search and retrieve model objects.
Model.search(model_slug="feo-global-indonesia")
Models can also be retrieved directly by id
idn_model = Model.from_id("feo-global-indonesia")
The scope nodes of the model can be retrieved from the model object
idn_model.node_ids
Scenarios associated can also be retrieved from the model object.
for scenario in idn_model.scenarios:
print(scenario)
... as can the runs associated with scenarios
scenario = idn_model.scenarios[1]
for run in scenario.runs:
print(run)
Any scenario or run object can also be instantiated directly from their id
coal_retirement_scenario = Scenario.from_id("feo-global-indonesia:coal-retirement")
coal_retirement_demo_run = Run.from_id("feo-global-indonesia:coal-retirement:main")
Run Data¶
System model results can be obtained from the Run.results
object.
coal_retirement_demo_run.results
For capacity expansion models, the results object has node_capacity
and edge_capacity
data. Each data type is exposed via a ResultsCollection
object on Run.results
.
coal_retirement_demo_run.results.node_capacity
Each ResultsCollection
object can be filtered according to the node
or edge
that is of interest, particular technologies in the case of capacity
or production
, or particular commodities in the case of trade
or price
.
node_capacity = coal_retirement_demo_run.results.node_capacity
node_capacity[
(node_capacity.node_id == "IDN-JB") & (node_capacity.technology_type == "COA")
]