ansys / pyedb

pyedb is a Python library to use the EDB client library.
https://edb.docs.pyansys.com/
MIT License
7 stars 4 forks source link

Issues related to creating HFSS-PI setup and sweep #660

Open skandak-ansys opened 2 months ago

skandak-ansys commented 2 months ago

Before submitting the issue

Description of the bug

Unable to create HFSS-PI setup and sweep successfully.

Steps To Reproduce

from pyedb import Edb
edb = Edb(edbversion="2024.2")
setup = edb.create_hfsspi_setup("test")

I have found three issues here:

  1. Unable to create discrete sweep:

    sweep = setup.add_sweep("test1d", ["log scale", "1kHz", "0.1GHz", 10], **{"freq_sweep_type": "kDiscreteSweep"})
    print(sweep.freq_sweep_type)  # returns kDiscreteSweep as expected
    edb.save_edb()
    edb.close_edb()

    Open the edb in AEDT and you can see that the sweep says "Interpolating" but should have been "Discrete"

  2. Unable to set adaptive_sampling and enforce_causality Using sweep.adaptive_sampling = True gives the below error: AttributeError: 'HFSSPISimulationSetup' object has no attribute '_edb_setup_info'

Same error for sweep.enforce_causality = True

  1. Getter and setter not available for "Fast sweep" setting.

The setting "Fast sweep" in pic below needs a getter and setter in SweepData class image

Which Operating System are you using?

Windows

Which Python version are you using?

3.9

Installed packages

annotated-types==0.7.0 ansys-pythonnet==3.1.0rc3 cffi==1.16.0 clr-loader==0.2.6 numpy==1.26.4 pandas==2.2.2 pycparser==2.22 pydantic==2.8.2 pydantic_core==2.20.1 pyedb==0.19.0 python-dateutil==2.9.0.post0 pytz==2024.1 pywin32==306 Rtree==1.3.0 six==1.16.0 toml==0.10.2 typing_extensions==4.12.2 tzdata==2024.1

gkorompi commented 2 months ago

Hello @skandak-ansys, thanks for your contribution. FYI https://tfs.ansys.com:8443/tfs/ANSYS_Development/Portfolio/_workitems/edit/1097221 @ring630

ring630 commented 2 months ago

@skandak-ansys issue #2 is fixed. #665

ring630 commented 2 months ago

@skandak-ansys issue #1 is related to a bug 1097418 in EDB API. For issue #3, I need to wait until the bug is fixed.

@svandenb-dev I will be on vacation end of today. Could you please support Skanda from here?