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

Should CodeList contain a dict of codes? #209

Closed
phackstock opened this issue Dec 16, 2022 · 2 comments
Closed

Should CodeList contain a dict of codes? #209

phackstock opened this issue Dec 16, 2022 · 2 comments

Comments

@phackstock
Copy link
Contributor

phackstock commented Dec 16, 2022

While working on #205 I noticed that we are (almost) never using the lookup property that using a dictionary Dict[str, Code] over a list of Code objects gives us.
If there are no applications for the lookup I would suggest changing it so that CodeList contains an actual list of codes and not a dictionary.
Not a real priority though just something I noticed and might confuse contributors.

@danielhuppmann
Copy link
Member

It may not be relevant for the automated processing, but when actually working with the DataStructureDefinition, I do find it helpful to look at the attributes of a variable from a Jupyter notebook environment like

DataStructureDefinition.variable["Final Energy"]

So I would keep a way to access a Code in this way.

@phackstock
Copy link
Contributor Author

Fair point, that is a nice feature indeed. I'll close this one then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants