Skip to content

FEAT: Add option for pep8 aliases in binding #1234

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

dipinknair
Copy link
Collaborator

This pull request refactors the _bind_assembly_for_explicit_interface function to make it more flexible and updates its usage in the initialize function. The refactored function now supports additional options for binding assemblies, including enabling PEP 8 aliases.

Refactoring of _bind_assembly_for_explicit_interface:

  • Renamed _bind_assembly_for_explicit_interface to _bind_assembly and added two optional parameters: explicit_interface and pep8_aliases. This allows the function to handle both explicit interface implementation and PEP 8 aliasing.
  • Updated the binding logic to conditionally set AllowExplicitInterfaceImplementation and Pep8Aliases based on the new parameters.

Updates to initialize function:

  • Replaced the call to _bind_assembly_for_explicit_interface with _bind_assembly and passed True for both explicit_interface and pep8_aliases arguments to enable these features for the "Ansys.ACT.WB1" assembly.

Usage:

app = App()
app.update_globals(globals())
print(app)

# CamelCase
geometry_import = Model.GeometryImportGroup.AddGeometryImport()
# pep8 formatting
geometry_import = Model.geometry_import_group.add_geometry_import()

@dipinknair dipinknair requested a review from a team as a code owner July 11, 2025 15:46
@dipinknair dipinknair requested a review from koubaa July 11, 2025 15:47
@github-actions github-actions bot added the enhancement New features or code improvements label Jul 11, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 11, 2025
@@ -86,4 +101,4 @@ def initialize(version: int) -> None:
__register_function_codec()
Logger.debug("Registered function codec")

_bind_assembly_for_explicit_interface("Ansys.ACT.WB1")
_bind_assembly("Ansys.ACT.WB1", True, True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's make it opt-in for now, like this:

app = App(pep8=True)

until it has gone through more usage/testing.

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.49%. Comparing base (6e771e6) to head (0bf6c64).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1234      +/-   ##
==========================================
+ Coverage   86.44%   86.49%   +0.05%     
==========================================
  Files          39       39              
  Lines        2537     2540       +3     
==========================================
+ Hits         2193     2197       +4     
+ Misses        344      343       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.06% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6e771e6) 2537 2193 86.44%
Head commit (0bf6c64) 2540 (+3) 2197 (+4) 86.50% (+0.06%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1234) 6 6 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New features or code improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants