-
Notifications
You must be signed in to change notification settings - Fork 0
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
python3.9 Enum issue #6
Comments
Thanks for submitting your question. I'm currently using Python 3.10 and have reproduced the issue. Pythonnet changed how they handle .NET enumerations in v3.0 and later. I can't identify why the exception is only thrown when using Python v3.9 or later, however this has been confirmed by other users of Pythonnet. Previously Pythonnet converted any .NET Enums to an int value. So the example wrapper, beamgagepy.py, had to adapt for that. This was a limitation of Pythonnet and so that is the way the example wrapper handles it. In theory, the change to Pythonnet should allow enums to be used more naturally, without using the integer values. This appears to require a rework to how the enumerations are handled in the wrapper. There are no clear examples of the new usage. We are looking into it and have some parts working. You are welcome to view some of the changes I have so far on the following branch. I'll describe some of the discovery below so you can replicate it in your client.
|
I solved the issue with the other enums used directly in the example. The branch contains a full working example. I'll need to review the rest of the wrapper for other members that need to be updated. Please let me know if you have any questions or any suggestions for the example code. |
Hi Russ,
Thank you very much!
Seems working. I will try more, and will let you know if there is any issue.
Best
Forrest
From: Russ Leikis ***@***.***>
Sent: Wednesday, February 14, 2024 4:45 PM
To: Ophir-Spiricon/BP-Automation ***@***.***>
Cc: Forrest Gan ***@***.***>; Author ***@***.***>
Subject: [External]:Re: [Ophir-Spiricon/BP-Automation] python3.9 Enum issue (Issue #6)
I solved the issue with the other enums used directly in the example. The branch contains a full working example. I'll need to review the rest of the wrapper for other members that need to be updated.
Please let me know if you have any questions or any suggestions for the example code.
—
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BF56OKQP6JEFHWOPE7FLQRTYTVK7NAVCNFSM6AAAAABDDJN7GKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBVGE4DEMJWHE>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
CAUTION: This email originated outside of Lumentum. DO NOT CLICK links or attachment unless you recognize the sender and know the content is SAFE.
|
I was trying to use python3.9 to control beamgage camera.
It seems ok to connect camera, and take snapshot. But when trying to get properties or set properties, it shows error as below:
searched, but didn't get any solution beside downgrade python to 3.7 or 3.8 version.
what causes the issue? the input is EGBDesignator for Get method, but even with enum input, the error still shows up.
TypeError: No method matches given arguments for IADataSourceEGB.Get: (<enum 'EGBDesignator'>)
is there any way to fix that?
The text was updated successfully, but these errors were encountered: