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

deprecated function used #192

Open
AnnikaSchultheiss opened this issue Nov 5, 2024 · 1 comment · May be fixed by #193
Open

deprecated function used #192

AnnikaSchultheiss opened this issue Nov 5, 2024 · 1 comment · May be fixed by #193

Comments

@AnnikaSchultheiss
Copy link

In model.py function clear() which calls solution.java.clearSolution() is not working for COMSOL 6.2.

See 6.2 COMSOL manual:

From version 5.3a, the method model.sol().clearSolution() is deprecated and replaced by the method
model.sol().clearSolutionData() since clearSolutionData generally works as expected, while clearSolution clears settings unexpectedly.

@john-hen
Copy link
Collaborator

john-hen commented Nov 5, 2024

Hi. Good catch. I think this can be safely replaced, given that we don't support Comsol versions older than 5.5 anyway. Do you want to create the PR? Other than in model.py, it seems that the method is also called directly from the test suite in two different places. But it's just a simple search-and-replace, and then maybe run the test suite.

I guesss I'd always been using .clearSolution(), even in the old Matlab scripts I used to use for Comsol automation way back when, and then never looked up the API documentation again. That would explain how it got there. I've never noticed that it "clears settings unexpectedly". Have you?

It is a bit strange they'd introduce a new method for what sounds like a bug fix. Seems unnecessary. Probably also means that, even though deprecated, it will probably never actually be removed.

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 a pull request may close this issue.

2 participants