Skip to content

CHORE: Rename numbers.py into numbers_utils.py#6412

Merged
SMoraisAnsys merged 3 commits into
mainfrom
chore/rename-file-to-avoid-errors
Jul 17, 2025
Merged

CHORE: Rename numbers.py into numbers_utils.py#6412
SMoraisAnsys merged 3 commits into
mainfrom
chore/rename-file-to-avoid-errors

Conversation

@SMoraisAnsys

Copy link
Copy Markdown
Collaborator

Description

The changes consist in renaming src/ansys/core/generic/numbers.py into src/ansys/core/generic/numbers_utils.py. The reason for that is explained below.

While coding I encountered the following stack trace error:

Traceback (most recent call last):
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\generic\dummy.py", line 1, in <module>
    from ansys.aedt.core.aedt_logger import pyaedt_logger as logger
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\__init__.py", line 89, in <module>
    from ansys.aedt.core.circuit import Circuit
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\circuit.py", line 35, in <module>
    from ansys.aedt.core.application.analysis_nexxim import FieldAnalysisCircuit
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\application\analysis_nexxim.py", line 26, in <module>
    from ansys.aedt.core.application.analysis import Analysis
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\application\analysis.py", line 42, in <module>
    from ansys.aedt.core.application.design import Design
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\application\design.py", line 67, in <module>
    from ansys.aedt.core.generic.data_handlers import variation_string_to_dict
  File "C:\Users\smorais\src\pyaedt\src\ansys\aedt\core\generic\data_handlers.py", line 25, in <module>
    from decimal import Decimal
  File "C:\Users\smorais\AppData\Local\hatch\pythons\3.10\python\lib\decimal.py", line 3, in <module>
    from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

This is caused by the fact the we have a file named numbers.py in generic and it conflicts with the python numbers module. Therefore, if any module in generic folder has a need for it (direct or transitive) we would end up with such error. It can be easily reproduced by creating a dummy file in generic and calling from ansys.aedt.core.aedt_logger import pyaedt_logger as logger

Issue linked

None

Checklist

  • I have tested my changes locally.
  • I have added necessary documentation or updated existing documentation.
  • I have followed the coding style guidelines of this project.
  • I have added appropriate tests (unit, integration, system).
  • I have reviewed my changes before submitting this pull request.
  • I have linked the issue or issues that are solved by the PR if any.
  • I have agreed with the Contributor License Agreement (CLA).

@SMoraisAnsys SMoraisAnsys requested a review from a team as a code owner July 15, 2025 07:43
@ansys-reviewer-bot

Copy link
Copy Markdown
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@SMoraisAnsys SMoraisAnsys self-assigned this Jul 15, 2025
@codecov

codecov Bot commented Jul 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 88.44884% with 35 lines in your changes missing coverage. Please review.

Project coverage is 85.07%. Comparing base (b2a534d) to head (ca0a41f).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6412      +/-   ##
==========================================
- Coverage   85.41%   85.07%   -0.34%     
==========================================
  Files         175      176       +1     
  Lines       66282    66535     +253     
==========================================
- Hits        56612    56607       -5     
- Misses       9670     9928     +258     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SMoraisAnsys SMoraisAnsys merged commit c08d7af into main Jul 17, 2025
93 of 95 checks passed
@SMoraisAnsys SMoraisAnsys deleted the chore/rename-file-to-avoid-errors branch July 17, 2025 12:22
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.

3 participants