-
Notifications
You must be signed in to change notification settings - Fork 110
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
Harmonize handling of codelists #274
Labels
enh
New features & functionality
Comments
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the 2020-03-04 MESSAGE meeting, we discussed that several items in the ixmp data model are actually instances of a common concept. Namely:
Using the terminology of SDMX: these are 5 different codelists; lists of codes. Some are hierarchical (e.g. ‘node’); others are not. Some have only their short string ID; others also have a name (e.g. ‘node’), description, or annotation.
Currently, the
ixmp.backend.base.Backend
API has a proliferation of methods, each with slightly different semantics, for dealing with each of these. The proliferation of different types of objects in the data model makes it more costly to develop other, entirely open source Backends as alternatives to JDBCBackend, as targeted in #278We should:
Add methods:
get_codes(codelist)
set_code(codelist, id, name=None, description=None, **attrs)
delete_code(codelist, id)
Valid values will be:
Delete methods:
get_nodes
,get_timeslices
,get_units
,set_node
,set_timeslice
,set_unit
,add_model_name
,get_model_names
,add_scenario_name
,get_scenario_names
.delete_code(...)
will raise NotImplementedError where the functionality is lacking.codelist
, so that:mp.codelist['region']
is the same asmp.get_regions()
, etc.add_code(...)
with the same signature asBackend.set_code()
.This should be addressed after #264 is completed and merged.
The text was updated successfully, but these errors were encountered: