Skip to content

BUG: PointTerminal.point setter is crashing #431

@svandenb-dev

Description

@svandenb-dev

🔍 Before submitting the issue

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

🐞 Description of the bug

When a PointTerminal is created and we want to move the position (it is possible with .NET version) using the property setter the API crashes.

📝 Steps to reproduce

new_location = PointData([Value(0.0), Value(0.0)])
self.point = new_location

I checked the PointData is properly defined but it seems it fails to convert the Value.

......\venv\Lib\site-packages\ansys\edb\core\utility\conversions.py:46: in to_point
return point_data.PointData(val)
......\venv\Lib\site-packages\ansys\edb\core\geometry\point_data.py:39: in init
self._x = self._arc_h = conversions.to_value(data[0])


val = x {
constant {
}
}
y {
constant {
}
}

def to_value(val):
    """Take a value implicitly convertible to a ``Value``type and return as a ``Value`` type.

    Parameters
    ----------
    val : ansys.edb.core.typing.ValueLike

    Returns
    -------
    :class:`.Value`
    """
    if isinstance(val, value.Value):
        return val
    elif type(val) in [int, float, complex, str, ValueMessage]:
        return value.Value(val)
    else:
      raise TypeError(
            f"Value-like objects must be either of type Value or int/float/complex/str. - Received '{val}'"
        )

E TypeError: Value-like objects must be either of type Value or int/float/complex/str. - Received 'x {
E constant {
E }
E }
E y {
E constant {
E }
E }
E '

......\venv\Lib\site-packages\ansys\edb\core\utility\conversions.py:24: TypeError

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

No response

🐍 Which Python version are you using?

3.10

📦 Installed packages

NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions