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

Add 'ixmp list' CLI command #240

Merged
merged 6 commits into from
Jan 9, 2020
Merged

Add 'ixmp list' CLI command #240

merged 6 commits into from
Jan 9, 2020

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Dec 18, 2019

Closes #202.

How to review

  • Run the command against a platform/backend with many Scenarios, e.g. $ ixmp --platform GP3 list.
  • Run $ ixmp list --help, view and try the different options.
  • Is there any other functionality that would be useful?

PR checklist

  • Tests added.
  • Documentation added.
  • Release notes updated.

@khaeru khaeru added this to the 2.0 milestone Dec 18, 2019
@khaeru khaeru self-assigned this Dec 18, 2019
@francescolovat
Copy link
Contributor

@khaeru thank you for your contribution. I think this is really useful.

I've check the list CLI and it works nicely in my PC as well. I've also tested the options in my local database.

I don't completely get what the purpose of the option --default-only, is it just showing scenarios with just 1 version? (I mean created with the argument version='new' and never ran again?)

I think this PR is ready to merge.

@khaeru
Copy link
Member Author

khaeru commented Jan 9, 2020

Thanks for the review!

I don't completely get what the purpose of the option --default-only, is it just showing scenarios with just 1 version? (I mean created with the argument version='new' and never ran again?)

Good question…this is just mirroring the ‘default’ parameter to Platform.scenario_list():

default (bool, optional) – Return only the default version of each TimeSeries/Scenario (see TimeSeries.set_as_default()). Any (model, scenario) without a default version is omitted. If False, return all versions.

That behaviour is a little counter-intuitive, in my opinion…even the idea of having a "default" version of a scenario is kind of an imperfect copy of what git does with chains of commits and branches and the HEAD pointer.

But anyway, this PR doesn't try to change that behaviour (although we could change it later). It just provides a CLI flag to give a True or False value for this parameter.

@khaeru khaeru added the enh New features & functionality label Jan 9, 2020
@khaeru khaeru merged commit 0634e49 into iiasa:master Jan 9, 2020
@khaeru khaeru deleted the issue/202 branch January 9, 2020 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'ixmp list' CLI command to print the list of model/scenario strings on a platform
2 participants