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

IxException not handled correctly in Scenario.remove_solution() #85

Open
alexkoberle opened this issue Sep 5, 2018 · 2 comments
Open

Comments

@alexkoberle
Copy link

alexkoberle commented Sep 5, 2018

When trying to modify a scenarios with a solution, it throws an error saying:

at.ac.iiasa.ixmp.exceptions.IxExceptionPyRaisable: at.ac.iiasa.ixmp.exceptions.IxException: This Scenario has elements in a variable or equation! Use 'removeSolution()' or clone(False)'before editing!

removeSolution() is deprecated. Actual name is remove_sol().

@khaeru
Copy link
Member

khaeru commented Aug 9, 2019

removeSolution() is the correct method name in the Java code, ixmp_source:
https://github.com/iiasa/ixmp_source/blob/1000dfcca661377666b32a4a0783a8f99309203b/src/main/java/at/ac/iiasa/ixmp/objects/Scenario.java#L1291

The bug here is that ixmp is letting the IxException raised by ixmp_source pass through to the user directly. Instead, ixmp should catch this exception and re-raise it with the proper message.

@khaeru khaeru changed the title Error message outdated IxException not handled correctly in Scenario.remove_solution() Aug 9, 2019
@khaeru
Copy link
Member

khaeru commented Jan 24, 2020

@DIUANA in #256 reported another instance, in Scenario.init_set(), that can be fixed at the same time as this one.

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

No branches or pull requests

2 participants