Materials#

class pyedb.grpc.database.definition.materials.Materials(edb: pyedb.grpc.edb.Edb)#

Bases: object

Manages EDB methods for material management accessible from Edb.materials property.

Overview#

add_material

Add a new material.

add_conductor_material

Add a new conductor material.

add_dielectric_material

Add a new dielectric material in library.

add_djordjevicsarkar_dielectric

Add a dielectric using the Djordjevic-Sarkar model.

add_debye_material

Add a dielectric with the Debye model.

add_multipole_debye_material

Add a dielectric with the Multipole Debye model.

duplicate

Duplicate a material from the database.

delete_material

.deprecated: pyedb 0.32.0 use delete instead.

delete

Remove a material from the database.

update_material

Update material attributes.

load_material

Load material.

load_xml

Load materials from the Stackup/Materials section of an XML control file.

material_property_to_id

Convert a material property name to a material property ID.

load_amat

Load materials from an AMAT file.

iterate_materials_in_amat

Iterate over material description in an AMAT file.

read_materials

Read materials from an AMAT file.

read_syslib_material

Read a specific material from syslib AMAT file.

update_materials_from_sys_library

Update material properties from syslib AMAT file.

syslib

Get the project sys library.

materials

Get materials.

Import detail#

from pyedb.grpc.database.definition.materials import Materials

Property detail#

property Materials.syslib#

Get the project sys library.

Returns:
str

Syslib path.

property Materials.materials: dict[str, Material]#

Get materials.

Returns:
Dict[str, Material]

Materials dictionary.

Attribute detail#

Materials.default_conductor_property_values#
Materials.default_dielectric_property_values#

Method detail#

Materials.__contains__(item)#
Materials.__getitem__(item)#
Materials.add_material(name: str, **kwargs) → Material#

Add a new material.

Parameters:
namestr

Material name.

Returns:
Material

Material object.

Materials.add_conductor_material(name, conductivity, **kwargs) → Material#

Add a new conductor material.

Parameters:
namestr

Name of the new material.

conductivitystr, float, int

Conductivity of the new material.

Returns:
Material

Material object.

Materials.add_dielectric_material(name, permittivity, dielectric_loss_tangent, **kwargs) → Material#

Add a new dielectric material in library.

Parameters:
namestr

Name of the new material.

permittivitystr, float, int

Permittivity of the new material.

dielectric_loss_tangentstr, float, int

Dielectric loss tangent of the new material.

Returns:
Material

Material object.

Materials.add_djordjevicsarkar_dielectric(name, permittivity_at_frequency, loss_tangent_at_frequency, dielectric_model_frequency, dc_conductivity=None, dc_permittivity=None, **kwargs) → Material#

Add a dielectric using the Djordjevic-Sarkar model.

Parameters:
namestr

Name of the dielectric.

permittivity_at_frequencystr, float, int

Relative permittivity of the dielectric.

loss_tangent_at_frequencystr, float, int

Loss tangent for the material.

dielectric_model_frequencystr, float, int

Test frequency in GHz for the dielectric.

dc_conductivitystr, float, int, optional

DC conductivity for the material. If provided, it will be used in the model and the property use_dc_relative_conductivity will be set to True.

dc_permittivitystr, float, int, optional

DC permittivity for the material. If provided, it will be used in the model and the property dc_relative_permittivity will be set.

Returns:
Material

Material object.

Materials.add_debye_material(name, permittivity_low, permittivity_high, loss_tangent_low, loss_tangent_high, lower_freqency, higher_frequency, **kwargs) → Material#

Add a dielectric with the Debye model.

Parameters:
namestr

Name of the dielectric.

permittivity_lowfloat, int

Relative permittivity of the dielectric at the frequency specified for lower_frequency.

permittivity_highfloat, int

Relative permittivity of the dielectric at the frequency specified for higher_frequency.

loss_tangent_lowfloat, int

Loss tangent for the material at the frequency specified for lower_frequency.

loss_tangent_highfloat, int

Loss tangent for the material at the frequency specified for higher_frequency.

lower_freqencystr, float, int

Value for the lower frequency.

higher_frequencystr, float, int

Value for the higher frequency.

Returns:
Material

Material object.

Materials.add_multipole_debye_material(name, frequencies, permittivities, loss_tangents, **kwargs) → Material#

Add a dielectric with the Multipole Debye model.

Parameters:
namestr

Name of the dielectric.

frequencieslist

Frequencies in GHz.

permittivitieslist

Relative permittivities at each frequency.

loss_tangentslist

Loss tangents at each frequency.

Returns:
Material

Material object.

Examples

>>> from pyedb import Edb
>>> edb = Edb()
>>> freq = [0, 2, 3, 4, 5, 6]
>>> rel_perm = [1e9, 1.1e9, 1.2e9, 1.3e9, 1.5e9, 1.6e9]
>>> loss_tan = [0.025, 0.026, 0.027, 0.028, 0.029, 0.030]
>>> diel = edb.materials.add_multipole_debye_material("My_MP_Debye", freq, rel_perm, loss_tan)
Materials.duplicate(material_name, new_material_name) → Material#

Duplicate a material from the database.

Parameters:
material_namestr

Name of the existing material.

new_material_namestr

Name of the new duplicated material.

Returns:
Material

Material object.

Materials.delete_material(material_name)#

.deprecated: pyedb 0.32.0 use delete instead.

Parameters:
material_namestr

Name of the material to delete.

Materials.delete(material_name) → bool#

Remove a material from the database.

Returns:
bool
Materials.update_material(material_name, input_dict)#

Update material attributes.

Materials.load_material(material: dict)#

Load material.

Materials.load_xml(xml_file: str | os.PathLike, overwrite: bool = True) → dict[str, Material]#

Load materials from the Stackup/Materials section of an XML control file.

Material properties can be constants () or equations (). Equations can depend on the frequency with the Freq variable, which is expressed in Hz. Existing materials are updated in place and the new ones are created.

Parameters:
xml_filestr or os.PathLike

Path to the XML file.

overwritebool, optional

Whether to update the properties of the materials already existing in the database. The default is True. If False, existing materials are left untouched.

Returns:
dict[str, Material]

Materials defined in the XML file, keyed by name.

Examples

>>> edb.materials.load_xml("stackup.xml")
>>> edb.materials["GL107_Nom"].equations
{'permittivity': '3.24799+0.00785013*ln((2.53303e+22+Freq*Freq)/(1.93339e+09+Freq*Freq))'}
Materials.material_property_to_id(property_name)#

Convert a material property name to a material property ID.

Parameters:
property_namestr

Name of the material property.

Returns:
Any
Materials.load_amat(amat_file) → bool#

Load materials from an AMAT file.

Parameters:
amat_filestr

Full path to the AMAT file to read and add to the Edb.

Returns:
bool
Materials.iterate_materials_in_amat(amat_file=None)#

Iterate over material description in an AMAT file.

Parameters:
amat_filestr

Full path to the AMAT file to read.

Yields:
dict
Materials.read_materials(amat_file) → dict[str, Material]#

Read materials from an AMAT file.

Parameters:
amat_filestr

Full path to the AMAT file to read.

Returns:
dict

{material name: dict of material properties}.

Materials.read_syslib_material(material_name) → dict[str, Material]#

Read a specific material from syslib AMAT file.

Parameters:
material_namestr

Name of the material.

Returns:
dict

{material name: dict of material properties}.

Materials.update_materials_from_sys_library(update_all: bool = True, material_name: str | list = None)#

Update material properties from syslib AMAT file.