-
Notifications
You must be signed in to change notification settings - Fork 6
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
Show extended run-"index" from Platform.meta.tabulate()
#33
Conversation
The implementation follows the approach in |
I think there is a strong argument to be made to do this (optionally) in the database layer. Performance wise there is definitely a difference: for big tables I expect faster execution and less memory usage in the database. There is already similar functionality in the DataPointRepository when supplying ixmp4/ixmp4/data/db/iamc/datapoint/repository.py Lines 159 to 173 in 6eead51
More detail in Side note: |
Thanks for the feedback. Just for my understanding, does the faster database-execution outweigh the downside of sending a table twice the size via the Rest API? |
That's a good question. My guess: yes, since gzip will hopefully take care of compressing away any repeating patterns and sending a seperate request for the list of all runs also presents some overhead. |
closing in favor of #37 |
While further working on the pyam-imxp4-integration, I noticed an inconsistency:
Platform.runs.tabulate()
returns a dataframe with the columns run-id, model, scenario, versionPlatform.iamc.tabulate()
returns a dataframe with (only) the "user-readable index" model, scenario, version, ...Platform.meta.tabulate()
returns a dataframe only with (only) the run-id, ...In actual work (like the pyam-integration), the model-scenario-version is more relevant.
So this PR extends the
Platform.meta.tabulate()
to return the "extended index" of model-name, scenario-name and version number.As a utility, the PR also adds a
map()
endpoint to the model- and scenario-repository for easy translation of id's to names.If there is a need for having (only) the run-id at the facade/core-layer, I'd be happy to implement that as a kwarg to both iamc/meta tabulate methods (and if someone has a good suggestion for the name of that argument...)