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

Clean error message for check_out() and refactor to ..._solution #73

Merged
merged 3 commits into from Jul 30, 2018

Conversation

danielhuppmann
Copy link
Member

This PR migrates the error message when checking out a Scenario with a solution from Java to Python, to get the correct function names: remove_solution() instead of the underlying Java function removeSol().

In addition, the PR adds a function has_solution() and renames remove_sol() to remove_solution(). The kwarg of clone() is changed from keep_sol to keep_solution, but keep_sol continues to work (with a deprecation warning).

Closes #71

@danielhuppmann danielhuppmann added the enh New features & functionality label Jul 27, 2018
@danielhuppmann
Copy link
Member Author

danielhuppmann commented Jul 27, 2018

CircleCI passed with tests using deprecated clone(..., keep_sol=False) formulation. Now updated the tests formulation to keep_solution=False to avoid deprecated-warnings when running continuous integration.

"""delete the solution (variables and equations) from the sceanario"""
self.clear_cache() # reset Python data cache
self._jobj.removeSolution()
if self.has_solution():
Copy link
Member

Choose a reason for hiding this comment

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

if not self.has_solution():
   raise
...

@gidden
Copy link
Member

gidden commented Jul 30, 2018

Ok, just going to merge, not worth changing at this point. Thanks @danielhuppmann!

@gidden gidden merged commit bb4395b into iiasa:master Jul 30, 2018
@gidden
Copy link
Member

gidden commented Jul 30, 2018

hey @danielhuppmann, I forgot to think about the release notes. probably worth adding a note that there is a new has_solution() function..

danielhuppmann added a commit to danielhuppmann/ixmp that referenced this pull request Jul 30, 2018
gidden pushed a commit that referenced this pull request Jul 30, 2018
@danielhuppmann danielhuppmann deleted the check_out_error_msg branch July 31, 2018 06:15
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.

None yet

2 participants