calliope-project / calliope

A multi-scale energy systems modelling framework

Home Page:https://www.callio.pe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New object-oriented backend API

brynpickering opened this issue · comments

Problem description

In #429, I introduced a backend api available at Calliope.Model.backend. E.g., to view parameters: model.backend.parameters; to update a parameter: model.backend.update_parameter("param_name", ...), etc.

If we wrapped the backend component arrays in a class, we could move some of this functionality more nested objects with associated methods, e.g., model.backend.parameters has each parameter as an attribute. these paramter classes can then be updated model.backend.parameters.param_name.update(...) or simply viewed: model.backend.parameters.param_name.data. The benefit of this is that you get tab autocompletion for free, and it is probably the more "pythonic" way to implement the API.

However, the current approach works. So maybe this is low priority to implement.

Calliope version

v0.7.0.dev