Skip to content

test_ansys_units_integration is failing #4555

@hpohekar

Description

@hpohekar

Logs:

def test_ansys_units_integration(mixing_elbow_settings_session):
        solver = mixing_elbow_settings_session
>       assert isinstance(solver.settings.state_with_units(), dict)

d:\Repos\pyfluent\tests\test_flobject.py:1040: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:877: in state_with_units
    self._add_units_to_state(state)
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:897: in _add_units_to_state
    child._add_units_to_state(state[k])
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:897: in _add_units_to_state
    child._add_units_to_state(state[k])
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:897: in _add_units_to_state
    child._add_units_to_state(state[k])
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:897: in _add_units_to_state
    child._add_units_to_state(state[k])
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:897: in _add_units_to_state
    child._add_units_to_state(state[k])
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:895: in _add_units_to_state
    state[k] = (state[k], child.units())
D:\Repos\pyfluent\src\ansys\fluent\core\solver\flobject.py:666: in units
    return get_si_unit_for_fluent_quantity(quantity)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

quantity = False, unit_table = None

    def get_si_unit_for_fluent_quantity(
        quantity: str | None, unit_table: dict | None = None
    ):
        """Get the SI unit for the given Fluent quantity.
    
        Raises
        ------
        InvalidQuantityType
            If ``quantity`` is not a string instance, unless it is None.
        """
        # The settings API should return None for the units-quantity
        # attribute only for dimensionless variables
        if quantity is None:
            return ""
        if isinstance(quantity, list):  # real vector
            quantity = quantity[0]
        if not isinstance(quantity, str):
>           raise InvalidQuantityType(quantity)
E           ansys.fluent.core.solver.flunits.InvalidQuantityType: The specified quantity, 'False' is not a string (<class 'bool'>).

D:\Repos\pyfluent\src\ansys\fluent\core\solver\flunits.py:304: InvalidQuantityType
Image

a1 is a real type setting however self.get_attr("units-quantity") returns False value.

Image

This is settings API side change. Earlier it was working fine.

cc: @seanpearsonuk @mkundu1 @prmukherj

Metadata

Metadata

Assignees

Labels

Settings APIRelated to the settings API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions