Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

koubaa
Copy link
Collaborator

@koubaa koubaa commented Jan 14, 2025

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
Copy link
Collaborator Author

koubaa commented Jan 15, 2025

@dipinknair @RobPasMue @SMoraisAnsys please review

Copy link
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

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

@RobPasMue
Copy link
Member

Good thing is that it is an opt-in feature πŸ˜„

@koubaa koubaa merged commit f763078 into main Jan 15, 2025
34 checks passed
@koubaa koubaa deleted the add-pep8-alias-binding-option branch January 15, 2025 14:23
@koubaa
Copy link
Collaborator Author

koubaa commented Jan 15, 2025

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

@RobPasMue
Copy link
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)

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