SimulationSetup#

class pyedb.grpc.database.simulation_setup.simulation_setup.SimulationSetup(pedb, core: ansys.edb.core.simulation_setup.simulation_setup.SimulationSetup)#

Bases: SimulationSetupDeprecated, abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

Overview#

cast

Cast a core SimulationSetup to PyEDB SimulationSetup.

add_frequency_sweep

This method is deprecated. Please use ‘add_sweep’ with appropriate parameters instead.

add_sweep

Add a frequency sweep to the simulation setup.

clear_sweeps

Clear all frequency sweeps from the simulation setup.

id

Unique ID of the EDB object.

is_null

Check if the simulation setup is null.

name

Get or set the name of the simulation setup.

position

Get or set the position of the simulation setup.

sweep_data

Get the sweep data associated with the simulation setup.

setup_type

Get the type of the simulation setup.

settings

Get the simulation settings.

Import detail#

from pyedb.grpc.database.simulation_setup.simulation_setup import SimulationSetup

Property detail#

property SimulationSetup.id: int#

Unique ID of the EDB object.

Returns:
int

Simulation setup ID.

property SimulationSetup.is_null: bool#

Check if the simulation setup is null.

Returns:
bool

True if the simulation setup is null, False otherwise.

property SimulationSetup.name: str#

Get or set the name of the simulation setup.

Returns:
str

Simulation setup name.

property SimulationSetup.position: int#

Get or set the position of the simulation setup.

Returns:
int

Simulation setup position.

property SimulationSetup.sweep_data: list[pyedb.grpc.database.simulation_setup.sweep_data.SweepData]#

Get the sweep data associated with the simulation setup.

Returns:
list[SweepData]

List of sweep data objects.

property SimulationSetup.setup_type: str#

Get the type of the simulation setup.

Returns:
str

Simulation setup type.

abstract property SimulationSetup.settings#

Get the simulation settings.

Returns:
Settings

The simulation settings object specific to the simulation setup type.

Attribute detail#

SimulationSetup.core#

Method detail#

SimulationSetup.cast()#

Cast a core SimulationSetup to PyEDB SimulationSetup.

SimulationSetup.add_frequency_sweep(frequency_sweep: list[str])#

This method is deprecated. Please use ‘add_sweep’ with appropriate parameters instead.

SimulationSetup.add_sweep(name: str | None = None, distribution: str = 'linear', start_freq: str | float = '0GHz', stop_freq: str | float = '20GHz', step: str | float = '10MHz', discrete: bool = False, frequency_set: list[list[str]] | None = None) pyedb.grpc.database.simulation_setup.sweep_data.SweepData | None#

Add a frequency sweep to the simulation setup.

Accepts either a single-sweep shorthand (distribution / start_freq / stop_freq / step) or a multi-band frequency_set list that groups several sweep sub-ranges into one named sweep object.

Parameters:
namestr, optional

Name of the sweep. Auto-generated when omitted.

distributionstr, optional

Sweep distribution used in single-sweep mode. Supported values: "linear" (default), "linear_count", "decade_count", "log_scale", "exponential", "octave_count".

start_freqstr or float, optional

Start frequency for single-sweep mode (e.g. "0GHz" or 0). Default is "0GHz".

stop_freqstr or float, optional

Stop frequency for single-sweep mode (e.g. "20GHz" or 20e9). Default is "20GHz".

stepstr or float, optional

Frequency step or point count for single-sweep mode (e.g. "10MHz" or 10e6). Default is "10MHz".

discretebool, optional

When True the sweep type is set to discrete; otherwise interpolating. Default is False.

frequency_setlist[list[str or float]] or None, optional

Multi-band sweep definition. Each inner list has the form [distribution, start_freq, stop_freq, step] and supports all distribution aliases recognised by the distribution parameter. When provided, distribution / start_freq / stop_freq / step are ignored.

Returns:
SweepData or None

The newly added SweepData object, or None if the sweep could not be created.

Examples

Single linear sweep:

>>> setup = edbapp.simulation_setups.create_siwave_setup()
>>> sweep = setup.add_sweep(name="sweep1", start_freq="0GHz", stop_freq="10GHz", step="10MHz")

Multi-band sweep combining a DC point, a decade (log) band and a linear band — all grouped under one sweep name:

>>> setup = edbapp.simulation_setups.create_siwave_setup()
>>> setup.add_sweep(
...     name="sweep1",
...     frequency_set=[
...         ["linear_count", "0GHz", "0GHz", "1"],
...         ["decade_count", "1Hz", "10MHz", "10"],
...         ["linear", "10MHz", "10GHz", "10MHz"],
...     ],
... )
SimulationSetup.clear_sweeps()#

Clear all frequency sweeps from the simulation setup.