Skip to content

Bug in create_output_variable when no context is given as argument and the expression includes a differential pair #6129

Closed
@nefelimet

Description

@nefelimet

Before submitting the issue

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

Description of the bug

When using the create_output_variable function in an Hfss3dLayout object, the variable is not created when not giving a context argument. This only happens when creating an output variable that contains a differential pair in the expression. This also happens in a Circuit object, but regardless of whether the variable expression contains a differential pair or not. See steps to reproduce for more info.

Steps To Reproduce

  1. Use an aedb project that contains circuit ports defined, e.g. P1 and P2, as well as a differential pair, e.g. Diff1 (with P1 on the positive, P2 on the negative).
  2. Create a Hfss3dLayout object out of the EDB: h3d = Hfss3dLayout(version=251, project=edb_path,remove_lock=True)
  3. Create an output variable based on the existing ports, to see that there is no error: var1 = h3d.create_output_variable(variable="var1", expression="im(Z(P1,P1))").
    Notice that no input is given for the context argument, but it will be evaluated automatically.
  4. Create an output variable based on the differential port: var2 = h3d.create_output_variable(variable="var2",expression="im(Z(Diff1,Diff1))")
  5. The following error occurs:

Image

Image

When running in debug mode, both variables have an empty context list. Both variables reach the line where CreateOutputVariable is called, both having context=[]. But one runs successfully and one returns the error mentioned.

Image

The same problem appears in Ciruit, but for any type of output variable, regardless of whether the output variable contains a differential pair or not.

Which Operating System are you using?

Windows

Which Python version are you using?

3.12

Installed packages

annotated-types==0.7.0
ansys-api-edb==1.0.10
ansys-edb-core==0.1.9
ansys-pythonnet==3.1.0rc6
attrs==25.3.0
cffi==1.17.1
clr_loader==0.2.7.post0
defusedxml==0.7.1
fonttools==4.57.0
fpdf2==2.8.3
grpcio==1.70.0
jsonschema==4.23.0
jsonschema-specifications==2025.4.1
numpy==2.2.5
pandas==2.2.3
pillow==11.2.1
plumbum==1.9.0
protobuf==4.25.7
psutil==7.0.0
pyaedt==0.16.1
pycparser==2.22
pydantic==2.10.6
pydantic_core==2.27.2
pyedb==0.44.0
python-dateutil==2.9.0.post0
pytz==2025.2
pywin32==310
PyYAML==6.0.2
referencing==0.36.2
rpds-py==0.24.0
rpyc==6.0.2
rtree==1.4.0
scikit-rf==1.6.2
scipy==1.15.2
shapely==2.1.0
six==1.17.0
toml==0.10.2
tomli_w==1.2.0
typing_extensions==4.13.2
tzdata==2025.2

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions