FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add pep8 alias binding option by koubaa · Pull Request #24 · ansys/ansys-pythonnet · GitHub

Repository navigation

add pep8 alias binding option - #24

Merged
koubaa merged 2 commits into
mainfrom
add-pep8-alias-binding-option
Jan 15, 2025
Merged

koubaa merged 2 commits into
mainfrom
add-pep8-alias-binding-option

Conversation

koubaa commented Jan 14, 2025

Copy link
Copy Markdown
Collaborator

What does this implement/fix? Explain your changes.

C# naming conventions are different from python naming conventions. CamelCase is the usual convention for properties and methods in C#, while snake_case is preferred in python (pep8).

When using ansys-pythonnet to bind C# to python, python users will use the C# APIs with the C# conventions. This breaks expectations for python users.

This PR adds an option to enable pep8 aliases for python bindings, allowing python code to use pep8 even if the C# code does not.

koubaa commented Jan 15, 2025

Copy link
Copy Markdown
Collaborator Author

@dipinknair @RobPasMue @SMoraisAnsys please review

RobPasMue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks fine by me - but I may not be super proficient in the internals of what this implementation may cause as side effect

Copy link
Copy Markdown
Member

Good thing is that it is an opt-in feature 😄

koubaa merged commit f763078 into main Jan 15, 2025
koubaa deleted the add-pep8-alias-binding-option branch January 15, 2025 14:23

koubaa commented Jan 15, 2025

Copy link
Copy Markdown
Collaborator Author

Good thing is that it is an opt-in feature 😄

I was planning to start by making it an opt-in feature for PyMechanical too. Maybe a kwarg in the App constructor. cc @dipinknair

Copy link
Copy Markdown
Member

Good thing is that it is an opt-in feature 😄

I was planning to start by making it an opt-in feature for PyMechanical too. Maybe a kwarg in the App constructor. cc @dipinknair

Please do - let's not roll it out by default (yet)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL