Configuration#

class pyedb.configuration.configuration.Configuration(pedb: pyedb.Edb)#

Enables export and import of a JSON configuration file that can be applied to a new or existing design.

Overview#

create_config_builder

Create and return a CfgData bound to this EDB session.

load

Import configuration settings from a configure file.

run

Apply configuration settings to the current design.

apply_setups

Apply simulation setups (HFSS, SIwave AC/DC) to the current design.

get_setups

Populate cfg_data.setups from the currently open EDB design.

apply_boundaries

Write HFSS open-region and airbox settings into the current design.

get_boundaries

Populate cfg_data.boundaries from the open EDB design.

apply_modeler

Create modeler primitives (traces, planes, padstacks, components) in the design.

apply_variables

Set variables into database.

get_variables

Retrieve variables from database.

apply_materials

Apply material settings to the current design

get_materials

Retrieve materials from the current design.

apply_stackup

Apply stackup layer definitions to the current design.

get_stackup

Populate cfg_data.stackup layers from the open EDB design.

get_padstacks

Populate cfg_data.padstacks from the open EDB design.

apply_padstacks

Apply padstack definitions and instance overrides to the current design.

apply_operations

Apply operations to the current design.

get_operations

Populate cfg_data.operations from the open EDB design.

apply_terminals

Create terminal excitations (padstack, pin-group, point, edge, bundle) in the design.

get_terminals

Populate cfg_data.terminals from the open EDB design.

get_data_from_db

Get configuration data from layout.

export

Export the configuration data from layout to a file.

Import detail#

from pyedb.configuration.configuration import Configuration

Attribute detail#

Configuration.data#
Configuration.cfg_data#

Method detail#

Configuration.create_config_builder() pyedb.configuration.cfg_data.CfgData#

Create and return a CfgData bound to this EDB session.

Because the builder is initialised with a reference to the live EDB session, you can retrieve existing objects directly via get methods instead of registering them manually:

  • cfg.components.get(refdes) — existing component (pre-loads all properties).

  • cfg.stackup.get_layer(name) — existing layer (pre-loads properties).

  • cfg.stackup.get_material(name) — existing material (pre-loads properties).

  • cfg.nets.get(net_name) — net classification from EDB.

  • cfg.padstacks.get_definition(name) — existing padstack definition.

  • cfg.padstacks.get_instance(name) — existing padstack instance.

  • cfg.pin_groups.get(name) — existing pin group (pre-loads pins).

  • cfg.setups.get(name) — a previously registered setup by name.

Returns:
CfgData

A new, session-aware configuration builder instance.

Examples

Retrieve an existing component and modify its solder-ball geometry:

>>> cfg = edb.configuration.create_config_builder()
>>> u1 = cfg.components.get("U1")  # looks up U1 from EDB
>>> u1.set_solder_ball_properties("cylinder", "150um", "100um")
>>> edb.configuration.run(cfg)

Traditional workflow (creating new component entries) still works:

>>> cfg = edb.configuration.create_config_builder()
>>> cfg.general.anti_pads_always_on = False
>>> cfg.nets.add_signal_nets(["SIG1", "CLK"])
>>> cfg.nets.add_power_ground_nets(["VDD", "GND"])
>>> edb.configuration.run(cfg)
Configuration.load(config_file, append=True, apply_file=False, output_file=None, open_at_the_end=True)#

Import configuration settings from a configure file.

Parameters:
config_filestr, dict, or CfgData

Full path to configure file in JSON or TOML format, a plain Python dictionary, or a CfgData instance. When a CfgData is supplied its to_dict() method is called automatically so the builder can be passed without any extra serialization step.

appendbool, optional

Whether if the new file will append to existing properties or the properties will be cleared before import. Default is True to keep stored properties

apply_filebool, optional

Whether to apply the file after the load or not. Default is False.

output_filestr, optional

Full path to the new aedb folder where the configured project will be saved.

open_at_the_endbool, optional

Whether to keep the new generated file opened at the end. Default is True.

Returns:
CfgData

Populated configuration data object.

Examples

Pass a CfgData directly:

>>> from pyedb.configuration.cfg_data import CfgData
>>> cfg = CfgData()
>>> cfg.general.anti_pads_always_on = False
>>> edb.configuration.load(cfg, apply_file=True)
Configuration.run(config=None, **kwargs)#

Apply configuration settings to the current design.

Parameters:
configCfgData, dict, or str, optional

When supplied the configuration is loaded before applying. Accepts the same types as load(): a CfgData instance, a plain Python dictionary, or a path to a JSON / TOML file. When None (default) the previously loaded cfg_data is used.

Examples

Pass a builder directly — no load call needed:

>>> from pyedb.configuration.cfg_data import CfgData
>>> cfg = CfgData()
>>> cfg.general.anti_pads_always_on = False
>>> cfg.nets.add_signal_nets(["SIG1", "CLK"])
>>> edb.configuration.run(cfg)

Use the existing workflow unchanged:

>>> edb.configuration.load("my_config.json")
>>> edb.configuration.run()
Configuration.apply_setups()#

Apply simulation setups (HFSS, SIwave AC/DC) to the current design.

Iterates over every setup defined in cfg_data.setups and creates the corresponding EDB setup object, including frequency sweeps and mesh operations.

Returns:
None
Configuration.get_setups()#

Populate cfg_data.setups from the currently open EDB design.

Reads every simulation setup in the database and converts it to the corresponding CfgSetup model so it can later be serialized or re-applied to another design.

Returns:
None
Configuration.apply_boundaries()#

Write HFSS open-region and airbox settings into the current design.

Reads the boundaries section of cfg_data and pushes every non-None attribute to pyedb.edb_core.hfss.HfssExtentInfo.

Returns:
None
Configuration.get_boundaries()#

Populate cfg_data.boundaries from the open EDB design.

Reads the HFSS extent information (open-region type, PML settings, airbox padding, dielectric extents) from the database and stores the values in the active CfgBoundaries model.

Returns:
None
Configuration.apply_modeler()#

Create modeler primitives (traces, planes, padstacks, components) in the design.

Processes every item in cfg_data.modeler and invokes the matching pyedb.modeler or pyedb.components factory method. After creation, primitives marked for deletion are removed from the layout.

Returns:
None
Configuration.apply_variables()#

Set variables into database.

Configuration.get_variables()#

Retrieve variables from database.

Configuration.apply_materials()#

Apply material settings to the current design

Configuration.get_materials()#

Retrieve materials from the current design.

Configuration.apply_stackup()#

Apply stackup layer definitions to the current design.

If the database already has signal layers, the existing stackup is updated in-place; otherwise a new stackup is created from scratch. Materials referenced by layers that are not yet in the database are created automatically with default properties.

Returns:
None
Raises:
Exception

If the number of signal layers in the configuration does not match the database.

Configuration.get_stackup()#

Populate cfg_data.stackup layers from the open EDB design.

Clears the existing layer list and re-populates it by reading every layer in pyedb.Edb.stackup.all_layers.

Returns:
None
Configuration.get_padstacks()#

Populate cfg_data.padstacks from the open EDB design.

Reads every padstack definition and every padstack instance from the database and stores them in the active CfgPadstacks model.

Returns:
None
Configuration.apply_padstacks()#

Apply padstack definitions and instance overrides to the current design.

Iterates over cfg_data.padstacks and updates the matching EDB padstack-definition and padstack-instance objects in the database.

Returns:
None
Configuration.apply_operations()#

Apply operations to the current design.

Configuration.get_operations()#

Populate cfg_data.operations from the open EDB design.

Detects whether a pyedb_cutout layer is present and, when found, reconstructs the cutout operation (signal nets + custom extent polygon) so it can be serialised or re-applied.

Returns:
None
Configuration.apply_terminals()#

Create terminal excitations (padstack, pin-group, point, edge, bundle) in the design.

Iterates over every terminal in cfg_data.terminals, creates the corresponding EDB excitation object, assigns impedance / boundary-type / source-amplitude settings, and resolves reference-terminal links.

Returns:
None
Configuration.get_terminals()#

Populate cfg_data.terminals from the open EDB design.

Reads every terminal excitation from the database and stores it as the appropriate Cfg*Terminal model so it can later be serialised or re-applied.

Returns:
None
Configuration.get_data_from_db(**kwargs)#

Get configuration data from layout.

Parameters:
stackupbool, optional

Whether to retrieve stackup data.

package_definitionsbool, optional

Whether to retrieve package definitions.

setupsbool, optional

Whether to retrieve setups.

sourcesbool, optional

Whether to retrieve sources.

portsbool, optional

Whether to retrieve ports.

netsbool, optional

Whether to retrieve nets.

pin_groupsbool, optional

Whether to retrieve pin groups.

operationsbool, optional

Whether to retrieve operations.

componentsbool, optional

Whether to retrieve components.

boundariesbool, optional

Whether to retrieve boundaries.

s_parametersbool, optional

Whether to retrieve s-parameters.

padstacksbool, optional

Whether to retrieve padstacks.

generalbool, optional

Whether to retrieve general information.

variablesbool, optional

Whether to retrieve variables.

terminalsbool, optional

Whether to retrieve terminals.

Returns:
dict

Dictionary with requested configuration data.

Configuration.export(file_path, stackup=True, package_definitions=False, setups=True, sources=True, ports=True, nets=True, pin_groups=True, operations=True, components=True, boundaries=True, s_parameters=True, padstacks=True, general=True, variables=True, terminals=False)#

Export the configuration data from layout to a file.

Parameters:
file_pathstr, Path

File path to export the configuration data.

stackupbool

Whether to export stackup or not.

package_definitionsbool

Whether to export package definitions or not.

setupsbool

Whether to export setups or not.

sourcesbool

Whether to export sources or not. Alternative to terminals.

portsbool

Whether to export ports or not. Alternative to terminals.

netsbool

Whether to export nets.

pin_groupsbool

Whether to export pin groups.

operationsbool

Whether to export operations.

componentsbool

Whether to export component.

boundariesbool

Whether to export boundaries.

s_parametersbool

Whether to export s_parameters.

padstacksbool

Whether to export padstacks.

generalbool

Whether to export general information.

variablesbool

Whether to export variable.

terminalsbool

Whether to export terminals. Alternative to ports and sources.

Returns
——-
bool