Skip to content

Commit

Permalink
Merge branch 'main' into release/0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcapodi78 authored and maxcapodi78 committed Apr 21, 2022
2 parents 39ca57d + 198b7ef commit 982dc97
Show file tree
Hide file tree
Showing 22 changed files with 444 additions and 133 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
insecure-external-code-execution: allow
schedule:
interval: "daily"
labels:
- "maintenance"
- "dependencies"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ dist/
/htmlcov/
/coverage.xml
/_unittest/local_config.json
test-output.xml

# Scratch Jupyter Notebooks
scratch_notebooks/
Expand All @@ -376,3 +377,4 @@ edb.def\+
model.index.bak
model.index.tmp
model.index\+

Binary file not shown.
2 changes: 2 additions & 0 deletions _unittest/example_models/chip_zoffset.aedb/stride/model.index
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$begin 'Models'
$end 'Models'
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$begin 'Models'
$end 'Models'
218 changes: 217 additions & 1 deletion _unittest/test_00_EDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def test_82c_place_on_lam_with_mold_solder(self):
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82c_place_on_bottom_of_lam_with_mold_solder(self):
def test_82d_place_on_bottom_of_lam_with_mold_solder(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(os.path.join(local_path, "example_models", "chip_solder.aedb"), edbversion=desktop_version)
try:
Expand Down Expand Up @@ -938,6 +938,166 @@ def test_82c_place_on_bottom_of_lam_with_mold_solder(self):
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82e_place_zoffset_chip(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(os.path.join(local_path, "example_models", "chip_zoffset.aedb"), edbversion=desktop_version)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=False, place_on_top=True
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(zeroValue)
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(160e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82f_place_on_bottom_zoffset_chip(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(os.path.join(local_path, "example_models", "chip_zoffset.aedb"), edbversion=desktop_version)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=True, place_on_top=False
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(chipEdb.edb_value(math.pi))
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(10e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82g_place_zoffset_solder_chip(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(
os.path.join(local_path, "example_models", "chip_zoffset_solder.aedb"), edbversion=desktop_version
)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=False, place_on_top=True
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(zeroValue)
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(150e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82h_place_on_bottom_zoffset_solder_chip(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(
os.path.join(local_path, "example_models", "chip_zoffset_solder.aedb"), edbversion=desktop_version
)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=True, place_on_top=False
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(chipEdb.edb_value(math.pi))
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(20e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()

def test_83_build_siwave_project_from_config_file(self):
cfg_file = os.path.join(os.path.dirname(self.edbapp.edbpath), "test.cfg")
with open(cfg_file, "w") as f:
Expand Down Expand Up @@ -1090,10 +1250,66 @@ def test_96_int_to_layer_types(self):
assert signal_layer == stackup.layer_types.SignalLayer
dielectric_layer = stackup._int_to_layer_types(1)
assert dielectric_layer == stackup.layer_types.DielectricLayer
conducting_layer = stackup._int_to_layer_types(2)
assert conducting_layer == stackup.layer_types.ConductingLayer
airlines_layer = stackup._int_to_layer_types(3)
assert airlines_layer == stackup.layer_types.AirlinesLayer
errors_layer = stackup._int_to_layer_types(4)
assert errors_layer == stackup.layer_types.ErrorsLayer
symbol_layer = stackup._int_to_layer_types(5)
assert symbol_layer == stackup.layer_types.SymbolLayer
measure_layer = stackup._int_to_layer_types(6)
assert measure_layer == stackup.layer_types.MeasureLayer
assembly_layer = stackup._int_to_layer_types(8)
assert assembly_layer == stackup.layer_types.AssemblyLayer
silkscreen_layer = stackup._int_to_layer_types(9)
assert silkscreen_layer == stackup.layer_types.SilkscreenLayer
solder_mask_layer = stackup._int_to_layer_types(10)
assert solder_mask_layer == stackup.layer_types.SolderMaskLayer
solder_paste_layer = stackup._int_to_layer_types(11)
assert solder_paste_layer == stackup.layer_types.SolderPasteLayer
glue_layer = stackup._int_to_layer_types(12)
assert glue_layer == stackup.layer_types.GlueLayer
wirebond_layer = stackup._int_to_layer_types(13)
assert wirebond_layer == stackup.layer_types.WirebondLayer
user_layer = stackup._int_to_layer_types(14)
assert user_layer == stackup.layer_types.UserLayer
siwave_hfss_solver_regions = stackup._int_to_layer_types(16)
assert siwave_hfss_solver_regions == stackup.layer_types.SIwaveHFSSSolverRegions
outline_layer = stackup._int_to_layer_types(18)
assert outline_layer == stackup.layer_types.OutlineLayer

def test_97_layer_types_to_int(self):
stackup = self.edbapp.core_stackup.stackup_layers
signal_layer = stackup._layer_types_to_int(stackup.layer_types.SignalLayer)
assert signal_layer == 0
dielectric_layer = stackup._layer_types_to_int(stackup.layer_types.DielectricLayer)
assert dielectric_layer == 1
conducting_layer = stackup._layer_types_to_int(stackup.layer_types.ConductingLayer)
assert conducting_layer == 2
airlines_layer = stackup._layer_types_to_int(stackup.layer_types.AirlinesLayer)
assert airlines_layer == 3
errors_layer = stackup._layer_types_to_int(stackup.layer_types.ErrorsLayer)
assert errors_layer == 4
symbol_layer = stackup._layer_types_to_int(stackup.layer_types.SymbolLayer)
assert symbol_layer == 5
measure_layer = stackup._layer_types_to_int(stackup.layer_types.MeasureLayer)
assert measure_layer == 6
assembly_layer = stackup._layer_types_to_int(stackup.layer_types.AssemblyLayer)
assert assembly_layer == 8
silkscreen_layer = stackup._layer_types_to_int(stackup.layer_types.SilkscreenLayer)
assert silkscreen_layer == 9
solder_mask_layer = stackup._layer_types_to_int(stackup.layer_types.SolderMaskLayer)
assert solder_mask_layer == 10
solder_paste_layer = stackup._layer_types_to_int(stackup.layer_types.SolderPasteLayer)
assert solder_paste_layer == 11
glue_layer = stackup._layer_types_to_int(stackup.layer_types.GlueLayer)
assert glue_layer == 12
wirebond_layer = stackup._layer_types_to_int(stackup.layer_types.WirebondLayer)
assert wirebond_layer == 13
user_layer = stackup._layer_types_to_int(stackup.layer_types.UserLayer)
assert user_layer == 14
siwave_hfss_solver_regions = stackup._layer_types_to_int(stackup.layer_types.SIwaveHFSSSolverRegions)
assert siwave_hfss_solver_regions == 16
outline_layer = stackup._layer_types_to_int(stackup.layer_types.OutlineLayer)
assert outline_layer == 18
4 changes: 4 additions & 0 deletions _unittest/test_02_3D_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def test_09_thicken_sheet(self):
assert status
status = self.aedtapp.modeler.automatic_thicken_sheets(id6, 3, False)
assert status
status = self.aedtapp.modeler.move_face([id6.faces[0].id, id6.faces[2]])
assert status
status = self.aedtapp.modeler.move_face([id6.faces[0].id, id5.faces[0]])
assert status

@pyaedt_unittest_check_desktop_error
def test_11_split(self):
Expand Down
2 changes: 1 addition & 1 deletion doc/source/API/CoreModules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ optimetrics setups.
:toctree: _autosummary
:nosignatures:

ParametericSetups
ParametricSetups
OptimizationSetups
SetupParam
SetupOpti
Expand Down
4 changes: 2 additions & 2 deletions pyaedt/edb_core/hfss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,13 +1036,13 @@ def trim_component_reference_size(self, simulation_setup=None, trim_to_terminals
)
return False

if not simulation_setup.coax_instances:
if not simulation_setup.components: # pragma: no cover
return

layout = self._cell.GetLayout()
l_inst = layout.GetLayoutInstance()

for inst in simulation_setup.coax_instances:
for inst in simulation_setup.components: # pragma: no cover
comp = self._edb.Cell.Hierarchy.Component.FindByName(layout, inst)
if comp.IsNull():
continue
Expand Down
27 changes: 19 additions & 8 deletions pyaedt/edb_core/stackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,19 +487,30 @@ def place_in_layout_3d_placement(
... offset_y="2mm", flipped_stackup=False, place_on_top=True,
... )
"""
# if flipped_stackup and place_on_top or (not flipped_stackup and not place_on_top):
_angle = angle * math.pi / 180.0

if solder_height <= 0:
if flipped_stackup and not place_on_top or (place_on_top and not flipped_stackup):
lay = list(self.signal_layers.keys())[0]
solder_height = self._get_solder_height(lay)
self._remove_solder_pec(lay)
minimum_elevation = None
for lay in self.signal_layers.values():
if minimum_elevation is None:
minimum_elevation = lay.lower_elevation
elif lay.lower_elevation > minimum_elevation:
break
lay_solder_height = self._get_solder_height(lay.name)
solder_height = max(lay_solder_height, solder_height)
self._remove_solder_pec(lay.name)
else:
lay = list(self.signal_layers.keys())[-1]

solder_height = self._get_solder_height(lay)
self._remove_solder_pec(lay)
maximum_elevation = None
layers_from_the_top = sorted(self.signal_layers.values(), key=lambda lay: -lay.upper_elevation)
for lay in layers_from_the_top:
if maximum_elevation is None:
maximum_elevation = lay.upper_elevation
elif lay.upper_elevation < maximum_elevation:
break
lay_solder_height = self._get_solder_height(lay.name)
solder_height = max(lay_solder_height, solder_height)
self._remove_solder_pec(lay.name)

rotation = self._get_edb_value(0.0)
if flipped_stackup:
Expand Down
6 changes: 3 additions & 3 deletions pyaedt/modeler/Model3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ def create_waveguide(
origin[2] -= wg_thickness
origin[1] -= wg_thickness
centers = [f.center for f in airbox.faces]
posx = [i[wg_direction_axis] for i in centers]
mini = posx.index(min(posx))
maxi = posx.index(max(posx))
xpos = [i[wg_direction_axis] for i in centers]
mini = xpos.index(min(xpos))
maxi = xpos.index(max(xpos))
if create_sheets_on_openings:
p1 = self.create_object_from_face(airbox.faces[mini].id)
p2 = self.create_object_from_face(airbox.faces[maxi].id)
Expand Down
Loading

0 comments on commit 982dc97

Please sign in to comment.