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

Refactor the facade API to create/get runs #35

Merged
merged 9 commits into from
Dec 13, 2023

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Dec 12, 2023

As just discussed, this PR changes the API to create/get runs from the (implicit)

Platform.Run(model, scenario, version="new")

to the more pythonic

Platform.runs.create(model, scenario)

and a corresponding get

Platform.runs.get(model, scenario)

Maybe I'm a bit old-fashioned, but I'd still like to keep the default vs. non-default selection implicit in the get() method on the facade-layer.

fyi @pmussak @glatterf42

@danielhuppmann danielhuppmann marked this pull request as ready for review December 12, 2023 16:03
tests/core/test_run.py Show resolved Hide resolved
ixmp4/core/run.py Outdated Show resolved Hide resolved
ixmp4/core/run.py Outdated Show resolved Hide resolved
Co-authored-by: Fridolin Glatter <83776373+glatterf42@users.noreply.github.com>
Copy link
Member

@glatterf42 glatterf42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me. One note, though: at the moment, the only place where we test providing the version parameter to runs.get() is in test_benchmarks, so it might seem untested by simply looking at test_run. It is tested, so things are fine, but the test location is not very intuitive.

@danielhuppmann
Copy link
Member Author

At the moment, the only place where we test providing the version parameter to runs.get() is in test_benchmarks, so it might seem untested by simply looking at test_run.

Thanks for that observation, I added a test for that in the test_run.py

Copy link
Contributor

@meksor meksor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@danielhuppmann danielhuppmann merged commit fef0783 into iiasa:main Dec 13, 2023
4 checks passed
@danielhuppmann danielhuppmann deleted the facade/runs branch December 13, 2023 13:50
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

Successfully merging this pull request may close these issues.

None yet

3 participants