Skip to content

FEAT: Add option for pep8 aliases in binding - #1234

Merged
dipinknair merged 7 commits into
mainfrom
feat/pep8
Jul 16, 2025
Merged

dipinknair merged 7 commits into
mainfrom
feat/pep8

Conversation

@dipinknair

Copy link
Copy Markdown
Contributor

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
Comment thread src/ansys/mechanical/core/embedding/runtime.py Outdated
@codecov

codecov Bot commented Jul 11, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.39%. Comparing base (09c9425) to head (be8fdb6).
Report is 1 commits behind head on main.

❌ Your patch status has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1234      +/-   ##
==========================================
- Coverage   86.40%   86.39%   -0.01%     
==========================================
  Files          39       39              
  Lines        2537     2544       +7     
==========================================
+ Hits         2192     2198       +6     
- Misses        345      346       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codacy-production

codacy-production Bot commented Jul 11, 2025

Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 80.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (09c9425) 2537 2192 86.40%
Head commit (be8fdb6) 2544 (+7) 2198 (+6) 86.40% (+0.00%)

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) 15 12 80.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

@dipinknair
dipinknair requested a review from koubaa July 14, 2025 18:34

@koubaa koubaa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the opt-out section looks wrong to me

Comment thread src/ansys/mechanical/core/embedding/app.py Outdated
Comment thread src/ansys/mechanical/core/embedding/runtime.py Outdated
@dipinknair
dipinknair requested a review from koubaa July 16, 2025 14:45
Comment thread src/ansys/mechanical/core/embedding/runtime.py Outdated
@dipinknair
dipinknair requested review from koubaa July 16, 2025 16:04
@dipinknair
dipinknair merged commit 28d89ac into main Jul 16, 2025
@dipinknair
dipinknair deleted the feat/pep8 branch July 16, 2025 16:25
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