Skip to content

Bug located in Quantity -> __init__ #520

@prmukherj

Description

@prmukherj

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

Quantity casting of numpy int and floats are not supported. Is this expected?

📝 Steps to reproduce

ansys.units.Quantity(value=np.int64(5.0), units="kg")
Traceback (most recent call last):
File "", line 1, in
File "d:\PyFluent_Dev.venv\Lib\site-packages\ansys\units\quantity.py", line 248, in init
min_value = value if isinstance(value, (int, float)) else min(value)
^^^^^^^^^^
TypeError: 'numpy.int64' object is not iterable

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

27R1

🐍 Which Python version are you using?

3.12

📦 Installed packages

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions