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

Fix imports #156

Merged
merged 10 commits into from
May 29, 2024
Merged

Fix imports #156

merged 10 commits into from
May 29, 2024

Conversation

@gtrevisan gtrevisan requested a review from lajz May 20, 2024 21:13
gtrevisan and others added 3 commits May 21, 2024 13:36
@gtrevisan
Copy link
Member Author

@lajz

(1)
could you please elaborate the case in which from MDSplus import mdsExceptions might fail?
eg my simplification for C-MOD :

vs DIII-D:

try:
from MDSplus import mdsExceptions
except ImportError:
class mdsExceptions(Exception):
__getattr__ = lambda self, name: Exception

(2)
furthermore, which would be the proper way to handle MDSplus exceptions?


or

?

@lajz
Copy link
Collaborator

lajz commented May 28, 2024

It is exclusively for older versions of MDSPlus that use a different error type, pre-2017, I believe (these are on iris). Hence, given our previous discussions, I will remove the try-catch. Additionally, the method used to catch the error in CMod is correct. Thanks for the pointers.

@gtrevisan
Copy link
Member Author

at this point what about just changing:

from MDSplus import mdsExceptions

to:

from MDSplus.mdsExceptions import MdsException

in order to directly use it?

@lajz
Copy link
Collaborator

lajz commented May 28, 2024

I looked at doing that, but they use quite a few other error types from mdsException in the cmod basic request file. I think that a future PR should be changing to the more specific error types.

@gtrevisan gtrevisan merged commit 5590f32 into dev May 29, 2024
6 checks passed
@gtrevisan gtrevisan deleted the fix-imports branch May 29, 2024 13:35
@gtrevisan gtrevisan mentioned this pull request May 29, 2024
@gtrevisan gtrevisan added the linting Modifications about linting, formatting, and style label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linting Modifications about linting, formatting, and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants