Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New object-oriented backend API #510

Open
brynpickering opened this issue Oct 27, 2023 · 0 comments
Open

New object-oriented backend API #510

brynpickering opened this issue Oct 27, 2023 · 0 comments
Labels
v0.7 (upcoming) version 0.7
Milestone

Comments

@brynpickering
Copy link
Member

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

@brynpickering brynpickering added the v0.7 (upcoming) version 0.7 label Oct 27, 2023
@brynpickering brynpickering added this to the 0.7.0.b1 milestone Oct 27, 2023
@brynpickering brynpickering modified the milestones: 0.7.0.b1, 0.7.0 Jan 25, 2024
@brynpickering brynpickering modified the milestones: 0.7.0, 0.7.x Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.7 (upcoming) version 0.7
Projects
None yet
Development

No branches or pull requests

1 participant