From 2cabcff0741aab7b4bd2f2aa20cfdb48cd1c7d78 Mon Sep 17 00:00:00 2001 From: chenchienjacklin <104948990+chenchienjacklin@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:34:04 -0700 Subject: [PATCH] FEATURE: Restructure imports to remove circular imports (#400) --- doc/source/api/definition.rst | 73 ++-- doc/source/api/geometry.rst | 16 +- doc/source/api/glossary.rst | 8 +- doc/source/api/hierarchy.rst | 28 +- doc/source/api/layer.rst | 26 +- doc/source/api/layout.rst | 14 +- doc/source/api/layout_instance.rst | 10 +- doc/source/api/net.rst | 8 +- doc/source/api/primitive.rst | 2 +- doc/source/api/simulation_setup.rst | 96 ++--- doc/source/api/terminal.rst | 2 +- doc/source/api/utility.rst | 20 +- notebooks/assign_ds_model.ipynb | 15 +- notebooks/helpers/example_setup.ipynb | 262 +++++++++++++- notebooks/stackup_export.ipynb | 18 +- src/ansys/edb/core/database.py | 48 ++- src/ansys/edb/core/definition/__init__.py | 45 --- src/ansys/edb/core/definition/bondwire_def.py | 40 +-- .../edb/core/definition/component_def.py | 17 +- .../edb/core/definition/component_model.py | 4 +- .../edb/core/definition/component_pin.py | 7 +- .../edb/core/definition/component_property.py | 16 +- src/ansys/edb/core/definition/dataset_def.py | 10 +- src/ansys/edb/core/definition/debye_model.py | 4 +- src/ansys/edb/core/definition/die_property.py | 4 +- src/ansys/edb/core/definition/material_def.py | 32 +- .../material_property_thermal_modifier.py | 21 +- src/ansys/edb/core/definition/package_def.py | 27 +- src/ansys/edb/core/definition/padstack_def.py | 12 +- .../edb/core/definition/padstack_def_data.py | 83 +++-- .../edb/core/definition/port_property.py | 6 +- .../core/definition/solder_ball_property.py | 2 +- src/ansys/edb/core/geometry/__init__.py | 7 - src/ansys/edb/core/geometry/arc_data.py | 27 +- src/ansys/edb/core/geometry/point3d_data.py | 6 +- src/ansys/edb/core/geometry/point_data.py | 18 +- src/ansys/edb/core/geometry/polygon_data.py | 24 +- src/ansys/edb/core/geometry/r_tree.py | 36 +- src/ansys/edb/core/hierarchy/__init__.py | 13 - src/ansys/edb/core/hierarchy/cell_instance.py | 27 +- .../edb/core/hierarchy/component_group.py | 8 +- src/ansys/edb/core/hierarchy/group.py | 8 +- src/ansys/edb/core/hierarchy/hierarchy_obj.py | 24 +- src/ansys/edb/core/hierarchy/inst_array.py | 28 +- src/ansys/edb/core/hierarchy/pin_group.py | 16 +- .../edb/core/hierarchy/pin_pair_model.py | 4 +- src/ansys/edb/core/hierarchy/structure3d.py | 6 +- src/ansys/edb/core/hierarchy/via_group.py | 18 +- src/ansys/edb/core/inner/conn_obj.py | 28 +- src/ansys/edb/core/inner/factory.py | 14 +- src/ansys/edb/core/inner/layout_obj.py | 11 +- src/ansys/edb/core/inner/messages.py | 12 +- src/ansys/edb/core/inner/parser.py | 79 +++-- src/ansys/edb/core/inner/variable_server.py | 44 +-- src/ansys/edb/core/layer/__init__.py | 16 - src/ansys/edb/core/layer/layer.py | 9 +- src/ansys/edb/core/layer/layer_collection.py | 10 +- src/ansys/edb/core/layer/stackup_layer.py | 12 +- src/ansys/edb/core/layer/via_layer.py | 2 +- src/ansys/edb/core/layout/__init__.py | 5 - src/ansys/edb/core/layout/cell.py | 44 +-- src/ansys/edb/core/layout/layout.py | 71 ++-- src/ansys/edb/core/layout/mcad_model.py | 22 +- .../edb/core/layout/voltage_regulator.py | 24 +- .../edb/core/layout_instance/__init__.py | 11 - .../core/layout_instance/layout_instance.py | 38 +- .../layout_instance_context.py | 6 +- .../layout_instance/layout_obj_instance.py | 25 +- .../layout_obj_instance_2d_geometry.py | 2 +- .../layout_obj_instance_3d_geometry.py | 4 +- src/ansys/edb/core/net/__init__.py | 5 - src/ansys/edb/core/net/differential_pair.py | 17 +- src/ansys/edb/core/net/extended_net.py | 6 +- src/ansys/edb/core/net/net.py | 24 +- src/ansys/edb/core/net/net_class.py | 8 +- src/ansys/edb/core/primitive/__init__.py | 19 - src/ansys/edb/core/primitive/primitive.py | 331 +++++++++--------- .../edb/core/simulation_setup/__init__.py | 65 ---- .../simulation_setup/adaptive_solutions.py | 10 +- .../hfss_simulation_settings.py | 22 +- .../simulation_setup/hfss_simulation_setup.py | 6 +- .../raptor_x_simulation_settings.py | 4 +- .../raptor_x_simulation_setup.py | 4 +- .../simulation_setup/simulation_settings.py | 2 +- .../core/simulation_setup/simulation_setup.py | 14 +- .../siwave_dcir_simulation_setup.py | 4 +- .../siwave_simulation_settings.py | 10 +- .../siwave_simulation_setup.py | 4 +- src/ansys/edb/core/terminal/__init__.py | 19 - src/ansys/edb/core/terminal/terminals.py | 24 +- src/ansys/edb/core/typing/__init__.py | 4 +- src/ansys/edb/core/utility/__init__.py | 13 - src/ansys/edb/core/utility/conversions.py | 25 +- .../edb/core/utility/hfss_extent_info.py | 12 +- src/ansys/edb/core/utility/transform.py | 16 +- src/ansys/edb/core/utility/transform3d.py | 2 +- src/ansys/edb/core/utility/value.py | 11 +- tests/e2e/conftest.py | 8 +- tests/e2e/integration_tests/test_padstack.py | 5 +- .../integration_tests/test_spiral_inductor.py | 35 +- tests/e2e/scratch/sim_setup_scratch.py | 22 +- tests/e2e/scratch/test_board_bend_def.py | 8 +- tests/e2e/scratch/test_component_property.py | 28 +- tests/e2e/scratch/test_power_module.py | 3 +- tests/e2e/scratch/test_value.py | 11 +- tests/mock/test_arc_data.py | 53 +-- tests/mock/test_database.py | 2 +- tests/mock/test_terminals.py | 7 +- tests/mock/utils/fixtures.py | 6 +- 109 files changed, 1350 insertions(+), 1254 deletions(-) diff --git a/doc/source/api/definition.rst b/doc/source/api/definition.rst index 6f2d8da574..15c283de73 100644 --- a/doc/source/api/definition.rst +++ b/doc/source/api/definition.rst @@ -4,34 +4,38 @@ Definition Classes ------- -.. currentmodule:: ansys.edb.core.definition +.. currentmodule:: ansys.edb.core .. autosummary:: :toctree: _autosummary - ApdBondwireDef - BondwireDef - ComponentDef - ComponentModel - ComponentPin - DielectricMaterialModel - DynamicLinkComponentModel - DatasetDef - Jedec4BondwireDef - Jedec5BondwireDef - MaterialDef - NPortComponentModel - PackageDef - PadstackDef - PadstackDefData - ThermalModifier - SolderBallProperty - ComponentProperty - ICComponentProperty - IOComponentProperty - RLCComponentProperty - DieProperty - PortProperty + definition.bondwire_def.ApdBondwireDef + definition.bondwire_def.BondwireDef + definition.component_def.ComponentDef + definition.component_model.ComponentModel + definition.component_pin.ComponentPin + definition.dataset_def.DatasetDef + definition.debye_model.DebyeModel + definition.die_property.DieProperty + definition.dielectric_material_model.DielectricMaterialModel + definition.djordjecvic_sarkar_model.DjordjecvicSarkarModel + definition.component_model.DynamicLinkComponentModel + definition.bondwire_def.Jedec4BondwireDef + definition.bondwire_def.Jedec5BondwireDef + definition.material_def.MaterialDef + definition.material_property_thermal_modifier.MaterialPropertyThermalModifier + definition.multipole_debye_model.MultipoleDebyeModel + definition.component_model.NPortComponentModel + definition.package_def.PackageDef + definition.padstack_def.PadstackDef + definition.padstack_def_data.PadstackDefData + definition.material_def.ThermalModifier + definition.solder_ball_property.SolderBallProperty + definition.component_property.ComponentProperty + definition.ic_component_property.ICComponentProperty + definition.io_component_property.IOComponentProperty + definition.rlc_component_property.RLCComponentProperty + definition.port_property.PortProperty Enums @@ -40,13 +44,14 @@ Enums .. autosummary:: :toctree: _autosummary - DefinitionObjType - BondwireDefType - MaterialProperty - PadType - PadGeometryType - PadstackHoleRange - SolderballShape - SolderballPlacement - DieType - DieOrientation + edb_defs.DefinitionObjType + definition.bondwire_def.BondwireDefType + definition.material_def.MaterialProperty + definition.padstack_def_data.PadType + definition.padstack_def_data.PadGeometryType + definition.padstack_def_data.PadstackHoleRange + definition.padstack_def_data.SolderballShape + definition.padstack_def_data.SolderballPlacement + definition.die_property.DieType + definition.die_property.DieOrientation + definition.dielectric_material_model.DielectricMaterialModelType diff --git a/doc/source/api/geometry.rst b/doc/source/api/geometry.rst index d5b0e621f4..5b2c16fa12 100644 --- a/doc/source/api/geometry.rst +++ b/doc/source/api/geometry.rst @@ -9,12 +9,12 @@ Classes .. autosummary:: :toctree: _autosummary - ArcData - RTree - PolygonData - PointData - Point3DData - Triangle3DData + arc_data.ArcData + r_tree.RTree + polygon_data.PolygonData + point_data.PointData + point3d_data.Point3DData + triangle3d_data.Triangle3DData Enums ----- @@ -22,5 +22,5 @@ Enums .. autosummary:: :toctree: _autosummary - ExtentType - PolygonSenseType + polygon_data.ExtentType + polygon_data.PolygonSenseType diff --git a/doc/source/api/glossary.rst b/doc/source/api/glossary.rst index 10b8c532f9..93d80a1804 100644 --- a/doc/source/api/glossary.rst +++ b/doc/source/api/glossary.rst @@ -32,20 +32,20 @@ Glossary - :obj:`float` - :obj:`complex` - :obj:`str` for expressions ('1nm', 'x + 1' etc) - - :class:`Value ` + - :class:`Value ` Point2DLike Any of the following data types that represents (x, y) point on a 2D coordinate system. - - :class:`PointData ` + - :class:`PointData ` - (:term:`ValueLike`, :term:`ValueLike`) or any other iterable with 2 :term:`ValueLike` inside Point3DLike Any of the following data types that represents (x, y, z) point on a 3D coordinate system. - - :class:`Point3DData ` + - :class:`Point3DData ` - (:term:`ValueLike`, :term:`ValueLike`, :term:`ValueLike`) or any other iterable with 3 :term:`ValueLike` inside Triangle3DLike @@ -63,7 +63,7 @@ Glossary HFSS solver properties are represented by a tuple of the form [dc_thickness_type, dc_thickness_value, solve_inside_enabled] - (:class:`DCThicknessType `, :term:`ValueLike`, :obj:`bool`) + (:class:`DCThicknessType `, :term:`ValueLike`, :obj:`bool`) HFSSExtents diff --git a/doc/source/api/hierarchy.rst b/doc/source/api/hierarchy.rst index 5eb87e317a..5d361a9035 100644 --- a/doc/source/api/hierarchy.rst +++ b/doc/source/api/hierarchy.rst @@ -13,18 +13,18 @@ Object types .. autosummary:: :toctree: _autosummary - CellInstance - InstArray - ComponentGroup - Group - PinGroup - Model - PinPairModel - NetlistModel - SParameterModel - SPICEModel - Structure3D - ViaGroup + cell_instance.CellInstance + inst_array.InstArray + component_group.ComponentGroup + group.Group + pin_group.PinGroup + model.Model + pin_pair_model.PinPairModel + netlist_model.NetlistModel + sparameter_model.SParameterModel + spice_model.SPICEModel + structure3d.Structure3D + via_group.ViaGroup Enums @@ -33,5 +33,5 @@ Enums .. autosummary:: :toctree: _autosummary - ComponentType - MeshClosure \ No newline at end of file + component_group.ComponentType + structure3d.MeshClosure \ No newline at end of file diff --git a/doc/source/api/layer.rst b/doc/source/api/layer.rst index 73bffc820a..1a0394ad30 100644 --- a/doc/source/api/layer.rst +++ b/doc/source/api/layer.rst @@ -9,10 +9,10 @@ Classes .. autosummary:: :toctree: _autosummary - Layer - StackupLayer - ViaLayer - LayerCollection + layer.Layer + stackup_layer.StackupLayer + via_layer.ViaLayer + layer_collection.LayerCollection Enums ----- @@ -20,12 +20,12 @@ Enums .. autosummary:: :toctree: _autosummary - LayerType - TopBottomAssociation - DrawOverride - LayerVisibility - DCThicknessType - RoughnessRegion - LayerCollectionMode - LayerTypeSet - DielectricMergingMethod \ No newline at end of file + layer_collection.LayerType + layer.TopBottomAssociation + layer.DrawOverride + layer.LayerVisibility + stackup_layer.DCThicknessType + stackup_layer.RoughnessRegion + layer_collection.LayerCollectionMode + layer_collection.LayerTypeSet + layer_collection.DielectricMergingMethod \ No newline at end of file diff --git a/doc/source/api/layout.rst b/doc/source/api/layout.rst index d5a70885bb..048c4fd2ee 100644 --- a/doc/source/api/layout.rst +++ b/doc/source/api/layout.rst @@ -9,11 +9,11 @@ Classes .. autosummary:: :toctree: _autosummary - Cell - Layout - McadModel - PowerModule - VoltageRegulator + cell.Cell + layout.Layout + mcad_model.McadModel + voltage_regulator.PowerModule + voltage_regulator.VoltageRegulator Enums ----- @@ -21,5 +21,5 @@ Enums .. autosummary:: :toctree: _autosummary - CellType - DesignMode \ No newline at end of file + cell.CellType + cell.DesignMode \ No newline at end of file diff --git a/doc/source/api/layout_instance.rst b/doc/source/api/layout_instance.rst index 6ac62de17e..2625fea99f 100644 --- a/doc/source/api/layout_instance.rst +++ b/doc/source/api/layout_instance.rst @@ -9,8 +9,8 @@ Classes .. autosummary:: :toctree: _autosummary - LayoutInstance - LayoutInstanceContext - LayoutObjInstance - LayoutObjInstance2DGeometry - LayoutObjInstance3DGeometry + layout_instance.LayoutInstance + layout_instance_context.LayoutInstanceContext + layout_obj_instance.LayoutObjInstance + layout_obj_instance.LayoutObjInstance2DGeometry + layout_obj_instance.LayoutObjInstance3DGeometry diff --git a/doc/source/api/net.rst b/doc/source/api/net.rst index 50dec12086..d3bd1424fe 100644 --- a/doc/source/api/net.rst +++ b/doc/source/api/net.rst @@ -9,7 +9,7 @@ Classes .. autosummary:: :toctree: _autosummary - DifferentialPair - ExtendedNet - Net - NetClass + differential_pair.DifferentialPair + extended_net.ExtendedNet + net.Net + net_class.NetClass diff --git a/doc/source/api/primitive.rst b/doc/source/api/primitive.rst index c2f35fbbe8..7f2a41e911 100644 --- a/doc/source/api/primitive.rst +++ b/doc/source/api/primitive.rst @@ -4,7 +4,7 @@ Primitives Classes ------- -.. currentmodule:: ansys.edb.core.primitive +.. currentmodule:: ansys.edb.core.primitive.primitive .. autosummary:: :toctree: _autosummary diff --git a/doc/source/api/simulation_setup.rst b/doc/source/api/simulation_setup.rst index ed90731858..84628d54c6 100644 --- a/doc/source/api/simulation_setup.rst +++ b/doc/source/api/simulation_setup.rst @@ -9,46 +9,46 @@ Classes .. autosummary:: :toctree: _autosummary - HFSSSimulationSettings - HfssSimulationSetup - HFSSGeneralSettings - HFSSSettingsOptions - HFSSSolverSettings - HFSSAdvancedSettings - HFSSAdvancedMeshingSettings - HFSSDCRSettings - AdaptiveFrequency - BroadbandAdaptiveSolution - MatrixConvergenceData - MatrixConvergenceDataEntry - MultiFrequencyAdaptiveSolution - SingleFrequencyAdaptiveSolution - LengthMeshOperation - MeshOperation - SkinDepthMeshOperation - AdvancedMeshingSettings - AdvancedSettings - SettingsOptions - SimulationSettings - SolverSettings - SimulationSetup - SweepData - FreqSweepType - HFSSRegionComputeResource - InterpolatingSweepData - RaptorXSimulationSettings - RaptorXGeneralSettings - RaptorXAdvancedSettings - RaptorXSimulationSetup - SIWaveDCIRSimulationSettings - SIWaveDCIRSimulationSetup - SIWaveSimulationSettings - SIWaveGeneralSettings - SIWaveAdvancedSettings - SIWaveDCSettings - SIWaveDCAdvancedSettings - SIWaveSParameterSettings - SIWaveSimulationSetup + hfss_simulation_settings.HFSSSimulationSettings + hfss_simulation_setup.HfssSimulationSetup + hfss_simulation_settings.HFSSGeneralSettings + hfss_simulation_settings.HFSSSettingsOptions + hfss_simulation_settings.HFSSSolverSettings + hfss_simulation_settings.HFSSAdvancedSettings + hfss_simulation_settings.HFSSAdvancedMeshingSettings + hfss_simulation_settings.HFSSDCRSettings + adaptive_solutions.AdaptiveFrequency + adaptive_solutions.BroadbandAdaptiveSolution + adaptive_solutions.MatrixConvergenceData + adaptive_solutions.MatrixConvergenceDataEntry + adaptive_solutions.MultiFrequencyAdaptiveSolution + adaptive_solutions.SingleFrequencyAdaptiveSolution + mesh_operation.LengthMeshOperation + mesh_operation.MeshOperation + mesh_operation.SkinDepthMeshOperation + simulation_settings.AdvancedMeshingSettings + simulation_settings.AdvancedSettings + simulation_settings.SettingsOptions + simulation_settings.SimulationSettings + simulation_settings.SolverSettings + simulation_setup.SimulationSetup + simulation_setup.SweepData + simulation_setup.FreqSweepType + simulation_setup.HFSSRegionComputeResource + simulation_setup.InterpolatingSweepData + raptor_x_simulation_settings.RaptorXSimulationSettings + raptor_x_simulation_settings.RaptorXGeneralSettings + raptor_x_simulation_settings.RaptorXAdvancedSettings + raptor_x_simulation_setup.RaptorXSimulationSetup + siwave_dcir_simulation_settings.SIWaveDCIRSimulationSettings + siwave_dcir_simulation_setup.SIWaveDCIRSimulationSetup + siwave_simulation_settings.SIWaveSimulationSettings + siwave_simulation_settings.SIWaveGeneralSettings + siwave_simulation_settings.SIWaveAdvancedSettings + siwave_simulation_settings.SIWaveDCSettings + siwave_simulation_settings.SIWaveDCAdvancedSettings + siwave_simulation_settings.SIWaveSParameterSettings + siwave_simulation_setup.SIWaveSimulationSetup Enums ----- @@ -56,11 +56,11 @@ Enums .. autosummary:: :toctree: _autosummary - SimulationSetupType - AdaptType - BasisFunctionOrder - SolverType - ViaStyle - SParamInterpolation - SParamExtrapolation - SParamDCBehavior + simulation_setup.SimulationSetupType + hfss_simulation_settings.AdaptType + hfss_simulation_settings.BasisFunctionOrder + hfss_simulation_settings.SolverType + simulation_settings.ViaStyle + siwave_simulation_settings.SParamInterpolation + siwave_simulation_settings.SParamExtrapolation + siwave_simulation_settings.SParamDCBehavior diff --git a/doc/source/api/terminal.rst b/doc/source/api/terminal.rst index bde52b7948..6e2b58ab9d 100644 --- a/doc/source/api/terminal.rst +++ b/doc/source/api/terminal.rst @@ -4,7 +4,7 @@ Terminals Classes ------- -.. currentmodule:: ansys.edb.core.terminal +.. currentmodule:: ansys.edb.core.terminal.terminals .. autosummary:: :toctree: _autosummary diff --git a/doc/source/api/utility.rst b/doc/source/api/utility.rst index 0fda0d5b47..2952dd6012 100644 --- a/doc/source/api/utility.rst +++ b/doc/source/api/utility.rst @@ -9,12 +9,14 @@ Classes .. autosummary:: :toctree: _autosummary - HfssExtentInfo - AdvancedQuadraticParams - BasicQuadraticParams - PortPostProcessingProp - Rlc - TemperatureSettings - Transform - Transform3D - Value + heat_sink.HeatSink + hfss_extent_info.HfssExtentInfo + layer_map.LayerMap + material_property_thermal_modifier_params.AdvancedQuadraticParams + material_property_thermal_modifier_params.BasicQuadraticParams + port_post_processing_prop.PortPostProcessingProp + rlc.Rlc + temperature_settings.TemperatureSettings + transform.Transform + transform3d.Transform3D + value.Value diff --git a/notebooks/assign_ds_model.ipynb b/notebooks/assign_ds_model.ipynb index be0670d6fc..cbaf46dd7d 100644 --- a/notebooks/assign_ds_model.ipynb +++ b/notebooks/assign_ds_model.ipynb @@ -102,7 +102,7 @@ " material = i.get_material()\n", " \n", " if 'DIELECTRIC_LAYER' in str(layer_type):\n", - " matmodel = material_def.MaterialDef.find_by_name(db,material)\n", + " matmodel = MaterialDef.find_by_name(db,material)\n", " matmodel.dielectric_material_model= DjordjecvicSarkarModel.create()\n", " print(f\"Assigned DS model to Layer '{name}'\")" ] @@ -124,10 +124,17 @@ "source": [ "%run helpers/example_teardown.ipynb" ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "cd20b8a1-1089-44fe-ac38-38df183eb981", + "metadata": {}, + "outputs": [], + "source": [] } ], - "metadata": { - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file diff --git a/notebooks/helpers/example_setup.ipynb b/notebooks/helpers/example_setup.ipynb index eca686e980..95a8d36ca6 100644 --- a/notebooks/helpers/example_setup.ipynb +++ b/notebooks/helpers/example_setup.ipynb @@ -10,18 +10,248 @@ "import os, sys, pathlib, ipynbname, glob, shutil\n", "import ansys.edb\n", "\n", - "from ansys.edb.core.database import *\n", - "from ansys.edb.core.definition import *\n", - "from ansys.edb.core.geometry import *\n", - "from ansys.edb.core.hierarchy import *\n", - "from ansys.edb.core.layer import *\n", - "from ansys.edb.core.layout import *\n", - "from ansys.edb.core.layout_instance import *\n", - "from ansys.edb.core.net import *\n", - "from ansys.edb.core.primitive import *\n", - "from ansys.edb.core.simulation_setup import *\n", - "from ansys.edb.core.terminal import *\n", - "from ansys.edb.core.utility import *\n", + "from ansys.edb.core.database import Database\n", + "\n", + "\"\"\"Import definition classes.\"\"\"\n", + "\n", + "from ansys.edb.core.definition.bondwire_def import (\n", + " ApdBondwireDef,\n", + " BondwireDef,\n", + " BondwireDefType,\n", + " Jedec4BondwireDef,\n", + " Jedec5BondwireDef,\n", + ")\n", + "from ansys.edb.core.definition.component_def import ComponentDef\n", + "from ansys.edb.core.definition.component_model import (\n", + " ComponentModel,\n", + " DynamicLinkComponentModel,\n", + " NPortComponentModel,\n", + ")\n", + "from ansys.edb.core.definition.component_pin import ComponentPin\n", + "from ansys.edb.core.definition.component_property import ComponentProperty\n", + "from ansys.edb.core.definition.dataset_def import DatasetDef\n", + "from ansys.edb.core.definition.debye_model import DebyeModel\n", + "from ansys.edb.core.definition.die_property import DieOrientation, DieProperty, DieType\n", + "from ansys.edb.core.definition.dielectric_material_model import (\n", + " DielectricMaterialModel,\n", + " DielectricMaterialModelType,\n", + ")\n", + "from ansys.edb.core.definition.djordjecvic_sarkar_model import DjordjecvicSarkarModel\n", + "from ansys.edb.core.definition.ic_component_property import ICComponentProperty\n", + "from ansys.edb.core.definition.io_component_property import IOComponentProperty\n", + "from ansys.edb.core.definition.material_def import MaterialDef, MaterialProperty, ThermalModifier\n", + "from ansys.edb.core.definition.material_property_thermal_modifier import (\n", + " MaterialPropertyThermalModifier,\n", + ")\n", + "from ansys.edb.core.definition.multipole_debye_model import MultipoleDebyeModel\n", + "from ansys.edb.core.definition.package_def import PackageDef\n", + "from ansys.edb.core.definition.padstack_def import PadstackDef\n", + "from ansys.edb.core.definition.padstack_def_data import (\n", + " PadGeometryType,\n", + " PadstackDefData,\n", + " PadstackHoleRange,\n", + " PadType,\n", + " SolderballPlacement,\n", + " SolderballShape,\n", + ")\n", + "from ansys.edb.core.definition.port_property import PortProperty\n", + "from ansys.edb.core.definition.rlc_component_property import RLCComponentProperty\n", + "from ansys.edb.core.definition.solder_ball_property import SolderBallProperty\n", + "from ansys.edb.core.edb_defs import DefinitionObjType\n", + "\n", + "\"\"\"Import geometry classes.\"\"\"\n", + "\n", + "from ansys.edb.core.geometry.arc_data import ArcData\n", + "from ansys.edb.core.geometry.point3d_data import Point3DData\n", + "from ansys.edb.core.geometry.point_data import PointData\n", + "from ansys.edb.core.geometry.polygon_data import ExtentType, PolygonData, PolygonSenseType\n", + "from ansys.edb.core.geometry.r_tree import RTree\n", + "from ansys.edb.core.geometry.triangle3d_data import Triangle3DData\n", + "\n", + "\"\"\"Import hierarchy classes.\"\"\"\n", + "\n", + "from ansys.edb.core.hierarchy.cell_instance import CellInstance\n", + "from ansys.edb.core.hierarchy.component_group import ComponentGroup, ComponentType\n", + "from ansys.edb.core.hierarchy.group import Group\n", + "from ansys.edb.core.hierarchy.inst_array import InstArray\n", + "from ansys.edb.core.hierarchy.model import Model\n", + "from ansys.edb.core.hierarchy.netlist_model import NetlistModel\n", + "from ansys.edb.core.hierarchy.pin_group import PinGroup\n", + "from ansys.edb.core.hierarchy.pin_pair_model import PinPairModel\n", + "from ansys.edb.core.hierarchy.sparameter_model import SParameterModel\n", + "from ansys.edb.core.hierarchy.spice_model import SPICEModel\n", + "from ansys.edb.core.hierarchy.structure3d import MeshClosure, Structure3D\n", + "from ansys.edb.core.hierarchy.via_group import ViaGroup\n", + "\n", + "\"\"\"Import layer classes.\"\"\"\n", + "\n", + "from ansys.edb.core.layer.layer import (\n", + " DrawOverride,\n", + " Layer,\n", + " LayerType,\n", + " LayerVisibility,\n", + " TopBottomAssociation,\n", + ")\n", + "from ansys.edb.core.layer.layer_collection import (\n", + " DielectricMergingMethod,\n", + " LayerCollection,\n", + " LayerCollectionMode,\n", + " LayerTypeSet,\n", + ")\n", + "from ansys.edb.core.layer.stackup_layer import DCThicknessType, RoughnessRegion, StackupLayer\n", + "from ansys.edb.core.layer.via_layer import ViaLayer\n", + "\n", + "\"\"\"Import layout classes.\"\"\"\n", + "\n", + "from ansys.edb.core.layout.cell import Cell, CellType, DesignMode\n", + "from ansys.edb.core.layout.layout import Layout\n", + "from ansys.edb.core.layout.mcad_model import McadModel\n", + "from ansys.edb.core.layout.voltage_regulator import PowerModule, VoltageRegulator\n", + "\n", + "\"\"\"Import layout instance classes.\"\"\"\n", + "\n", + "from ansys.edb.core.layout_instance.layout_instance import LayoutInstance\n", + "from ansys.edb.core.layout_instance.layout_instance_context import LayoutInstanceContext\n", + "from ansys.edb.core.layout_instance.layout_obj_instance import LayoutObjInstance\n", + "from ansys.edb.core.layout_instance.layout_obj_instance_2d_geometry import (\n", + " LayoutObjInstance2DGeometry,\n", + ")\n", + "from ansys.edb.core.layout_instance.layout_obj_instance_3d_geometry import (\n", + " LayoutObjInstance3DGeometry,\n", + ")\n", + "from ansys.edb.core.layout_instance.layout_obj_instance_geometry import LayoutObjInstanceGeometry\n", + "\n", + "\"\"\"Import net classes.\"\"\"\n", + "\n", + "from ansys.edb.core.net.differential_pair import DifferentialPair\n", + "from ansys.edb.core.net.extended_net import ExtendedNet\n", + "from ansys.edb.core.net.net import Net\n", + "from ansys.edb.core.net.net_class import NetClass\n", + "\n", + "\"\"\"Import primitive classes.\"\"\"\n", + "\n", + "from ansys.edb.core.primitive.primitive import (\n", + " BackDrillType,\n", + " BoardBendDef,\n", + " Bondwire,\n", + " BondwireCrossSectionType,\n", + " BondwireType,\n", + " Circle,\n", + " PadstackInstance,\n", + " Path,\n", + " PathCornerType,\n", + " PathEndCapType,\n", + " Polygon,\n", + " Primitive,\n", + " PrimitiveType,\n", + " Rectangle,\n", + " RectangleRepresentationType,\n", + " Text,\n", + ")\n", + "\n", + "\"\"\"Import simulation setup classes.\"\"\"\n", + "\n", + "from ansys.edb.core.simulation_setup.adaptive_solutions import (\n", + " AdaptiveFrequency,\n", + " BroadbandAdaptiveSolution,\n", + " MatrixConvergenceData,\n", + " MatrixConvergenceDataEntry,\n", + " MultiFrequencyAdaptiveSolution,\n", + " SingleFrequencyAdaptiveSolution,\n", + ")\n", + "from ansys.edb.core.simulation_setup.hfss_simulation_settings import (\n", + " AdaptType,\n", + " BasisFunctionOrder,\n", + " HFSSAdvancedMeshingSettings,\n", + " HFSSAdvancedSettings,\n", + " HFSSDCRSettings,\n", + " HFSSGeneralSettings,\n", + " HFSSSettingsOptions,\n", + " HFSSSimulationSettings,\n", + " HFSSSolverSettings,\n", + " SolverType,\n", + ")\n", + "from ansys.edb.core.simulation_setup.hfss_simulation_setup import HfssSimulationSetup\n", + "from ansys.edb.core.simulation_setup.mesh_operation import (\n", + " LengthMeshOperation,\n", + " MeshOperation,\n", + " SkinDepthMeshOperation,\n", + ")\n", + "from ansys.edb.core.simulation_setup.raptor_x_simulation_settings import (\n", + " RaptorXAdvancedSettings,\n", + " RaptorXGeneralSettings,\n", + " RaptorXSimulationSettings,\n", + ")\n", + "from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import RaptorXSimulationSetup\n", + "from ansys.edb.core.simulation_setup.simulation_settings import (\n", + " AdvancedMeshingSettings,\n", + " AdvancedSettings,\n", + " SettingsOptions,\n", + " SimulationSettings,\n", + " SolverSettings,\n", + " ViaStyle,\n", + ")\n", + "from ansys.edb.core.simulation_setup.simulation_setup import (\n", + " FreqSweepType,\n", + " HFSSRegionComputeResource,\n", + " InterpolatingSweepData,\n", + " SimulationSetup,\n", + " SimulationSetupType,\n", + " SweepData,\n", + ")\n", + "from ansys.edb.core.simulation_setup.siwave_dcir_simulation_settings import (\n", + " SIWaveDCIRSimulationSettings,\n", + ")\n", + "from ansys.edb.core.simulation_setup.siwave_dcir_simulation_setup import SIWaveDCIRSimulationSetup\n", + "from ansys.edb.core.simulation_setup.siwave_simulation_settings import (\n", + " SIWaveAdvancedSettings,\n", + " SIWaveDCAdvancedSettings,\n", + " SIWaveDCSettings,\n", + " SIWaveGeneralSettings,\n", + " SIWaveSimulationSettings,\n", + " SIWaveSParameterSettings,\n", + " SParamDCBehavior,\n", + " SParamExtrapolation,\n", + " SParamInterpolation,\n", + ")\n", + "from ansys.edb.core.simulation_setup.siwave_simulation_setup import SIWaveSimulationSetup\n", + "\n", + "\"\"\"Import terminal classes.\"\"\"\n", + "\n", + "from ansys.edb.core.terminal.terminals import (\n", + " BoundaryType,\n", + " BundleTerminal,\n", + " Edge,\n", + " EdgeTerminal,\n", + " EdgeType,\n", + " HfssPIType,\n", + " PadEdge,\n", + " PadstackInstanceTerminal,\n", + " PinGroupTerminal,\n", + " PointTerminal,\n", + " PrimitiveEdge,\n", + " SourceTermToGroundType,\n", + " Terminal,\n", + " TerminalInstance,\n", + " TerminalInstanceTerminal,\n", + " TerminalType,\n", + ")\n", + "\n", + "\"\"\"Import utility classes.\"\"\"\n", + "\n", + "from ansys.edb.core.utility.heat_sink import HeatSink\n", + "from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo\n", + "from ansys.edb.core.utility.material_property_thermal_modifier_params import (\n", + " AdvancedQuadraticParams,\n", + " BasicQuadraticParams,\n", + ")\n", + "from ansys.edb.core.utility.port_post_processing_prop import PortPostProcessingProp\n", + "from ansys.edb.core.utility.rlc import PinPair, PinPairRlc, Rlc\n", + "from ansys.edb.core.utility.temperature_settings import TemperatureSettings\n", + "from ansys.edb.core.utility.transform3d import Transform3D\n", + "from ansys.edb.core.utility.transform import Transform\n", + "from ansys.edb.core.utility.value import Value\n", + "\n", "from ansys.edb.core.session import launch_session" ] }, @@ -104,6 +334,14 @@ " gnd_net = Net.create(layout, 'GND')\n", " print('clean design created with default db, cell, layout, gnd_net variables.')" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c7cef147-521a-4d05-be8f-46e00f326420", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {}, diff --git a/notebooks/stackup_export.ipynb b/notebooks/stackup_export.ipynb index a4e0a2a454..d8fe5b62b8 100644 --- a/notebooks/stackup_export.ipynb +++ b/notebooks/stackup_export.ipynb @@ -98,8 +98,8 @@ " full_material = i.get_fill_material()\n", " \n", " if 'SIGNAL_LAYER' in str(layer_type):\n", - " matmodel = material_def.MaterialDef.find_by_name(db,i.get_material())\n", - " Sigma = matmodel.get_property(material_def.MaterialProperty.CONDUCTIVITY).value\n", + " matmodel = MaterialDef.find_by_name(db,i.get_material())\n", + " Sigma = matmodel.get_property(MaterialProperty.CONDUCTIVITY).value\n", " x = (name,\n", " layer_type,\n", " material,\n", @@ -108,9 +108,9 @@ " lower_elevation,\n", " full_material) \n", " elif 'DIELECTRIC_LAYER' in str(layer_type):\n", - " matmodel = material_def.MaterialDef.find_by_name(db,i.get_material())\n", - " Td = matmodel.get_property(material_def.MaterialProperty.DIELECTRIC_LOSS_TANGENT).value\n", - " Er = matmodel.get_property(material_def.MaterialProperty.PERMITTIVITY).value\n", + " matmodel = MaterialDef.find_by_name(db,i.get_material())\n", + " Td = matmodel.get_property(MaterialProperty.DIELECTRIC_LOSS_TANGENT).value\n", + " Er = matmodel.get_property(MaterialProperty.PERMITTIVITY).value\n", " x = (name,\n", " layer_type,\n", " material,\n", @@ -188,6 +188,14 @@ "source": [ "%run helpers/example_teardown.ipynb" ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "89775208-3cd1-49ca-ac16-fbeb54e57fec", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {}, diff --git a/src/ansys/edb/core/database.py b/src/ansys/edb/core/database.py index efbe087ba7..e67f81ddd7 100644 --- a/src/ansys/edb/core/database.py +++ b/src/ansys/edb/core/database.py @@ -6,17 +6,17 @@ import ansys.api.edb.v1.edb_defs_pb2 as edb_defs_pb2 import google.protobuf.wrappers_pb2 as proto_wrappers -from ansys.edb.core.definition import ( +from ansys.edb.core.definition.bondwire_def import ( ApdBondwireDef, BondwireDefType, - ComponentDef, - DatasetDef, Jedec4BondwireDef, Jedec5BondwireDef, - MaterialDef, - PackageDef, - PadstackDef, ) +from ansys.edb.core.definition.component_def import ComponentDef +from ansys.edb.core.definition.dataset_def import DatasetDef +from ansys.edb.core.definition.material_def import MaterialDef +from ansys.edb.core.definition.package_def import PackageDef +from ansys.edb.core.definition.padstack_def import PadstackDef from ansys.edb.core.edb_defs import DefinitionObjType from ansys.edb.core.inner import ObjBase, variable_server from ansys.edb.core.inner.messages import ( @@ -29,7 +29,7 @@ str_message, ) from ansys.edb.core.inner.utils import map_list -from ansys.edb.core.layout import Cell +from ansys.edb.core.layout.cell import Cell from ansys.edb.core.session import DatabaseServiceStub, StubAccessor, StubType @@ -130,17 +130,17 @@ def _map_cell_edb_obj_collection(cells_msg): @property def top_circuit_cells(self): - """:obj:`list` of :class:`Cell `: Top circuit cells in the database.""" + """:obj:`list` of :class:`.Cell`: Top circuit cells in the database.""" return Database._map_cell_edb_obj_collection(self.__stub.GetTopCircuits(self.msg)) @property def circuit_cells(self): - """:obj:`list` of :class:`Cell `: All circuit cells in the database.""" + """:obj:`list` of :class:`.Cell`: All circuit cells in the database.""" return Database._map_cell_edb_obj_collection(self.__stub.GetCircuits(self.msg)) @property def footprint_cells(self): - """:obj:`list` of :class:`Cell `: All footprint cells in the database.""" + """:obj:`list` of :class:`.Cell`: All footprint cells in the database.""" return Database._map_cell_edb_obj_collection(self.__stub.GetFootprints(self.msg)) @property @@ -319,12 +319,12 @@ def copy_cells(self, cells_to_copy): Parameters ---------- - cells_to_copy : list[:class:`Cell `] + cells_to_copy : list[:class:`.Cell`] Cells to copy. Returns ------- - list[:class:`Cell `] + list[:class:`.Cell`] New cells created in this database. """ return Database._map_cell_edb_obj_collection( @@ -354,52 +354,44 @@ def _get_bondwire_definition_objs(self, def_class, bw_def_type_enum): @property def apd_bondwire_defs(self): - """:obj:`list` of :class:`ApdBondwireDef `: All APD \ - bondwire definitions in the database.""" + """:obj:`list` of :class:`.ApdBondwireDef`: All APD bondwire definitions in the database.""" return self._get_bondwire_definition_objs(ApdBondwireDef, BondwireDefType.APD_BONDWIRE_DEF) @property def jedec4_bondwire_defs(self): - """:obj:`list` of :class:`Jedec4BondwireDef `: All JEDEC4 \ - bondwire definitions in the database.""" + """:obj:`list` of :class:`.Jedec4BondwireDef`: All JEDEC4 bondwire definitions in the database.""" return self._get_bondwire_definition_objs( Jedec4BondwireDef, BondwireDefType.JEDEC4_BONDWIRE_DEF ) @property def jedec5_bondwire_defs(self): - """:obj:`list` of:class:`Jedec5BondwireDef `: All JEDEC5 \ - bondwire definitions in the database.""" + """:obj:`list` of:class:`.Jedec5BondwireDef`: All JEDEC5 bondwire definitions in the database.""" return self._get_bondwire_definition_objs( Jedec5BondwireDef, BondwireDefType.JEDEC5_BONDWIRE_DEF ) @property def padstack_defs(self): - """:obj:`list` of :class:`PadstackDef `: All padstack definitions \ - in the database.""" + """:obj:`list` of :class:`.PadstackDef`: All padstack definitions in the database.""" return self._get_definition_objs(PadstackDef, DefinitionObjType.PADSTACK_DEF) @property def package_defs(self): - """:obj:`list` of :class:`PackageDef `: All package definitions \ - in the database.""" + """:obj:`list` of :class:`.PackageDef`: All package definitions in the database.""" return self._get_definition_objs(PackageDef, DefinitionObjType.PACKAGE_DEF) @property def component_defs(self): - """:obj:`list` of :class:`ComponentDef `: All component \ - definitions in the database.""" + """:obj:`list` of :class:`.ComponentDef`: All component definitions in the database.""" return self._get_definition_objs(ComponentDef, DefinitionObjType.COMPONENT_DEF) @property def material_defs(self): - """:obj:`list` of :class:`MaterialDef `: All material \ - definitions in the database.""" + """:obj:`list` of :class:`.MaterialDef`: All material definitions in the database.""" return self._get_definition_objs(MaterialDef, DefinitionObjType.MATERIAL_DEF) @property def dataset_defs(self): - """:obj:`list` of :class:`DatasetDef `: All dataset \ - definitions in the database.""" + """:obj:`list` of :class:`.DatasetDef`: All dataset definitions in the database.""" return self._get_definition_objs(DatasetDef, DefinitionObjType.DATASET_DEF) diff --git a/src/ansys/edb/core/definition/__init__.py b/src/ansys/edb/core/definition/__init__.py index c5bd269e0a..cd26deb201 100644 --- a/src/ansys/edb/core/definition/__init__.py +++ b/src/ansys/edb/core/definition/__init__.py @@ -1,46 +1 @@ """Import definition classes.""" - -from ansys.edb.core.definition.bondwire_def import ( - ApdBondwireDef, - BondwireDef, - BondwireDefType, - Jedec4BondwireDef, - Jedec5BondwireDef, -) -from ansys.edb.core.definition.component_def import ComponentDef -from ansys.edb.core.definition.component_model import ( - ComponentModel, - DynamicLinkComponentModel, - NPortComponentModel, -) -from ansys.edb.core.definition.component_pin import ComponentPin -from ansys.edb.core.definition.component_property import ComponentProperty -from ansys.edb.core.definition.dataset_def import DatasetDef -from ansys.edb.core.definition.debye_model import DebyeModel -from ansys.edb.core.definition.die_property import DieOrientation, DieProperty, DieType -from ansys.edb.core.definition.dielectric_material_model import ( - DielectricMaterialModel, - DielectricMaterialModelType, -) -from ansys.edb.core.definition.djordjecvic_sarkar_model import DjordjecvicSarkarModel -from ansys.edb.core.definition.ic_component_property import ICComponentProperty -from ansys.edb.core.definition.io_component_property import IOComponentProperty -from ansys.edb.core.definition.material_def import MaterialDef, MaterialProperty, ThermalModifier -from ansys.edb.core.definition.material_property_thermal_modifier import ( - MaterialPropertyThermalModifier, -) -from ansys.edb.core.definition.multipole_debye_model import MultipoleDebyeModel -from ansys.edb.core.definition.package_def import PackageDef -from ansys.edb.core.definition.padstack_def import PadstackDef -from ansys.edb.core.definition.padstack_def_data import ( - PadGeometryType, - PadstackDefData, - PadstackHoleRange, - PadType, - SolderballPlacement, - SolderballShape, -) -from ansys.edb.core.definition.port_property import PortProperty -from ansys.edb.core.definition.rlc_component_property import RLCComponentProperty -from ansys.edb.core.definition.solder_ball_property import SolderBallProperty -from ansys.edb.core.edb_defs import DefinitionObjType diff --git a/src/ansys/edb/core/definition/bondwire_def.py b/src/ansys/edb/core/definition/bondwire_def.py index 14180634c3..11c3f25dcf 100644 --- a/src/ansys/edb/core/definition/bondwire_def.py +++ b/src/ansys/edb/core/definition/bondwire_def.py @@ -8,7 +8,7 @@ from ansys.edb.core.edb_defs import DefinitionObjType from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class _QueryBuilder: @@ -59,7 +59,7 @@ class BondwireDef(ObjBase): @property def definition_type(self): - """:class:`DefinitionObjType`: Object type of the bondwire definition.""" + """:class:`.DefinitionObjType`: Object type of the bondwire definition.""" return DefinitionObjType.BONDWIRE_DEF @property @@ -88,7 +88,7 @@ def create(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to create the APD bondwire definition in. name : str Name of the APD bondwire definition. @@ -107,7 +107,7 @@ def load_definitions_from_file(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to load the APD bondwire into. name : str Name of the APD bondwire definition. @@ -120,7 +120,7 @@ def find_by_name(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the APD bondwire definition. name : str Name of the APD bondwire definition. @@ -185,7 +185,7 @@ def create(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to create the JEDEC4 bondwire definition in. name : str Name of the JEDEC4 bondwire definition. @@ -205,7 +205,7 @@ def find_by_name(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the JEDEC4 bondwire definition. name : str Name of the JEDEC4 bondwire definition. @@ -224,7 +224,7 @@ def get_parameters(self): Returns ------- - :class:`Value ` + :class:`.Value` Bondwire top-to-die distance. """ return Value(self.__stub.GetParameters(self.msg)) @@ -234,7 +234,7 @@ def set_parameters(self, top_to_die_distance): Parameters ---------- - top_to_die_distance : :class:`Value ` + top_to_die_distance : :class:`.Value` Bondwire top-to-die distance. """ self.__stub.SetParameters( @@ -289,7 +289,7 @@ def create(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to create the JEDEC5 bondwire definition in. name : str Name of the JEDEC5 bondwire definition. @@ -309,7 +309,7 @@ def find_by_name(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the JEDEC5 bondwire definition. name : str Name of the JEDEC5 bondwire definition. @@ -328,14 +328,12 @@ def get_parameters(self): Returns ------- - tuple[:class:`Value `, :class:`Value `, \ - :class:`Value `] + tuple[:class:`.Value`, :class:`.Value`, :class:`.Value`] + The tuple is in this format: ``(top_to_die_distance,die_pad_angle,lead_pad_angle)`` - The tuple is in this format: ``(top_to_die_distance,die_pad_angle,lead_pad_angle)`` - - - ``top_to_die_distance``: Bondwire top-to-die distance. - - ``die_pad_angle``: Bondwire die pad angle. - - `` lead_pad_angle``: Bondwire lead pad angle. + - ``top_to_die_distance``: Bondwire top-to-die distance. + - ``die_pad_angle``: Bondwire die pad angle. + - ``lead_pad_angle``: Bondwire lead pad angle. """ get_parameters_msg = self.__stub.GetParameters(self.msg) return ( @@ -349,11 +347,11 @@ def set_parameters(self, top_to_die_distance, die_pad_angle, lead_pad_angle): Parameters ---------- - top_to_die_distance : :class:`Value ` + top_to_die_distance : :class:`.Value` Bondwire top-to-die distance. - die_pad_angle : :class:`Value ` + die_pad_angle : :class:`.Value` Bondwire die pad angle. - lead_pad_angle : :class:`Value ` + lead_pad_angle : :class:`.Value` Bondwire lead pad angle. """ self.__stub.SetParameters( diff --git a/src/ansys/edb/core/definition/component_def.py b/src/ansys/edb/core/definition/component_def.py index 3ba03d5a19..43fa6c1da5 100644 --- a/src/ansys/edb/core/definition/component_def.py +++ b/src/ansys/edb/core/definition/component_def.py @@ -5,7 +5,6 @@ from ansys.edb.core.edb_defs import DefinitionObjType from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.inner.utils import map_list -from ansys.edb.core.layout import cell from ansys.edb.core.session import StubAccessor, StubType @@ -20,11 +19,11 @@ def create(cls, db, comp_def_name, fp): Parameters ---------- - db : :class:`Database ` + db : :class:`.Database` Database to create the component definition in. comp_def_name : str Name of the component definition to create. - fp : :class:`Cell ` + fp : :class:`.Cell` Footprint cell of the component definition, optional Returns @@ -42,7 +41,7 @@ def find(cls, db, comp_def_name): Parameters ---------- - db : :class:`Database ` + db : :class:`.Database` Database to search for the component definition. comp_def_name : str Name of the component definition. @@ -72,7 +71,9 @@ def name(self, value): @property def footprint(self): - """:class:`Cell `: Footprint of the component definition.""" + """:class:`.Cell`: Footprint of the component definition.""" + from ansys.edb.core.layout import cell + return cell.Cell(self.__stub.GetFootprintCell(self.msg)) @footprint.setter @@ -81,8 +82,7 @@ def footprint(self, value): @property def component_models(self): - """:obj:`list` of :class:`ComponentModel `: \ - All component models associated with the component definition. + """:obj:`list` of :class:`.ComponentModel`: All component models associated with the component definition. This property is read-only. """ @@ -91,8 +91,7 @@ def component_models(self): @property def component_pins(self): - """:obj:`list` of :class:`ComponentPin `: \ - All component pins of the component definition. + """:obj:`list` of :class:`.ComponentPin`: All component pins of the component definition. This property is read-only. """ diff --git a/src/ansys/edb/core/definition/component_model.py b/src/ansys/edb/core/definition/component_model.py index eca9a776e4..fd3ba2fb66 100644 --- a/src/ansys/edb/core/definition/component_model.py +++ b/src/ansys/edb/core/definition/component_model.py @@ -85,7 +85,7 @@ def create(cls, name): Notes ----- The component model does not belong to a specific database until it is added to a - :class:`ComponentDef ` instance. + :class:`.ComponentDef` instance. """ return NPortComponentModel(cls.__stub.Create(proto_wrappers.StringValue(value=name))) @@ -112,7 +112,7 @@ def create(cls, name): Notes ----- The component model does not belong to a specific database until it is added to a - :class:`ComponentDef ` class. + :class:`.ComponentDef` class. """ return DynamicLinkComponentModel(cls.__stub.Create(proto_wrappers.StringValue(value=name))) diff --git a/src/ansys/edb/core/definition/component_pin.py b/src/ansys/edb/core/definition/component_pin.py index af101b1790..48ad18c43a 100644 --- a/src/ansys/edb/core/definition/component_pin.py +++ b/src/ansys/edb/core/definition/component_pin.py @@ -17,7 +17,7 @@ def create(cls, comp_def, name): Parameters ---------- - comp_def : :class:`ComponentDef ` + comp_def : :class:`.ComponentDef` Component definition to create the component pin in. name : str Name of the component pin. @@ -35,7 +35,7 @@ def find(cls, comp_def, name): Parameters ---------- - comp_def : :class:`ComponentDef ` + comp_def : :class:`.ComponentDef` Component definition to search for the component pin. name : str Name of the component pin. @@ -66,8 +66,7 @@ def number(self): @property def component_def(self): - """:class:`ComponentDef `: Component definition that the component \ - pin belongs to. + """:class:`.ComponentDef`: Component definition that the component pin belongs to. This property is read-only. """ diff --git a/src/ansys/edb/core/definition/component_property.py b/src/ansys/edb/core/definition/component_property.py index c5139e00df..f1e94a68ea 100644 --- a/src/ansys/edb/core/definition/component_property.py +++ b/src/ansys/edb/core/definition/component_property.py @@ -6,7 +6,7 @@ from ansys.edb.core.definition import package_def from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class ComponentProperty(ObjBase): @@ -26,7 +26,7 @@ def clone(self): @property def package_mounting_offset(self): - """:class:`Value `: Mounting offset of the package definition object. + """:class:`.Value`: Mounting offset of the package definition object. This property can be set with :term:`ValueLike`. """ @@ -49,19 +49,17 @@ def package_def(self, value): @property def model(self): - """:class:`Model `: Model object. + """:class:`.Model`: Model object. This is a copy of the model object. Use the setter for any modifications to be reflected. """ comp_model_msg = self.__stub.GetModel(messages.edb_obj_message(self)) def get_model_obj_type(): - from ansys.edb.core.hierarchy import ( - NetlistModel, - PinPairModel, - SParameterModel, - SPICEModel, - ) + from ansys.edb.core.hierarchy.netlist_model import NetlistModel + from ansys.edb.core.hierarchy.pin_pair_model import PinPairModel + from ansys.edb.core.hierarchy.sparameter_model import SParameterModel + from ansys.edb.core.hierarchy.spice_model import SPICEModel if comp_model_msg.model_type == model_pb2.SPICE_MODEL_TYPE: return SPICEModel diff --git a/src/ansys/edb/core/definition/dataset_def.py b/src/ansys/edb/core/definition/dataset_def.py index 508b079f24..8c3efae814 100644 --- a/src/ansys/edb/core/definition/dataset_def.py +++ b/src/ansys/edb/core/definition/dataset_def.py @@ -24,7 +24,7 @@ def create(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to create the dataset definition in. name : :obj:`str` Name of the dataset to create. @@ -42,7 +42,7 @@ def find_by_name(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the dataset definition. name : :obj:`str` Name of the dataset definition. @@ -57,7 +57,7 @@ def find_by_name(cls, database, name): @property def definition_type(self): - """:class:`DefinitionObjType`: Definition type.""" + """:class:`.DefinitionObjType`: Definition type.""" return DefinitionObjType.DATASET_DEF @property @@ -75,7 +75,7 @@ def get_data(self): Returns ------- - list[:class:`PointData `] + list[:class:`.PointData`] """ msg = self.__stub.GetData(edb_obj_message(self)) return msg.points @@ -85,6 +85,6 @@ def set_data(self, points): Parameters ---------- - points : list[:class:`PointData `] + points : list[:class:`.PointData`] """ self.__stub.SetData(points_property_message(self, points)) diff --git a/src/ansys/edb/core/definition/debye_model.py b/src/ansys/edb/core/definition/debye_model.py index 655259fa3d..40edb249b4 100644 --- a/src/ansys/edb/core/definition/debye_model.py +++ b/src/ansys/edb/core/definition/debye_model.py @@ -86,7 +86,7 @@ def loss_tangent_at_high_low_frequency(self, freq): @property def is_relative_permitivity_enabled_at_optical_frequency(self): - """bool: Flag indicating if the relative permitivity at optical frequency is enabled.""" + """:obj:`bool`: Flag indicating if the relative permitivity at optical frequency is enabled.""" return self.__stub.IsRelativePermitivityEnabledAtOpticalFrequency(self.msg).value @is_relative_permitivity_enabled_at_optical_frequency.setter @@ -97,7 +97,7 @@ def is_relative_permitivity_enabled_at_optical_frequency(self, enabled): @property def use_dc_conductivity(self): - """bool: Flag indicating if the DC conductivity nominal value is used.""" + """:obj:`bool`: Flag indicating if the DC conductivity nominal value is used.""" return self.__stub.UseDCConductivity(self.msg).value @use_dc_conductivity.setter diff --git a/src/ansys/edb/core/definition/die_property.py b/src/ansys/edb/core/definition/die_property.py index 743f0c0d63..f387fb3d16 100644 --- a/src/ansys/edb/core/definition/die_property.py +++ b/src/ansys/edb/core/definition/die_property.py @@ -8,7 +8,7 @@ from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class DieOrientation(Enum): @@ -65,7 +65,7 @@ def die_type(self, value): @property def height(self): - """:class:`Value `: Die height. + """:class:`.Value`: Die height. This property can be set with :term:`ValueLike`. """ diff --git a/src/ansys/edb/core/definition/material_def.py b/src/ansys/edb/core/definition/material_def.py index d2fccb689e..9a21b95416 100644 --- a/src/ansys/edb/core/definition/material_def.py +++ b/src/ansys/edb/core/definition/material_def.py @@ -4,11 +4,11 @@ import ansys.api.edb.v1.material_def_pb2 as pb -from ansys.edb.core.definition import DielectricMaterialModel +from ansys.edb.core.definition.dielectric_material_model import DielectricMaterialModel from ansys.edb.core.edb_defs import DefinitionObjType from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import MaterialDefServiceStub, StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class MaterialProperty(Enum): @@ -123,11 +123,11 @@ def create(cls, database, name, **kwargs): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to create the material definition in. name : str Name of the material definition. - kwargs : dict{ str : :class:`Value ` } + kwargs : dict{ str : :class:`.Value` } Dictionary to convert to a ``MaterialDefPropertiesMessage`` object. The dictionary key is the material property name. The dictionary value is the material property value. The expected keys for the kwargs are: @@ -157,7 +157,7 @@ def find_by_name(cls, database, name): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the material definition. name : str Name of the material definition. @@ -171,7 +171,7 @@ def find_by_name(cls, database, name): @property def definition_type(self): - """:class:`DefinitionObjType`: Type of the material definition.""" + """:class:`.DefinitionObjType`: Type of the material definition.""" return DefinitionObjType.MATERIAL_DEF @property @@ -184,8 +184,7 @@ def name(self): @property def dielectric_material_model(self): - """:class:`DielectricMaterialModel \ - `: \ + """:class:`.DielectricMaterialModel`: \ Dielectric material model of the material definition.""" return DielectricMaterialModel( self.__stub.GetDielectricMaterialModel(messages.edb_obj_message(self)) @@ -206,7 +205,7 @@ def set_property(self, material_property, value, component_id=None, col=None, ro ---------- material_property : :class:`MaterialProperty` ID of the material property. - value : :class:`Value ` + value : :class:`.Value` New value. component_id : int, default: None ID of the component. @@ -235,7 +234,7 @@ def get_property(self, material_property, component_id=None, row=None, col=None) Returns ------- - :class:`Value ` + :class:`.Value` Value of the material property. """ return Value( @@ -249,7 +248,7 @@ def get_all_properties(self): Returns ------- - list of :class:`MaterialProperty`` + `list` of :class:`MaterialProperty` All properties for the material definition. """ msg = self.__stub.GetAllProperties(messages.edb_obj_message(self)) @@ -283,11 +282,10 @@ def get_dimensions(self, material_property_id): Returns ------- tuple[int, int] + The tuple is in a ``(col, row)`` format: - The tuple is in a ``(col, row)`` format: - - - ``col``: Number of rows of the material property. - - ``row``: Number of columns of the material property. + - ``col``: Number of rows of the material property. + - ``row``: Number of columns of the material property. """ msg = self.__stub.GetDimensions( _QueryBuilder.material_def_get_property_message(self, material_property_id) @@ -344,7 +342,7 @@ def get_anisotropic_thermal_modifier(self, material_property_id, component_id): Returns ------- - :class:`ThermalModifier ` + :class:`.ThermalModifier` Anisotropic thermal modifier of the material definition. """ return ThermalModifier( @@ -367,7 +365,7 @@ def set_anisotropic_thermal_modifier( Property ID. component_id : int Component ID. - thermal_modifier : :class:`ThermalModifier ` + thermal_modifier : :class:`.ThermalModifier` Anisotropic thermal modifier to set to the material definition. """ self.__stub.SetAnisotropicThermalModifier( diff --git a/src/ansys/edb/core/definition/material_property_thermal_modifier.py b/src/ansys/edb/core/definition/material_property_thermal_modifier.py index 02e7aa1e5b..fec5c54574 100644 --- a/src/ansys/edb/core/definition/material_property_thermal_modifier.py +++ b/src/ansys/edb/core/definition/material_property_thermal_modifier.py @@ -5,7 +5,11 @@ from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import AdvancedQuadraticParams, BasicQuadraticParams, Value +from ansys.edb.core.utility.material_property_thermal_modifier_params import ( + AdvancedQuadraticParams, + BasicQuadraticParams, +) +from ansys.edb.core.utility.value import Value class _QueryBuilder: @@ -40,11 +44,9 @@ def create(cls, basic_quadratic_params=None, advanced_quadratic_params=None): Parameters ---------- - basic_quadratic_params: :class:`BasicQuadraticParams `, \ - default: None + basic_quadratic_params : :class:`.BasicQuadraticParams`, default: None Basic parameters needed for the thermal modifier. - advanced_quadratic_params : :class:`AdvancedQuadraticParams `, \ - default: None + advanced_quadratic_params : :class:`.AdvancedQuadraticParams`, default: None Advanced parameeteres needed for the thermal modifier. Returns @@ -64,12 +66,11 @@ def create(cls, basic_quadratic_params=None, advanced_quadratic_params=None): @property def quadratic_model_params(self): - """:class:`BasicQuadraticParams `, \ - :class:`AdvancedQuadraticParams `: \ + """:class:`.BasicQuadraticParams`, :class:`.AdvancedQuadraticParams`: \ Quadratic model parameters of the thermal modifier. - The quadratic model is in this form: - PropVal(Temp) = PropValRef[1 + C1(Temp - TempRef) + C2(Temp - TempRef)^2] + The quadratic model is in this form: \ + PropVal(Temp) = PropValRef[1 + C1(Temp - TempRef) + C2(Temp - TempRef)^2] where PropValRef = The original property value without the thermal modifier applied This property is read-only. @@ -89,7 +90,7 @@ def quadratic_model_params(self): @property def expression(self): - """:class:`Value `: Expression value representing the thermal modifier. + """:class:`.Value`: Expression value representing the thermal modifier. This property is read-only. """ diff --git a/src/ansys/edb/core/definition/package_def.py b/src/ansys/edb/core/definition/package_def.py index ca9b70721f..e12f13e246 100644 --- a/src/ansys/edb/core/definition/package_def.py +++ b/src/ansys/edb/core/definition/package_def.py @@ -17,8 +17,8 @@ value_property_message, ) from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value from ansys.edb.core.utility.heat_sink import HeatSink, HeatSinkFinOrientation +from ansys.edb.core.utility.value import Value class PackageDef(ObjBase): @@ -32,7 +32,7 @@ def create(cls, db, name): Parameters ---------- - db :class:`Database ` + db :class:`.Database` Database to create the package definition in. name : str Name of the package definition. @@ -50,7 +50,7 @@ def find_by_name(cls, db, name): Parameters ---------- - db :class:`Database ` + db :class:`.Database` Database to search for the package definition. name : str Name of the package definition. @@ -68,7 +68,7 @@ def find_by_id(cls, db, uid): Parameters ---------- - db :class:`Database ` + db :class:`.Database` Database to search for the package definition. UID : int Unique identifier for the package definition. @@ -82,7 +82,7 @@ def find_by_id(cls, db, uid): @property def definition_type(self): - """:class:`DefinitionObjType`: Definition type.""" + """:class:`.DefinitionObjType`: Definition type.""" return DefinitionObjType.PACKAGE_DEF @property @@ -97,7 +97,8 @@ def name(self, value): @property @parser.to_polygon_data def exterior_boundary(self): - """:class:`PolygonData `: Exterior boundary of the package definition.""" + """:class:`.PolygonData`: \ + Exterior boundary of the package definition.""" return self.__stub.GetExteriorBoundary(edb_obj_message(self)) @exterior_boundary.setter @@ -106,7 +107,7 @@ def exterior_boundary(self, boundary): @property def height(self): - """:class:`Value `: Height of the package.""" + """:class:`.Value`: Height of the package.""" return Value(self.__stub.GetHeight(edb_obj_message(self))) @height.setter @@ -115,7 +116,7 @@ def height(self, height): @property def operating_power(self): - """:class:`Value `: Operating power of the package.""" + """:class:`.Value`: Operating power of the package.""" return Value(self.__stub.GetOperatingPower(edb_obj_message(self))) @operating_power.setter @@ -124,7 +125,7 @@ def operating_power(self, power): @property def maximum_power(self): - """:class:`Value `: Maximum power of the package.""" + """:class:`.Value`: Maximum power of the package.""" return Value(self.__stub.GetMaximumPower(edb_obj_message(self))) @maximum_power.setter @@ -133,7 +134,7 @@ def maximum_power(self, power): @property def thermal_conductivity(self): - """:class:`Value `: Thermal conductivity of the package.""" + """:class:`.Value`: Thermal conductivity of the package.""" return Value(self.__stub.GetTherm_Cond(edb_obj_message(self))) @thermal_conductivity.setter @@ -142,7 +143,7 @@ def thermal_conductivity(self, conductivity): @property def theta_jb(self): - """:class:`Value `: Theta JB (junction to board) of the package.""" + """:class:`.Value`: Theta JB (junction to board) of the package.""" return Value(self.__stub.GetTheta_JB(edb_obj_message(self))) @theta_jb.setter @@ -151,7 +152,7 @@ def theta_jb(self, theta): @property def theta_jc(self): - """:class:`Value `: Theta JC (junction to case) of the package.""" + """:class:`.Value`: Theta JC (junction to case) of the package.""" return Value(self.__stub.GetTheta_JC(edb_obj_message(self))) @theta_jc.setter @@ -160,7 +161,7 @@ def theta_jc(self, theta): @property def heat_sink(self): - """:class:`HeatSink `: Heat sink model assigned to the package.""" + """:class:`.HeatSink`: Heat sink model assigned to the package.""" heat_sink_paramaters = self.__stub.GetHeatSink(edb_obj_message(self)) return HeatSink( heat_sink_paramaters.thickness, diff --git a/src/ansys/edb/core/definition/padstack_def.py b/src/ansys/edb/core/definition/padstack_def.py index 4858af1cc6..e77c59e53e 100644 --- a/src/ansys/edb/core/definition/padstack_def.py +++ b/src/ansys/edb/core/definition/padstack_def.py @@ -18,7 +18,7 @@ def padstack_def_string_message(target, name): Parameters ---------- - target: :class:`Database ` or PadstackDef + target : :class:`.Database` or PadstackDef name : str Name of the string message. @@ -36,7 +36,7 @@ def padstack_def_set_data_message(target, data): ---------- target: PadstackDef Padstack definition target. - data : :class:`PadstackDefData ` + data : :class:`.PadstackDefData` Data message to create on the padstack definition. Returns @@ -57,7 +57,7 @@ def create(cls, db, name): Parameters ---------- - db : :class:`Database ` + db : :class:`.Database` Database to create the padstack definition in. name : str Data to set on the padstack definition. @@ -77,7 +77,7 @@ def find_by_name(cls, db, name): Parameters ---------- - db : :class:`Database `. + db : :class:`.Database`. Database to search for the padstack definition. name : str Name of the padstack definition. @@ -93,7 +93,7 @@ def find_by_name(cls, db, name): @property def definition_type(self): - """:class:`DefinitionObjType`: Definition type.""" + """:class:`.DefinitionObjType`: Definition type.""" return DefinitionObjType.PADSTACK_DEF @property @@ -106,7 +106,7 @@ def name(self): @property def data(self): - """:class:`PadstackDefData `: \ + """:class:`.PadstackDefData`: \ Data for the padstack definition.""" return PadstackDefData(self.__stub.GetData(self.msg)) diff --git a/src/ansys/edb/core/definition/padstack_def_data.py b/src/ansys/edb/core/definition/padstack_def_data.py index d7e165a7f7..60e0d1d919 100644 --- a/src/ansys/edb/core/definition/padstack_def_data.py +++ b/src/ansys/edb/core/definition/padstack_def_data.py @@ -11,7 +11,8 @@ from ansys.edb.core.inner import ObjBase, messages, parser from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value, conversions +from ansys.edb.core.utility import conversions +from ansys.edb.core.utility.value import Value class _PadstackDefDataQueryBuilder: @@ -304,26 +305,26 @@ def get_pad_parameters(self, layer, pad_type): Returns ------- - tuple[:class:`PadGeometryType`, list of :class:`Value `, \ - :class:`Value `, :class:`Value `, - :class:`Value `] + tuple[:class:`PadGeometryType`, list of :class:`.Value`, \ + :class:`.Value`, :class:`.Value`, + :class:`.Value`] or - tuple[:class:`PolygonData `, \ - :class:`Value `, \ - :class:`Value `, :class:`Value `] + tuple[:class:`.PolygonData`, \ + :class:`.Value`, \ + :class:`.Value`, :class:`.Value`] - The tuple is in this format for other than polygons: ``(pad_type, sizes, offset_x, offset_y, rotation)``. + The tuple is in this format for other than polygons: ``(pad_type, sizes, offset_x, offset_y, rotation)``. - For polygons, the tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. + For polygons, the tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. - - ``pad_type``: Pad type - - ``sizes``: Pad parameters - - ``offset_x``: X offset - - ``offset_y``: Y offset - - ``rotation``: Rotation - - ``fp``: Polygon geometry + - ``pad_type``: Pad type + - ``sizes``: Pad parameters + - ``offset_x``: X offset + - ``offset_y``: Y offset + - ``rotation``: Rotation + - ``fp``: Polygon geometry """ message = self.__stub.GetPadParameters( _PadstackDefDataQueryBuilder.padstack_def_data_get_pad_parameters_message( @@ -358,17 +359,17 @@ def set_pad_parameters( Layer name. pad_type : PadType Pad type. - offset_x : :class:`Value ` + offset_x : :class:`.Value` X offset. - offset_y : :class:`Value ` + offset_y : :class:`.Value` Y offset. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation. type_geom : PadGeometryType, default: None Pad geometry type. The default is ``None`` if setting polygonal pad parameters. - sizes : List[:class:`Value `], default: None + sizes : List[:class:`.Value`], default: None List of pad sizes. The default is ``None`` if setting polygonal pad parameters. - fp : :class:`PolygonData `, default: None + fp : :class:`.PolygonData`, default: None Polygon geometry. The default is ``None`` if not setting polygonal pad parameters. """ self.__stub.SetPadParameters( @@ -383,16 +384,15 @@ def get_hole_parameters(self): Returns ------- - tuple[:class:`PolygonData `, \ - :class:`Value `, \ - :class:`Value `, :class:`Value `] - - The tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. - - - ``fp``: Polygon geometry - - ``offset_x``: X offset - - ``offset_y``: Y offset - - ``rotation`` : Rotation + tuple[:class:`.PolygonData`, \ + :class:`.Value`, \ + :class:`.Value`, :class:`.Value`] + The tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. + + - ``fp``: Polygon geometry + - ``offset_x``: X offset + - ``offset_y``: Y offset + - ``rotation`` : Rotation """ return self.get_pad_parameters(None, PadType.HOLE) @@ -402,15 +402,15 @@ def set_hole_parameters(self, offset_x, offset_y, rotation, type_geom, sizes): Parameters ---------- - offset_x : :class:`Value ` + offset_x : :class:`.Value` X offset. - offset_y : :class:`Value ` + offset_y : :class:`.Value` Y offset. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation. type_geom : PadGeometryType Pad geometry type. - sizes : List[:class:`Value `] + sizes : List[:class:`.Value`] List of pad sizes. """ return self.set_pad_parameters( @@ -430,7 +430,7 @@ def hole_range(self, hole_range): @property def plating_percentage(self): - """:class:`Value `: Hole plating percentage.""" + """:class:`.Value`: Hole plating percentage.""" return Value(self.__stub.GetPlatingPercentage(self.msg)) @plating_percentage.setter @@ -469,8 +469,8 @@ def solder_ball_placement(self, solderball_placement): @property def solder_ball_param(self): - """:obj:`tuple` of [:class:`Value `, \ - :class:`Value `]: Solder ball parameters ``(d1, d2)`` \ + """:obj:`tuple` of [:class:`.Value`, \ + :class:`.Value`]: Solder ball parameters ``(d1, d2)`` \ in their original values in the database. - ``d1`` is the diameter for a cylinder solder ball or the top diameter for a spheroid @@ -515,12 +515,11 @@ def get_connection_pt(self, layer): Returns ------- - tuple[:class:`geometry.PointData`, :class:`ConnectionPtDirection`] - - The tuple is in a ``(position, direction)`` format: + tuple[:class:`.PointData`, :class:`ConnectionPtDirection`] + The tuple is in a ``(position, direction)`` format: - - ``position``: Position of the connection point. - - ``direction``: Direction of the connection point. + - ``position``: Position of the connection point. + - ``direction``: Direction of the connection point. """ msg = self.__stub.GetConnectionPt( _PadstackDefDataQueryBuilder.padstack_def_data_get_connection_pt_message(self, layer) diff --git a/src/ansys/edb/core/definition/port_property.py b/src/ansys/edb/core/definition/port_property.py index f25bb6dac8..13708a6fa4 100644 --- a/src/ansys/edb/core/definition/port_property.py +++ b/src/ansys/edb/core/definition/port_property.py @@ -5,7 +5,7 @@ from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class PortProperty(ObjBase): @@ -38,7 +38,7 @@ def clone(self): @property def reference_height(self): - """:class:`Value `: Reference height of the port property. + """:class:`.Value`: Reference height of the port property. This property can be set with :term:`ValueLike`. """ @@ -64,7 +64,7 @@ def get_reference_size(self): Returns ------- - tuple[:class:`Value `, :class:`Value `] + tuple[:class:`.Value`, :class:`.Value`] """ value_pair_message = self.__stub.GetReferenceSize(messages.edb_obj_message(self)) return Value(value_pair_message.val1), Value(value_pair_message.val2) diff --git a/src/ansys/edb/core/definition/solder_ball_property.py b/src/ansys/edb/core/definition/solder_ball_property.py index 3d75256b30..d2fe8b1c10 100644 --- a/src/ansys/edb/core/definition/solder_ball_property.py +++ b/src/ansys/edb/core/definition/solder_ball_property.py @@ -18,7 +18,7 @@ value_property_message, ) from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class _QueryBuilder: diff --git a/src/ansys/edb/core/geometry/__init__.py b/src/ansys/edb/core/geometry/__init__.py index f3c23d0dcc..07c1845010 100644 --- a/src/ansys/edb/core/geometry/__init__.py +++ b/src/ansys/edb/core/geometry/__init__.py @@ -1,8 +1 @@ """Import geometry classes.""" - -from ansys.edb.core.geometry.arc_data import ArcData -from ansys.edb.core.geometry.point3d_data import Point3DData -from ansys.edb.core.geometry.point_data import PointData -from ansys.edb.core.geometry.polygon_data import ExtentType, PolygonData, PolygonSenseType -from ansys.edb.core.geometry.r_tree import RTree -from ansys.edb.core.geometry.triangle3d_data import Triangle3DData diff --git a/src/ansys/edb/core/geometry/arc_data.py b/src/ansys/edb/core/geometry/arc_data.py index 252fff1111..81cc0dba8f 100644 --- a/src/ansys/edb/core/geometry/arc_data.py +++ b/src/ansys/edb/core/geometry/arc_data.py @@ -4,7 +4,8 @@ from ansys.api.edb.v1 import arc_data_pb2_grpc -from ansys.edb.core import geometry, session +from ansys.edb.core import session +from ansys.edb.core.geometry.point_data import PointData from ansys.edb.core.inner import messages, parser from ansys.edb.core.utility import conversions @@ -56,17 +57,17 @@ def __str__(self): if self.height == 0: return f"{self.start} {self.end}" else: - arc = geometry.PointData(self.height) + arc = PointData(self.height) return f"{self.start} {arc} {self.end}" @property def start(self): - """:class:`geometry.PointData`: Start point of the arc.""" + """:class:`.PointData`: Start point of the arc.""" return self._start @property def end(self): - """:class:`geometry.PointData`: End point of the arc.""" + """:class:`.PointData`: End point of the arc.""" return self._end @property @@ -112,13 +113,13 @@ def is_segment(self, tolerance=0.0): @property @parser.to_point_data def center(self): - """:class:`geometry.PointData`: Center point of the arc.""" + """:class:`.PointData`: Center point of the arc.""" return self.__stub.GetCenter(messages.arc_message(self)) @property @parser.to_point_data def midpoint(self): - """:class:`geometry.PointData`: Midpoint of the arc.""" + """:class:`.PointData`: Midpoint of the arc.""" return self.__stub.GetMidpoint(messages.arc_message(self)) @property @@ -129,7 +130,7 @@ def radius(self): @property @parser.to_polygon_data def bbox(self): - """:class:`geometry.PolygonData`: Rectangular bounding box of the arc.""" + """:class:`.PolygonData`: Rectangular bounding box of the arc.""" return self.__stub.GetBoundingBox(messages.arc_message(self)) def is_big(self): @@ -222,8 +223,8 @@ def length(self): @property def points(self): - """:obj:`list` of :class:`geometry.PointData`: Geometric points representing the arc.""" - return [self._start, geometry.PointData(self.height), self._end] + """:obj:`list` of :class:`.PointData`: Geometric points representing the arc.""" + return [self._start, PointData(self.height), self._end] def tangent_at(self, point): """Get the tangent vector of the arc at a given point. @@ -235,7 +236,7 @@ def tangent_at(self, point): Returns ------- - geometry.PointData + .PointData """ if self.is_segment(): return self.end - self.start @@ -244,9 +245,9 @@ def tangent_at(self, point): vec = point - self.center if self.is_ccw(): - return geometry.PointData(-vec.y, vec.x) + return PointData(-vec.y, vec.x) else: - return geometry.PointData(vec.y, -vec.x) + return PointData(vec.y, -vec.x) @parser.to_box def closest_points(self, other): @@ -259,6 +260,6 @@ def closest_points(self, other): Returns ------- - tuple[geometry.PointData, geometry.PointData] + tuple[.PointData, .PointData] """ return self.__stub.ClosestPoints(messages.arc_data_two_points(self, other)) diff --git a/src/ansys/edb/core/geometry/point3d_data.py b/src/ansys/edb/core/geometry/point3d_data.py index c703540416..8c65b52024 100644 --- a/src/ansys/edb/core/geometry/point3d_data.py +++ b/src/ansys/edb/core/geometry/point3d_data.py @@ -61,7 +61,7 @@ def __neg__(self): @property def x(self): - """:class:`Value`: X coordinate.""" + """:class:`.Value`: X coordinate.""" return self._x @x.setter @@ -70,7 +70,7 @@ def x(self, x): @property def y(self): - """:class:`Value`: Y coordinate.""" + """:class:`.Value`: Y coordinate.""" return self._y @y.setter @@ -79,7 +79,7 @@ def y(self, y): @property def z(self): - """:class:`Value`: Z coordinate.""" + """:class:`.Value`: Z coordinate.""" return self._z @z.setter diff --git a/src/ansys/edb/core/geometry/point_data.py b/src/ansys/edb/core/geometry/point_data.py index 65fd090bdb..0fdbf92cf1 100644 --- a/src/ansys/edb/core/geometry/point_data.py +++ b/src/ansys/edb/core/geometry/point_data.py @@ -6,9 +6,9 @@ from ansys.api.edb.v1 import point_data_pb2_grpc -from ansys.edb.core import session, utility +from ansys.edb.core import session from ansys.edb.core.inner import messages, parser -from ansys.edb.core.utility import conversions +from ansys.edb.core.utility import conversions, value class PointData: @@ -132,7 +132,7 @@ def value_equals(a, b): @property def _matrix_values(self): - """:obj:`list` of :class:`utility.Value`: Coordinates of the point as a list of values.""" + """:obj:`list` of :class:`.Value`: Coordinates of the point as a list of values.""" return [self.arc_height] if self.is_arc else [self.x, self.y] def _map_reduce(self, other, op): @@ -146,17 +146,17 @@ def is_arc(self): @property def arc_height(self): - """:class:`utility.Value`: Height of the arc.""" + """:class:`.Value`: Height of the arc.""" return self._arc_h @property def x(self): - """:class:`utility.Value`: X coordinate.""" + """:class:`.Value`: X coordinate.""" return self._x @property def y(self): - """:class:`utility.Value`: Y coordinate.""" + """:class:`.Value`: Y coordinate.""" return self._y @property @@ -174,7 +174,7 @@ def magnitude(self): """ if self.is_arc: return 0 - return math.sqrt(sum([v**2 for v in self._matrix_values], utility.Value(0)).value) + return math.sqrt(sum([v**2 for v in self._matrix_values], value.Value(0)).value) def normalized(self): """Normalize the point vector. @@ -237,7 +237,7 @@ def cross(self, other): Returns ------- - typing.Optional[utility.Value] or ``None`` if either point is an arc. + typing.Optional[.Value] or ``None`` if either point is an arc. """ other = conversions.to_point(other) if not self.is_arc and not other.is_arc: @@ -290,7 +290,7 @@ def dot(self, other): float Dot product of the two points. """ - return sum(self._map_reduce(other, operator.__mul__), utility.Value(0)).value + return sum(self._map_reduce(other, operator.__mul__), value.Value(0)).value def angle(self, other): """Get the angle between this vector and another vector. diff --git a/src/ansys/edb/core/geometry/polygon_data.py b/src/ansys/edb/core/geometry/polygon_data.py index 00fb6965eb..e99908f8dc 100644 --- a/src/ansys/edb/core/geometry/polygon_data.py +++ b/src/ansys/edb/core/geometry/polygon_data.py @@ -52,8 +52,8 @@ def __init__( arcs : list[ArcData], default: None lower_left : ansys.edb.core.typing.PointLike, default: None upper_right : ansys.edb.core.typing.PointLike, default: None - holes : List[ansys.edb.core.geometry.PolygonData], default: None - sense : ansys.edb.core.geometry.PolygonSenseType, default: SENSE_CCW + holes : List[ansys.edb.core.geometry.polygon_data.PolygonData], default: None + sense : ansys.edb.core.geometry.polygon_data.PolygonSenseType, default: SENSE_CCW closed : bool, default: True """ self._holes, self._sense, self._is_closed = ( @@ -90,12 +90,12 @@ def __len__(self): @property def points(self): - """:obj:`list` of :class:`ansys.edb.core.geometry.PointData`: List of coordinates for the points.""" + """:obj:`list` of :class:`.PointData`: List of coordinates for the points.""" return self._points @property def holes(self): - """:obj:`list` of :class:`PolygonData`: List of holes.""" + """:obj:`list` of :class:`.PolygonData`: List of holes.""" return self._holes @property @@ -248,7 +248,7 @@ def normalized(self): Returns ------- - list[ansys.edb.core.geometry.PointData] + list[.PointData] """ return self.__stub.GetNormalizedPoints(messages.polygon_data_message(self)) @@ -326,7 +326,7 @@ def bbox(self): Returns ------- - tuple[ansys.edb.core.geometry.PointData, ansys.edb.core.geometry.PointData] + tuple[.PointData, .PointData] """ return self.__stub.GetBBox(messages.polygon_data_list_message([self])) @@ -342,7 +342,7 @@ def bbox_of_polygons(cls, polygons): Returns ------- - tuple[ansys.edb.core.geometry.PointData, ansys.edb.core.geometry.PointData] + tuple[.PointData, .PointData] """ return cls.__stub.GetBBox(messages.polygon_data_list_message(polygons)) @@ -352,7 +352,7 @@ def bounding_circle(self): Returns ------- - tuple[ansys.edb.core.geometry.PointData, ansys.edb.core.utility.Value] + tuple[.PointData, .Value] """ return self.__stub.GetBoundingCircle(messages.polygon_data_message(self)) @@ -470,7 +470,7 @@ def closest_point(self, point): Returns ------- - ansys.edb.core.geometry.PointData + .PointData Point closest to the given point. """ return self.__stub.GetClosestPoints( @@ -487,7 +487,7 @@ def closest_points(self, polygon): Returns ------- - tuple[ansys.edb.core.geometry.PointData, ansys.edb.core.geometry.PointData] + tuple[.PointData, .PointData] """ return self.__stub.GetClosestPoints( messages.polygon_data_with_points_message(self, polygon=polygon) @@ -516,9 +516,9 @@ def intersect(cls, polygons1, polygons2): Parameters ---------- - polygons1: list of :class:`PolygonData` or `PolygonData` + polygons1: `list` of :class:`.PolygonData` or :class:`.PolygonData` First list of polygons. - polygons2: list of :class:`PolygonData` or `PolygonData` + polygons2: `list` of :class:`.PolygonData` or :class:`.PolygonData` Second optional list of polygons. Returns diff --git a/src/ansys/edb/core/geometry/r_tree.py b/src/ansys/edb/core/geometry/r_tree.py index 23022e8573..7240e55914 100644 --- a/src/ansys/edb/core/geometry/r_tree.py +++ b/src/ansys/edb/core/geometry/r_tree.py @@ -52,7 +52,7 @@ def __init__( Parameters ---------- - polygon: :class:`PolygonData ` + polygon : :class:`.PolygonData` Polygon representation for the object in the spatial index. obj: ObjBase Object to store in the index. @@ -100,7 +100,7 @@ def _handle_rtree_obj(self, rtree_obj): @property @parser.to_box def extent(self): - """:obj:`tuple` of [:class:`geometry.PointData`, :class:`geometry.PointData`]: Bounding box \ + """:obj:`tuple` of [:class:.PointData, :class:.PointData]: Bounding box \ for the contents of the RTree.""" return self.__stub.GetExtent(self.msg) @@ -109,7 +109,7 @@ def insert(self, rtree_obj): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with an index. """ unique_id = 1 if self._unique_id is None else self._unique_id + 1 @@ -126,7 +126,7 @@ def delete(self, rtree_obj): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with index in this form: ``(polygon, id pair)``. """ if self._handle_rtree_obj(rtree_obj): @@ -152,17 +152,17 @@ def search(self, box, bb_search): Parameters ---------- - box: Tuple[:class:`PointData `, :class:`PointData `] + box : tuple[:class:`.PointData`, :class:`.PointData`] Testing region, described as a "lower-left, upper-right" box. - bb_search: bool + bb_search : bool Whether the RTree object intersects when the bounding-box of its - :class:`PolygonData ` instance + :class:`.PolygonData` instance intersects the testing object. If ``False``, an explicit intersection is required for a hit. Returns ------- - :obj:`list` of :class:`RTreeObj` + :obj:`list` of :class:`.RTreeObj` List of intersecting RTree objects. """ msg = self.__stub.Search(_QueryBuilder.r_tree_search_message(self, box, bb_search)) @@ -173,15 +173,15 @@ def nearest_neighbor(self, rtree_obj): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree object with index in this form: ``(polygon, id pair)``. Returns ------- - :obj:`tuple` of RTreeObj, tuple[geometry.PointData, geometry.PointData] + :obj:`tuple` of :class:`.RTreeObj`, tuple[.PointData, .PointData] - ``RTreeObj``: Nearest-neighbor in the RTree to the provided object, or null if nothing is found. - - ``tuple[geometry.PointData, geometry.PointData]``: Line segment spanning the closest points between the object + - ``tuple[PointData, PointData]``: Line segment spanning the closest points between the object and the nearest neighbor. """ if self._handle_rtree_obj(rtree_obj): @@ -197,7 +197,7 @@ def touching_geometry(self, rtree_obj, increment_visit): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with index in this form: ``(polygon, id pair)``. increment_visit: bool Whether to increment the visit counter for items returned in the list @@ -205,7 +205,7 @@ def touching_geometry(self, rtree_obj, increment_visit): Returns ------- - :obj:`list` of :class:`RTreeObj` + :obj:`list` of :class:`.RTreeObj` All touching RTree objects. """ if self._handle_rtree_obj(rtree_obj): @@ -223,14 +223,14 @@ def connected_geometry(self, rtree_obj, increment_visit): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with index in this form: ``(polygon, id pair)``. increment_visit: bool Whether to increment the visit counter for items returned in the connected list. Returns ------- - :obj:`list` of RTreeObj + :obj:`list` of :class:`.RTreeObj` List of connected geometries. """ if self._handle_rtree_obj(rtree_obj): @@ -243,7 +243,7 @@ def connected_geometry(self, rtree_obj, increment_visit): @property def connected_geometry_sets(self): - """:obj:`list` of :obj:`list` of :class:`RTreeObj`: Connected geometry sets of an RTree \ + """:obj:`list` of :obj:`list` of :class:`.RTreeObj`: Connected geometry sets of an RTree \ in this form: ``(ids, sizes)``.""" msg = self.__stub.GetConnectedGeometrySets(messages.edb_obj_message(self)) set_start = 0 @@ -265,7 +265,7 @@ def is_visited(self, rtree_obj): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with index in this form: ``(polygon, id pair)``. Returns @@ -283,7 +283,7 @@ def visit(self, rtree_obj): Parameters ---------- - rtree_obj: RTreeObj + rtree_obj : :class:`.RTreeObj` R-tree data object with index in this form: ``(polygon, id pair)``. """ if self._handle_rtree_obj(rtree_obj): diff --git a/src/ansys/edb/core/hierarchy/__init__.py b/src/ansys/edb/core/hierarchy/__init__.py index 127579fead..116dbee684 100644 --- a/src/ansys/edb/core/hierarchy/__init__.py +++ b/src/ansys/edb/core/hierarchy/__init__.py @@ -1,14 +1 @@ """Import hierarchy classes.""" - -from ansys.edb.core.hierarchy.cell_instance import CellInstance -from ansys.edb.core.hierarchy.component_group import ComponentGroup, ComponentType -from ansys.edb.core.hierarchy.group import Group -from ansys.edb.core.hierarchy.inst_array import InstArray -from ansys.edb.core.hierarchy.model import Model -from ansys.edb.core.hierarchy.netlist_model import NetlistModel -from ansys.edb.core.hierarchy.pin_group import PinGroup -from ansys.edb.core.hierarchy.pin_pair_model import PinPairModel -from ansys.edb.core.hierarchy.sparameter_model import SParameterModel -from ansys.edb.core.hierarchy.spice_model import SPICEModel -from ansys.edb.core.hierarchy.structure3d import MeshClosure, Structure3D -from ansys.edb.core.hierarchy.via_group import ViaGroup diff --git a/src/ansys/edb/core/hierarchy/cell_instance.py b/src/ansys/edb/core/hierarchy/cell_instance.py index 4e774518c5..3bfded0449 100644 --- a/src/ansys/edb/core/hierarchy/cell_instance.py +++ b/src/ansys/edb/core/hierarchy/cell_instance.py @@ -2,12 +2,13 @@ from ansys.api.edb.v1.cell_instance_pb2_grpc import CellInstanceServiceStub -from ansys.edb.core import layout from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.hierarchy import hierarchy_obj from ansys.edb.core.inner import messages +from ansys.edb.core.layout import layout from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Transform3D, Value +from ansys.edb.core.utility.transform3d import Transform3D +from ansys.edb.core.utility.value import Value class CellInstance(hierarchy_obj.HierarchyObj): @@ -22,11 +23,11 @@ def create(cls, layout, name, ref): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the cell instance in. name : str Name of the cell instance. - ref : :class:`Layout ` + ref : :class:`.Layout` Layout that the cell instance refers to. Returns @@ -44,11 +45,11 @@ def create_with_component(cls, layout, name, ref): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the cell instance in. name : str Name of the cell instance. - ref : :class:`ComponentDef ` + ref : :class:`.ComponentDef` Component that the cell instance refers to. Returns @@ -68,7 +69,7 @@ def find(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the cell instance. name : str Name of the cell instance. @@ -84,7 +85,7 @@ def find(cls, layout, name): @property def reference_layout(self): - """:class:`Layout `: Reference layout of the cell instance. + """:class:`.Layout`: Reference layout of the cell instance. This property is read-only. """ @@ -92,12 +93,12 @@ def reference_layout(self): @property def term_instances(self): - """:obj:`list` of :class:`TerminalInstances `: Terminal \ + """:obj:`list` of :class:`.TerminalInstance`: Terminal \ instances associated with the cell instance. This property is read-only. """ - from ansys.edb.core.terminal import TerminalInstance + from ansys.edb.core.terminal.terminals import TerminalInstance terms = self.__stub.GetTermInsts(self.msg).items return [TerminalInstance(ti) for ti in terms] @@ -117,7 +118,7 @@ def placement_3d(self, value): @property def transform3d(self): - """:class:`Transform3D `: \ + """:class:`.Transform3D`: \ 3D transformation information of the cell instance. For the transformation to be applied, the :obj:`placement_3d` property @@ -143,7 +144,7 @@ def get_parameter_override(self, param_name): Returns ------- - :class:`Value ` + :class:`.Value` Override value for the cell instance parameter. """ return Value( @@ -157,7 +158,7 @@ def set_parameter_override(self, param_name, param_value): ---------- param_name : str Name of the cell instance parameter. - param_value : :class:`Value ` + param_value : :class:`.Value` Value to override with. """ self.__stub.SetParameterOverride( diff --git a/src/ansys/edb/core/hierarchy/component_group.py b/src/ansys/edb/core/hierarchy/component_group.py index 85f4a9301d..103fe2adb8 100644 --- a/src/ansys/edb/core/hierarchy/component_group.py +++ b/src/ansys/edb/core/hierarchy/component_group.py @@ -34,12 +34,12 @@ def create_with_component(cls, layout, name, comp_name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the component group in. name : str Name of the component group. comp_name : str - Name of the :class:`ComponentDef ` instance that \ + Name of the :class:`.ComponentDef` instance that \ the component group refers to. Returns @@ -107,10 +107,10 @@ def find_by_def(cls, layout, comp_def_name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for component groups. comp_def_name : str - Name of the :class:`ComponentDef ` instance. + Name of the :class:`.ComponentDef` instance. Returns ------- diff --git a/src/ansys/edb/core/hierarchy/group.py b/src/ansys/edb/core/hierarchy/group.py index 02f3bfdd59..b3a31dc4a7 100644 --- a/src/ansys/edb/core/hierarchy/group.py +++ b/src/ansys/edb/core/hierarchy/group.py @@ -22,7 +22,9 @@ def cast(self): ------- Group """ - from ansys.edb.core.hierarchy import ComponentGroup, Structure3D, ViaGroup + from ansys.edb.core.hierarchy.component_group import ComponentGroup + from ansys.edb.core.hierarchy.structure3d import Structure3D + from ansys.edb.core.hierarchy.via_group import ViaGroup if self.is_null: return @@ -43,7 +45,7 @@ def create(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the group in. name : str Name of the group. @@ -61,7 +63,7 @@ def find(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the group. name : str Name of the group. diff --git a/src/ansys/edb/core/hierarchy/hierarchy_obj.py b/src/ansys/edb/core/hierarchy/hierarchy_obj.py index 94027751a8..cccd7d1038 100644 --- a/src/ansys/edb/core/hierarchy/hierarchy_obj.py +++ b/src/ansys/edb/core/hierarchy/hierarchy_obj.py @@ -2,9 +2,10 @@ from ansys.edb.core.definition import component_def from ansys.edb.core.inner import conn_obj, messages -from ansys.edb.core.layer import Layer +from ansys.edb.core.layer.layer import Layer from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Transform, Value +from ansys.edb.core.utility.transform import Transform +from ansys.edb.core.utility.value import Value class HierarchyObj(conn_obj.ConnObj): @@ -14,7 +15,8 @@ class HierarchyObj(conn_obj.ConnObj): @property def transform(self): - """:class:`Transform `: Transformation information of the hierarchy object.""" + """:class:`.Transform`: \ + Transformation information of the hierarchy object.""" transform_msg = self.__stub.GetTransform(self.msg) return Transform.create( transform_msg.scale, @@ -40,7 +42,7 @@ def name(self, value): @property def component_def(self): - """:class:`ComponentDef `: Component definition for the \ + """:class:`.ComponentDef`: Component definition for the \ hierarchy object if it exists, ``None`` otherwise. This property is read-only. @@ -49,7 +51,7 @@ def component_def(self): @property def placement_layer(self): - """:class:`Layer `: Placement layer for the hierarchy object.""" + """:class:`.Layer`: Placement layer for the hierarchy object.""" return Layer(self.__stub.GetPlacementLayer(self.msg)).cast() @placement_layer.setter @@ -58,8 +60,8 @@ def placement_layer(self, value): @property def location(self): - """:obj:`tuple` (:class:`Value `, \ - :class:`Value `): \ + """:obj:`tuple` (:class:`.Value`, \ + :class:`.Value`): \ Location [x, y] of the hierarchy object on the :obj:`placement_layer` object.""" pnt_msg = self.__stub.GetLocation(self.msg) return [Value(pnt_msg.x), Value(pnt_msg.y)] @@ -79,11 +81,11 @@ def solve_independent_preference(self): Notes ----- - For a :class:`ComponentModel ` instance, this flag indicates if the - model is embedded with the field solver, when applicable. + For a :class:`.ComponentModel` + instance, this flag indicates if the model is embedded with the field solver, when applicable. - For a :class:`CellInstance ` instance, it indicates if the design's - geometry is flattened/meshed with the parent, when applicable. + For a :class:`.CellInstance` instance, + it indicates if the design's geometry is flattened/meshed with the parent, when applicable. """ return self.__stub.GetSolveIndependentPreference(self.msg).value diff --git a/src/ansys/edb/core/hierarchy/inst_array.py b/src/ansys/edb/core/hierarchy/inst_array.py index 4ec2dc222b..490721b373 100644 --- a/src/ansys/edb/core/hierarchy/inst_array.py +++ b/src/ansys/edb/core/hierarchy/inst_array.py @@ -6,7 +6,7 @@ from ansys.edb.core.hierarchy import cell_instance from ansys.edb.core.inner import messages, parser from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class InstArray(cell_instance.CellInstance): @@ -21,21 +21,21 @@ def create(cls, layout, name, ref, orig, xaxis, yaxis, xcount, ycount): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the instance array in. name : str Name of the instance array. - ref : :class:`Layout ` + ref : :class:`.Layout` Layout that the instance array refers to. - orig : :class:`PointData ` + orig : :class:`.PointData` Point data that represents the origin of the instance array. - xaxis : :class:`PointData ` + xaxis : :class:`.PointData` Point data that represents the x axis of the instance array. - yaxis : :class:`PointData ` + yaxis : :class:`.PointData` Point data that represents the y axis of the instance array. - xcount : :class:`Value ` + xcount : :class:`.Value` Value for the x count of the instance array. - ycount : :class:`Value ` + ycount : :class:`.Value` Value for the y count of the instance array. Returns @@ -57,7 +57,7 @@ def find(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the instance array. name : str Name of the instance array. @@ -72,13 +72,13 @@ def find(cls, layout, name): @property @parser.to_point_data def orig(self): - """:class:`PointData `: Origin of the instance array.""" + """:class:`.PointData`: Origin of the instance array.""" return self.__stub.GetOrig(self.msg) @property @parser.to_point_data def x_axis(self): - """:class:`PointData `: X axis of the instance array.""" + """:class:`.PointData`: X axis of the instance array.""" return self.__stub.GetXAxis(self.msg) @x_axis.setter @@ -88,7 +88,7 @@ def x_axis(self, value): @property @parser.to_point_data def y_axis(self): - """:class:`PointData `: Y axis of the instance array.""" + """:class:`.PointData`: Y axis of the instance array.""" return self.__stub.GetYAxis(self.msg) @y_axis.setter @@ -97,7 +97,7 @@ def y_axis(self, value): @property def x_count(self): - """:class:`Value `: X count of the instance array.""" + """:class:`.Value`: X count of the instance array.""" return Value(self.__stub.GetXCount(self.msg)) @x_count.setter @@ -106,7 +106,7 @@ def x_count(self, value): @property def y_count(self): - """:class:`Value `: Y count of the instance array.""" + """:class:`.Value`: Y count of the instance array.""" return Value(self.__stub.GetYCount(self.msg)) @y_count.setter diff --git a/src/ansys/edb/core/hierarchy/pin_group.py b/src/ansys/edb/core/hierarchy/pin_group.py index c5a06c2552..727fac3993 100644 --- a/src/ansys/edb/core/hierarchy/pin_group.py +++ b/src/ansys/edb/core/hierarchy/pin_group.py @@ -3,7 +3,7 @@ from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import messages from ansys.edb.core.inner.conn_obj import ConnObj -from ansys.edb.core.primitive import PadstackInstance +from ansys.edb.core.primitive.primitive import PadstackInstance from ansys.edb.core.session import StubAccessor, StubType @@ -19,11 +19,11 @@ def create(cls, layout, name, padstack_instances): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the pin group in. name : str Name of the pin group. - padstack_instances : list[:class:`PadstackInstance `] + padstack_instances : list[:class:`.PadstackInstance`] List of padstack instances. Returns @@ -41,7 +41,7 @@ def find(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the pin group. name : str Name of the pin group. @@ -59,7 +59,7 @@ def unique_name(cls, layout, prefix): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the pin group. prefix : str Prefix of the unique name. @@ -83,7 +83,7 @@ def name(self): @property def pins(self): - """:obj:`list` of :class:`PadstackInstances `: \ + """:obj:`list` of :class:`PadstackInstances <.PadstackInstance>`: \ Padstack instances. This property is read-only. @@ -96,7 +96,7 @@ def add_pins(self, pins): Parameters ---------- - pins : list[:class:`PadstackInstance `] + pins : list[:class:`.PadstackInstance`] List of padstick instances. """ self.__stub.AddPins(messages.pin_group_pins_modify_message(self, pins)) @@ -106,7 +106,7 @@ def remove_pins(self, pins): Parameters ---------- - pins : list[:class:`PadstackInstance `] + pins : list[:class:`.PadstackInstance`] List of padstick instances. """ self.__stub.RemovePins(messages.pin_group_pins_modify_message(self, pins)) diff --git a/src/ansys/edb/core/hierarchy/pin_pair_model.py b/src/ansys/edb/core/hierarchy/pin_pair_model.py index 87470c1a8c..cc5f5a898b 100644 --- a/src/ansys/edb/core/hierarchy/pin_pair_model.py +++ b/src/ansys/edb/core/hierarchy/pin_pair_model.py @@ -32,7 +32,7 @@ def rlc(self, pin_pair): Returns ------- - :class:`Rlc` + :class:`.Rlc` """ res = self.__stub.GetRlc(messages.string_pair_property_message(self, pin_pair)) if res.found: @@ -46,7 +46,7 @@ def set_rlc(self, pin_pair, rlc): Parameters ---------- pin_pair : tuple[str, str] - rlc : :class:`Rlc` + rlc : :class:`.Rlc` """ self.__stub.SetRlc(messages.pin_pair_model_rlc_message(self, pin_pair, rlc)) diff --git a/src/ansys/edb/core/hierarchy/structure3d.py b/src/ansys/edb/core/hierarchy/structure3d.py index fed4eb582e..2e759b628f 100644 --- a/src/ansys/edb/core/hierarchy/structure3d.py +++ b/src/ansys/edb/core/hierarchy/structure3d.py @@ -8,7 +8,7 @@ from ansys.edb.core.hierarchy.group import Group from ansys.edb.core.inner import messages from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class MeshClosure(Enum): @@ -31,7 +31,7 @@ def create(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the 3D structure in. name : str Name of the 3D structure. @@ -69,7 +69,7 @@ def set_material(self, mat_name): @property def thickness(self): - """:class:`Value `: Thickness for the 3D structure.""" + """:class:`.Value`: Thickness for the 3D structure.""" return Value(self.__stub.GetThickness(self.msg)) @thickness.setter diff --git a/src/ansys/edb/core/hierarchy/via_group.py b/src/ansys/edb/core/hierarchy/via_group.py index 883b0df088..97b129ef50 100644 --- a/src/ansys/edb/core/hierarchy/via_group.py +++ b/src/ansys/edb/core/hierarchy/via_group.py @@ -18,9 +18,9 @@ def create_with_primitives(cls, layout, primitives, is_persistent): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the via groups in. - primitives : list[:class:`Primitive `] + primitives : list[:class:`.Primitive`] List of primitives to use to create the via groups. is_persistent : bool Whether to preserve primitives during via group creation. If ``False`` @@ -42,15 +42,15 @@ def create_with_outline(cls, layout, outline, conductivity_ratio, layer, net=Non Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout that owns the via group. - outline : list[:class:`Point2D `] or \ - list[:class:`PolygonData `] + outline : list[:class:`Point2D <.PointData>`] or \ + list[:class:`.PolygonData`] List of primitives to use to create the via group. conductivity_ratio : float - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` Placement layer for the via group. - net : str or :class:`Net `, default: None + net : str or :class:`.Net`, default: None Net that the via group is to belong to. Returns @@ -72,7 +72,7 @@ def find(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the via group. name : str Name of the via group. @@ -87,7 +87,7 @@ def find(cls, layout, name): @property @parser.to_polygon_data def outline(self): - """:class:`PolygonData `: Via group outline. + """:class:`.PolygonData`: Via group outline. This property is read-only. """ diff --git a/src/ansys/edb/core/inner/conn_obj.py b/src/ansys/edb/core/inner/conn_obj.py index 2bf062d387..e1df5c1e72 100644 --- a/src/ansys/edb/core/inner/conn_obj.py +++ b/src/ansys/edb/core/inner/conn_obj.py @@ -33,7 +33,7 @@ def _validate_edb_obj_type(cls, edb_obj_msg): """Verify that the object type received from the server matches the object type requested by the client.""" client_obj = cls(edb_obj_msg) if cls.layout_obj_type == LayoutObjType.PRIMITIVE: - import ansys.edb.core.primitive as primitive + import ansys.edb.core.primitive.primitive as primitive def get_client_prim_type_from_class(): if cls == primitive.Circle: @@ -54,9 +54,9 @@ def get_client_prim_type_from_class(): if get_client_prim_type_from_class() == primitive.Primitive(edb_obj_msg).primitive_type: return client_obj elif cls.layout_obj_type == LayoutObjType.TERMINAL: - import ansys.edb.core.terminal as terminal + from ansys.edb.core.terminal import terminals - server_term_type = terminal.Terminal(edb_obj_msg).type + server_term_type = terminals.Terminal(edb_obj_msg).type if client_obj.type == server_term_type: return client_obj else: @@ -69,7 +69,7 @@ def find_by_id(cls, layout, uid): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the :term:`Connectable` object. uid : int Database ID. @@ -99,16 +99,16 @@ def edb_uid(self): @property def component(self): - """:class:`ComponentGroup `: \ + """:class:`.ComponentGroup`: \ Component of the :term:`Connectable` object.""" - from ansys.edb.core.hierarchy import ComponentGroup + from ansys.edb.core.hierarchy.component_group import ComponentGroup return ComponentGroup(self.__stub.GetComponent(self.msg)) @property def group(self): - """:class:`Group `: Group of the :term:`Connectable` object.""" - from ansys.edb.core.hierarchy import Group + """:class:`.Group` object.""" + from ansys.edb.core.hierarchy.group import Group return Group(self.__stub.GetGroup(self.msg)).cast() @@ -118,11 +118,11 @@ def group(self, group): @property def net(self): - """:class:`Net `: Net of the :term:`Connectable` object. + """:class:`.Net`: Net of the :term:`Connectable` object. - This property can be set with a :class:`Net ` instance, a string, or ``None``. + This property can be set with a :class:`.Net` instance, a string, or ``None``. """ - from ansys.edb.core.net import Net + from ansys.edb.core.net.net import Net return Net(self.__stub.GetNet(self.msg)) @@ -135,7 +135,7 @@ def create_stride(self): Returns ------- - :class:`McadModel ` + :class:`.McadModel` Stride model created. """ return mm.McadModel.create_stride(connectable=self) @@ -145,7 +145,7 @@ def create_hfss(self): Returns ------- - :class:`McadModel ` + :class:`.McadModel` HFSS model created. """ return mm.McadModel.create_hfss(connectable=self) @@ -155,7 +155,7 @@ def create_3d_comp(self): Returns ------- - :class:`McadModel ` + :class:`.McadModel` 3D composite model created. """ return mm.McadModel.create_3d_comp(connectable=self) diff --git a/src/ansys/edb/core/inner/factory.py b/src/ansys/edb/core/inner/factory.py index 6cbd46b4fc..4bdbc232f2 100644 --- a/src/ansys/edb/core/inner/factory.py +++ b/src/ansys/edb/core/inner/factory.py @@ -1,11 +1,13 @@ """This module allows for the creating of objects while avoid circular imports.""" from ansys.edb.core.edb_defs import LayoutObjType -from ansys.edb.core.hierarchy import CellInstance, Group, PinGroup -import ansys.edb.core.layout as layout -from ansys.edb.core.primitive import PadstackInstance, Primitive +from ansys.edb.core.hierarchy import cell_instance +from ansys.edb.core.hierarchy.group import Group +from ansys.edb.core.hierarchy.pin_group import PinGroup +from ansys.edb.core.layout import voltage_regulator +from ansys.edb.core.primitive.primitive import PadstackInstance, Primitive from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.terminal import Terminal, TerminalInstance +from ansys.edb.core.terminal.terminals import Terminal, TerminalInstance def create_conn_obj(msg): @@ -29,11 +31,11 @@ def create_conn_obj(msg): elif type == LayoutObjType.TERMINAL_INSTANCE: return TerminalInstance(msg) elif type == LayoutObjType.CELL_INSTANCE: - return CellInstance(msg) + return cell_instance.CellInstance(msg) elif type == LayoutObjType.GROUP: return Group(msg).cast() elif type == LayoutObjType.PIN_GROUP: return PinGroup(msg) elif type == LayoutObjType.VOLTAGE_REGULATOR: - return layout.VoltageRegulator(msg) + return voltage_regulator.VoltageRegulator(msg) raise TypeError("Encountered an unknown layout object type.") diff --git a/src/ansys/edb/core/inner/layout_obj.py b/src/ansys/edb/core/inner/layout_obj.py index c4633cb08c..8b4bc887af 100644 --- a/src/ansys/edb/core/inner/layout_obj.py +++ b/src/ansys/edb/core/inner/layout_obj.py @@ -5,7 +5,6 @@ from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import ObjBase import ansys.edb.core.inner.messages as messages -from ansys.edb.core.layout import layout from ansys.edb.core.session import LayoutObjServiceStub, StubAccessor, StubType @@ -52,10 +51,12 @@ def obj_type(self): @property def layout(self): - """:class:`Layout `: Layout owning the object. + """:class:`.Layout`: Layout owning the object. This property is read-only. """ + from ansys.edb.core.layout import layout + return layout.Layout( self.__stub.GetLayout(_QueryBuilder.layout_obj_target_msg(self, self.layout_obj_type)) ) @@ -69,7 +70,7 @@ def get_product_property(self, prod_id, attr_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. attr_id : int User-defined ID that identifies the string value stored in the property. @@ -90,7 +91,7 @@ def set_product_property(self, prod_id, attr_id, prop_value): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. attr_id : int User-defined ID that identifies the string value stored in the property. @@ -108,7 +109,7 @@ def get_product_property_ids(self, prod_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. Returns diff --git a/src/ansys/edb/core/inner/messages.py b/src/ansys/edb/core/inner/messages.py index fce3aee175..d093b5b733 100644 --- a/src/ansys/edb/core/inner/messages.py +++ b/src/ansys/edb/core/inner/messages.py @@ -146,9 +146,11 @@ from google.protobuf.empty_pb2 import Empty from google.protobuf.wrappers_pb2 import BoolValue, DoubleValue, FloatValue, Int64Value, StringValue -from ansys.edb.core import utility -from ansys.edb.core.simulation_setup import LengthMeshOperation, SkinDepthMeshOperation -from ansys.edb.core.utility import conversions +from ansys.edb.core.simulation_setup.mesh_operation import ( + LengthMeshOperation, + SkinDepthMeshOperation, +) +from ansys.edb.core.utility import conversions, value def str_message(s: str): @@ -982,13 +984,13 @@ def value_message(val): Parameters ---------- - val : str, int, float, complex, utility.Value, ValueMessage + val : str, int, float, complex, ansys.edb.core.utility.value.Value, ValueMessage Returns ------- ValueMessage """ - if isinstance(val, utility.Value): + if isinstance(val, value.Value): return val.msg if isinstance(val, ValueMessage): return val diff --git a/src/ansys/edb/core/inner/parser.py b/src/ansys/edb/core/inner/parser.py index 0102e3bf3e..3379eb8855 100644 --- a/src/ansys/edb/core/inner/parser.py +++ b/src/ansys/edb/core/inner/parser.py @@ -2,7 +2,17 @@ import functools -from ansys.edb.core import geometry, simulation_setup, utility +from ansys.edb.core.simulation_setup.adaptive_solutions import ( + AdaptiveFrequency, + BroadbandAdaptiveSolution, + MatrixConvergenceData, + MultiFrequencyAdaptiveSolution, + SingleFrequencyAdaptiveSolution, +) +from ansys.edb.core.simulation_setup.mesh_operation import ( + LengthMeshOperation, + SkinDepthMeshOperation, +) def to_point_data(fn): @@ -106,9 +116,12 @@ def _to_point_data(message): Returns ------- - geometry.PointData + :class:`.PointData` """ - return geometry.PointData([utility.Value(message.x), utility.Value(message.y)]) + from ansys.edb.core.geometry.point_data import PointData + from ansys.edb.core.utility.value import Value + + return PointData([Value(message.x), Value(message.y)]) def _to_point_data_pair(message): @@ -120,7 +133,7 @@ def _to_point_data_pair(message): Returns ------- - tuple[geometry.PointData, geometry.PointData] + tuple[:class:`.PointData`, :class:`.PointData`] """ return _to_point_data(message.point_0), _to_point_data(message.point_1) @@ -134,7 +147,7 @@ def _to_point_data_list(message): Returns ------- - list[geometry.PointData] + list[:class:`.PointData`] """ return [_to_point_data(m) for m in message] @@ -148,7 +161,7 @@ def _to_3_point3d_data(message): Returns ------- - geometry.Point3DData + :class:`.Point3DData` """ return [_to_point3d_data(message.x), _to_point3d_data(message.y), _to_point3d_data(message.z)] @@ -162,11 +175,12 @@ def _to_point3d_data(message): Returns ------- - geometry.Point3DData + :class:`.Point3DData` """ - return geometry.Point3DData( - utility.Value(message.x), utility.Value(message.y), utility.Value(message.z) - ) + from ansys.edb.core.geometry.point3d_data import Point3DData + from ansys.edb.core.utility.value import Value + + return Point3DData(Value(message.x), Value(message.y), Value(message.z)) def _to_polygon_data(message): @@ -178,15 +192,17 @@ def _to_polygon_data(message): Returns ------- - geometry.PolygonData + :class:`.PolygonData` """ from ansys.api.edb.v1.point_data_pb2 import BoxMessage + from ansys.edb.core.geometry.polygon_data import PolygonData + if isinstance(message, BoxMessage): b = _to_box(message) - return geometry.PolygonData(lower_left=b[0], upper_right=b[1]) + return PolygonData(lower_left=b[0], upper_right=b[1]) else: - return geometry.PolygonData( + return PolygonData( points=_to_point_data_list(message.points), holes=_to_polygon_data_list(message.holes), sense=message.sense, @@ -199,7 +215,7 @@ def _to_polygon_data_list(message): Returns ------- - list[geometry.PolygonData] + list[:class:`.PolygonData`] """ if hasattr(message, "polygons"): return [_to_polygon_data(m) for m in message.polygons] @@ -218,7 +234,7 @@ def _to_box(message): Returns ------- - tuple[geometry.PointData, geometry.PointData] + tuple[:class:`.PointData`, :class:`.PointData`] """ if hasattr(message, "lower_left") and hasattr(message, "upper_right"): return _to_point_data(message.lower_left), _to_point_data(message.upper_right) @@ -233,10 +249,12 @@ def _to_circle(message): Returns ------- - tuple[geometry.PointData, utility.Value] + tuple[:class:`.PointData`, :class:`.Value`] """ + from ansys.edb.core.utility.value import Value + if hasattr(message, "center") and hasattr(message, "radius"): - return _to_point_data(message.center), utility.Value(message.radius) + return _to_point_data(message.center), Value(message.radius) def _to_rlc(message): @@ -248,14 +266,17 @@ def _to_rlc(message): Returns ------- - Rlc + :class:`.Rlc` """ - return utility.Rlc( - utility.Value(message.r), + from ansys.edb.core.utility.rlc import Rlc + from ansys.edb.core.utility.value import Value + + return Rlc( + Value(message.r), message.r_enabled.value, - utility.Value(message.l), + Value(message.l), message.l_enabled.value, - utility.Value(message.c), + Value(message.c), message.c_enabled.value, message.is_parallel.value, ) @@ -276,7 +297,7 @@ def _to_mx_convergence_data(message): if len(mx_entry_msgs) == 0: return - mx_conv_data = simulation_setup.MatrixConvergenceData() + mx_conv_data = MatrixConvergenceData() if ( message.all_are_constant or message.all_diag_are_constant @@ -353,7 +374,7 @@ def _to_single_frequency_adaptive_solution(message): SingleFrequencyAdaptiveSolution """ adaptive_freq_data = _to_base_adaptive_frequency_solution(message.adaptive_frequency) - return simulation_setup.SingleFrequencyAdaptiveSolution( + return SingleFrequencyAdaptiveSolution( adaptive_freq_data[0], adaptive_freq_data[1], message.max_passes, @@ -374,7 +395,7 @@ def _to_multi_adaptive_freq(message): AdaptiveFrequency """ adaptive_freq_data = _to_base_adaptive_frequency_solution(message.adaptive_frequency) - return simulation_setup.AdaptiveFrequency( + return AdaptiveFrequency( adaptive_freq_data[0], adaptive_freq_data[1], {key: value for (key, value) in message.output_variables}, @@ -392,7 +413,7 @@ def _to_multi_frequency_adaptive_solution(message): ------- MultiFrequencyAdaptiveSolution """ - return simulation_setup.MultiFrequencyAdaptiveSolution( + return MultiFrequencyAdaptiveSolution( message.max_passes, [_to_multi_adaptive_freq(freq_msg) for freq_msg in message.adaptive_frequencies], ) @@ -409,7 +430,7 @@ def _to_broadband_adaptive_solution(message): ------- BroadbandAdaptiveSolution """ - return simulation_setup.BroadbandAdaptiveSolution( + return BroadbandAdaptiveSolution( message.low_frequency, message.high_frequency, message.max_passes, message.max_delta ) @@ -425,7 +446,7 @@ def _length_mesh_op(message): ------- LengthMeshOperation """ - return simulation_setup.LengthMeshOperation( + return LengthMeshOperation( max_length=message.max_length, restrict_max_length=message.restrict_length, max_elements=message.max_elements, @@ -444,7 +465,7 @@ def _to_skin_depth_mesh_op(message): ------- SkinDepthMeshOperation """ - return simulation_setup.SkinDepthMeshOperation( + return SkinDepthMeshOperation( skin_depth=message.skin_depth, surface_triangle_length=message.surface_triangle_length, num_layers=message.num_layers, diff --git a/src/ansys/edb/core/inner/variable_server.py b/src/ansys/edb/core/inner/variable_server.py index 5de4f0cc79..5d63a755a8 100644 --- a/src/ansys/edb/core/inner/variable_server.py +++ b/src/ansys/edb/core/inner/variable_server.py @@ -5,7 +5,7 @@ from ansys.edb.core.inner.messages import value_message from ansys.edb.core.session import get_variable_server_stub -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class VariableServer: @@ -32,8 +32,8 @@ def add_variable(self, name, value, is_param=False): ---------- name : str Variable name. - value : str, int, float, complex, :class:`Value ` - Value, which can be any type that can be converted to a :class:`Value ` + value : str, int, float, complex, :class:`.Value` + Value, which can be any type that can be converted to a :class:`.Value` instance. is_param : bool, default: False Whether the new variable is a parameter. The default is ``False``, which means it is a local variable. @@ -42,11 +42,11 @@ def add_variable(self, name, value, is_param=False): ----- Variables can be added to the following EDB objects: - * :class:`Database ` (Variable names must begin with a '$'.) - * :class:`ComponentDef ` - * :class:`Cell ` - * :class:`Layout ` (Adds variable to the corresponding - :class:`Cell ` instance.) + * :class:`.Database` (Variable names must begin with a '$'.) + * :class:`.ComponentDef` + * :class:`.Cell` + * :class:`.Layout` (Adds variable to the corresponding + :class:`.Cell` instance.) Examples -------- @@ -74,8 +74,8 @@ def add_menu_variable(self, name, values, is_param=False, index=0): ---------- name : str Variable name. - values : list[str, int, float, complex, :class:`Value `] - Each element can be any type that can be converted to a :class:`Value ` + values : list[str, int, float, complex, :class:`.Value`] + Each element can be any type that can be converted to a :class:`.Value` instance. is_param : bool, default: False Whether the new variable is a parameter. The default is ``False``, which means it is a local variable. @@ -115,7 +115,7 @@ def set_variable_value(self, name, new_value): ---------- name : str Variable name. - new_value : str, int, float, complex, :class:`Value ` + new_value : str, int, float, complex, :class:`.Value` New value. """ temp = variable_server_msgs.SetVariableMessage( @@ -133,7 +133,7 @@ def get_variable_value(self, name): Returns ------- - :class:`Value ` + :class:`.Value` Variable value. """ temp = variable_server_msgs.VariableNameMessage( @@ -210,26 +210,26 @@ def create_value(self, val): Parameters ---------- val : str, int, float, complex - Value, which can be any type that can be converted to a :class:`Value ` + Value, which can be any type that can be converted to a :class:`.Value` instance. Returns ------- - :class:`Value ` + :class:`.Value` Notes ----- - Creating a value from a :class:`Database ` instance can reference variables - in the :class:`Database ` instance. + Creating a value from a :class:`.Database` instance can reference variables + in the :class:`.Database` instance. - Creating a value from a :class:`Cell ` instance can reference variables in - both the :class:`Database ` instance and the - :class:`Cell ` instance + Creating a value from a :class:`.Cell` instance can reference variables in + both the :class:`.Database` instance and the + :class:`.Cell` instance - Creating a value from a :class:`ComponentDef ` instance can reference - variables in both the :class:`Database ` instance and - the :class:`ComponentDef ` instance. + Creating a value from a :class:`.ComponentDef` + instance can reference variables in both the :class:`.Database` instance and + the :class:`.ComponentDef` instance. """ if isinstance(val, str): return Value(val, self) diff --git a/src/ansys/edb/core/layer/__init__.py b/src/ansys/edb/core/layer/__init__.py index b8eede3128..c4c82ed87c 100644 --- a/src/ansys/edb/core/layer/__init__.py +++ b/src/ansys/edb/core/layer/__init__.py @@ -1,17 +1 @@ """Import layer classes.""" - -from ansys.edb.core.layer.layer import ( - DrawOverride, - Layer, - LayerType, - LayerVisibility, - TopBottomAssociation, -) -from ansys.edb.core.layer.layer_collection import ( - DielectricMergingMethod, - LayerCollection, - LayerCollectionMode, - LayerTypeSet, -) -from ansys.edb.core.layer.stackup_layer import DCThicknessType, RoughnessRegion, StackupLayer -from ansys.edb.core.layer.via_layer import ViaLayer diff --git a/src/ansys/edb/core/layer/layer.py b/src/ansys/edb/core/layer/layer.py index 6a151a5df7..9d5baf8c5b 100644 --- a/src/ansys/edb/core/layer/layer.py +++ b/src/ansys/edb/core/layer/layer.py @@ -87,7 +87,8 @@ def cast(self): ------- Layer """ - from ansys.edb.core.layer import StackupLayer, ViaLayer + from ansys.edb.core.layer.stackup_layer import StackupLayer + from ansys.edb.core.layer.via_layer import ViaLayer lyr = Layer(self.msg) if lyr.is_stackup_layer: @@ -269,7 +270,7 @@ def get_product_property(self, prod_id, attr_it): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. attr_it : int Attribute ID. @@ -288,7 +289,7 @@ def set_product_property(self, prod_id, attr_it, prop_value): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. attr_it : int Attribute ID. @@ -304,7 +305,7 @@ def get_product_property_ids(self, prod_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. Returns diff --git a/src/ansys/edb/core/layer/layer_collection.py b/src/ansys/edb/core/layer/layer_collection.py index 1bba7ec58e..8c1aa826f1 100644 --- a/src/ansys/edb/core/layer/layer_collection.py +++ b/src/ansys/edb/core/layer/layer_collection.py @@ -362,7 +362,7 @@ def get_product_property(self, prod_id, attr_it): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. attr_it : int Attribute ID. @@ -383,7 +383,7 @@ def set_product_property(self, prod_id, attr_it, prop_value): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. attr_it : int Attribute ID. @@ -399,7 +399,7 @@ def get_product_property_ids(self, prod_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` Product ID. Returns @@ -427,7 +427,7 @@ def merge_dielectrics( Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` start_layer_name : str end_layer_name : str merging_method : DielectricMergingMethod @@ -532,7 +532,7 @@ def simplify_dielectrics_for_phi( Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` layer_thickness_thresh : float, default: -1 Thickness threshold for the layer. merging_method : DielectricMergingMethod, default: WEIGHTED_CAPACITANCE diff --git a/src/ansys/edb/core/layer/stackup_layer.py b/src/ansys/edb/core/layer/stackup_layer.py index 27225d3661..4f631f7d3e 100644 --- a/src/ansys/edb/core/layer/stackup_layer.py +++ b/src/ansys/edb/core/layer/stackup_layer.py @@ -5,9 +5,9 @@ import ansys.api.edb.v1.stackup_layer_pb2 as stackup_layer_pb2 from ansys.edb.core.inner import messages -from ansys.edb.core.layer import Layer +from ansys.edb.core.layer.layer import Layer from ansys.edb.core.session import get_stackup_layer_stub -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class DCThicknessType(Enum): @@ -101,7 +101,7 @@ def negative(self, is_negative): @property def thickness(self): - """:class:`Value `: Thickness value of the layer. + """:class:`.Value`: Thickness value of the layer. The setter accepts a :term:`ValueLike` term. """ @@ -113,7 +113,7 @@ def thickness(self, thickness): @property def lower_elevation(self): - """:class:`Value `: Lower elevation value of the layer. + """:class:`.Value`: Lower elevation value of the layer. The setter accepts a :term:`ValueLike` term. """ @@ -127,7 +127,7 @@ def lower_elevation(self, lower_elevation): @property def upper_elevation(self): - """:class:`Value `: Upper elevation value of the layer. + """:class:`.Value`: Upper elevation value of the layer. This property is read-only. """ @@ -258,7 +258,7 @@ def etch_factor_enabled(self, enable_etch_factor): @property def etch_factor(self): - """:class:`Value `: Etch factor of the layer. + """:class:`.Value`: Etch factor of the layer. The setter accepts a :term:`ValueLike` term. """ diff --git a/src/ansys/edb/core/layer/via_layer.py b/src/ansys/edb/core/layer/via_layer.py index ca5b00480f..40704f15bf 100644 --- a/src/ansys/edb/core/layer/via_layer.py +++ b/src/ansys/edb/core/layer/via_layer.py @@ -2,7 +2,7 @@ import ansys.api.edb.v1.via_layer_pb2 as via_layer_pb2 -from ansys.edb.core.layer import StackupLayer +from ansys.edb.core.layer.stackup_layer import StackupLayer from ansys.edb.core.session import get_via_layer_stub diff --git a/src/ansys/edb/core/layout/__init__.py b/src/ansys/edb/core/layout/__init__.py index 8852859c66..cce825d5bf 100644 --- a/src/ansys/edb/core/layout/__init__.py +++ b/src/ansys/edb/core/layout/__init__.py @@ -1,6 +1 @@ """Import layout classes.""" - -from ansys.edb.core.layout.cell import Cell, CellType, DesignMode -from ansys.edb.core.layout.layout import Layout -from ansys.edb.core.layout.mcad_model import McadModel -from ansys.edb.core.layout.voltage_regulator import PowerModule, VoltageRegulator diff --git a/src/ansys/edb/core/layout/cell.py b/src/ansys/edb/core/layout/cell.py index 1a5c28fab7..ce812371f1 100644 --- a/src/ansys/edb/core/layout/cell.py +++ b/src/ansys/edb/core/layout/cell.py @@ -9,11 +9,12 @@ from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import ObjBase, messages, variable_server from ansys.edb.core.layout import layout -from ansys.edb.core.primitive import Primitive +from ansys.edb.core.primitive.primitive import Primitive from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.simulation_setup import SimulationSetup -from ansys.edb.core.utility import TemperatureSettings, Value +from ansys.edb.core.simulation_setup.simulation_setup import SimulationSetup from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo +from ansys.edb.core.utility.temperature_settings import TemperatureSettings +from ansys.edb.core.utility.value import Value class CellType(Enum): @@ -155,7 +156,7 @@ def create(cls, db, cell_type, cell_name): Parameters ---------- - db : :class:`Database ` + db : :class:`.Database` Database to create the cell in. cell_type : CellType Type of the cell to create. @@ -171,7 +172,7 @@ def create(cls, db, cell_type, cell_name): @property def layout(self): - """:class:`Layout `: Layout of the cell. + """:class:`.Layout`: Layout of the cell. This property is read-only. """ @@ -179,7 +180,7 @@ def layout(self): @property def flattened_layout(self): - """:class:`Layout `: Flattened layout of the cell. + """:class:`.Layout`: Flattened layout of the cell. This property is read-only. """ @@ -191,7 +192,7 @@ def find(cls, database, cell_type, name=None, cell_id=None): Parameters ---------- - database : :class:`Database ` + database : :class:`.Database` Database to search for the cell. cell_type : CellType Type of the cell. @@ -216,7 +217,7 @@ def delete(self): @property def database(self): - """:class:`Database `: Owning database of the cell. + """:class:`.Database`: Owning database of the cell. This property is read-only. """ @@ -306,7 +307,8 @@ def design_mode(self, value): @property def hfss_extent_info(self): - """:class:`HfssExtentInfo `: HFSS extents for the cell.""" + """:class:`.HfssExtentInfo`: \ + HFSS extents for the cell.""" msg = self.__stub.GetHfssExtentInfo(self.msg) return HfssExtentInfo(**parse_args(msg)) @@ -315,13 +317,14 @@ def set_hfss_extent_info(self, extents): Parameters ---------- - extents : :class: HfssExtentInfo + extents : :class:`.HfssExtentInfo` """ self.__stub.SetHfssExtentInfo(_QueryBuilder.set_hfss_extents(self, extents)) @property def temperature_settings(self): - """:class:`TemperatureSettings `: Temperature settings.""" + """:class:`.TemperatureSettings`: \ + Temperature settings.""" msg = self.__stub.GetTemperatureSettings(self.msg) return TemperatureSettings( msg.include_temp_dependence, msg.enable_thermal_feedback, Value(msg.temperature) @@ -338,11 +341,11 @@ def cutout(self, included_nets, clipped_nets, clipping_polygon, clean_clipping=T Parameters ---------- - included_nets : list[:class:`Net `] + included_nets : list[:class:`.Net`] Nets to keep after cutout. - clipped_nets : list[:class:`Net `] + clipped_nets : list[:class:`.Net`] Nets to kept and clip at the boundary after cutout. - clipping_polygon : :class:`PolygonData ` + clipping_polygon : :class:`.PolygonData` Clipping polygon. clean_clipping : bool, optional Whether to perform clean clipping. The default is ``True``. @@ -365,7 +368,7 @@ def get_product_property_ids(self, prod_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. Returns @@ -383,7 +386,7 @@ def get_product_property(self, prod_id, attr_id): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. attr_id : int User-defined ID that identifies the string value stored in the property. @@ -402,7 +405,7 @@ def set_product_property(self, prod_id, attr_id, prop_value): Parameters ---------- - prod_id : :class:`ProductIdType ` + prod_id : :class:`.ProductIdType` ID representing a product that supports the EDB. attr_id : int User-defined ID that identifies the string value stored in the property. @@ -425,8 +428,9 @@ def delete_simulation_setup(self, name): @property def simulation_setups(self): - """:obj:`list` of [:class:`SimulationSetup `]: List of \ - all simulation setups of the cell. + """:obj:`list` of \ + [:class:`.SimulationSetup`]: \ + List of all simulation setups of the cell. .. seealso:: :obj:`add_simulation_setup`, :obj:`delete_simulation_setup` """ @@ -453,7 +457,7 @@ def generate_via_smart_box(self, net_name): Returns ------- - list[:class:`PolygonData `] + list[:class:`.PolygonData`] List of boxes, one around each via discovered. """ self.__stub.GenerateViaSmartBox(messages.string_property_message(self, net_name)) diff --git a/src/ansys/edb/core/layout/layout.py b/src/ansys/edb/core/layout/layout.py index 4228ca4524..b6803d9f1f 100644 --- a/src/ansys/edb/core/layout/layout.py +++ b/src/ansys/edb/core/layout/layout.py @@ -4,16 +4,19 @@ from ansys.api.edb.v1.layout_pb2_grpc import LayoutServiceStub from ansys.edb.core.edb_defs import LayoutObjType -from ansys.edb.core.hierarchy import CellInstance, Group, PinGroup +from ansys.edb.core.hierarchy import cell_instance, group, pin_group from ansys.edb.core.inner import ObjBase, messages, parser, utils, variable_server -from ansys.edb.core.layer import LayerCollection -import ansys.edb.core.layout as layout +from ansys.edb.core.layer.layer_collection import LayerCollection +from ansys.edb.core.layout import voltage_regulator from ansys.edb.core.layout.mcad_model import McadModel -from ansys.edb.core.layout_instance import LayoutInstance -from ansys.edb.core.net import DifferentialPair, ExtendedNet, Net, NetClass -from ansys.edb.core.primitive import BoardBendDef, PadstackInstance, Primitive +from ansys.edb.core.layout_instance import layout_instance +from ansys.edb.core.net.differential_pair import DifferentialPair +from ansys.edb.core.net.extended_net import ExtendedNet +from ansys.edb.core.net.net import Net +from ansys.edb.core.net.net_class import NetClass +from ansys.edb.core.primitive.primitive import BoardBendDef, PadstackInstance, Primitive from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.terminal import Terminal +from ansys.edb.core.terminal.terminals import Terminal class Layout(ObjBase, variable_server.VariableServer): @@ -33,7 +36,7 @@ def __init__(self, msg): @property def cell(self): - """:class:`Cell `: Owning cell for the layout. + """:class:`.Cell`: Owning cell for the layout. This property is read-only. """ @@ -43,7 +46,8 @@ def cell(self): @property def layer_collection(self): - """:class:`LayerCollection `: Layer collection of the layout.""" + """:class:`.LayerCollection`: \ + Layer collection of the layout.""" return LayerCollection(self.__stub.GetLayerCollection(self.msg)) @layer_collection.setter @@ -64,7 +68,7 @@ def _get_items(self, obj_type, lyt_obj_type_enum, do_cast=False): @property def primitives(self): - """:obj:`list` of :class:`Primitive `: List of all \ + """:obj:`list` of :class:`.Primitive`: List of all \ primitives in the layout. This property is read-only. @@ -73,7 +77,7 @@ def primitives(self): @property def padstack_instances(self): - """:obj:`list` of :class:`PadstackInstance `: List of \ + """:obj:`list` of :class:`.PadstackInstance`: List of \ all padstack instances in the layout. This property is read-only. @@ -82,7 +86,7 @@ def padstack_instances(self): @property def terminals(self): - """:obj:`list` of :class:`Terminal `: \ + """:obj:`list` of :class:`.Terminal`: \ List of all terminals in the layout. This property is read-only. @@ -91,16 +95,16 @@ def terminals(self): @property def cell_instances(self): - """:obj:`list` of :class:`CellInstance `: \ + """:obj:`list` of :class:`CellInstances <.CellInstance>`: \ List of all cell instances in the layout. This property is read-only. """ - return self._get_items(CellInstance, LayoutObjType.CELL_INSTANCE) + return self._get_items(cell_instance.CellInstance, LayoutObjType.CELL_INSTANCE) @property def nets(self): - """:obj:`list` of :class:`Net `: List of all nets \ + """:obj:`list` of :class:`.Net`: List of all nets \ in the layout. This property is read-only. @@ -109,16 +113,16 @@ def nets(self): @property def groups(self): - """:obj:`list` of :class:`Group `: List of all groups \ + """:obj:`list` of :class:`.Group`: List of all groups \ in the layout. This property is read-only. """ - return self._get_items(Group, LayoutObjType.GROUP, True) + return self._get_items(group.Group, LayoutObjType.GROUP, True) @property def net_classes(self): - """:obj:`list` of :class:`NetClass `: List of all \ + """:obj:`list` of :class:`.NetClass`: List of all \ net classes in the layout. This property is read-only. @@ -127,7 +131,7 @@ def net_classes(self): @property def differential_pairs(self): - """:obj:`list` of :class:`DifferentialPair `: \ + """:obj:`list` of :class:`.DifferentialPair`: \ List of all differential pairs in the layout. This property is read-only. @@ -136,25 +140,25 @@ def differential_pairs(self): @property def pin_groups(self): - """:obj:`list` of :class:`PinGroup ` : List of all \ + """:obj:`list` of :class:`.PinGroup` : List of all \ pin groups in the layout. This property is read-only. """ - return self._get_items(PinGroup, LayoutObjType.PIN_GROUP) + return self._get_items(pin_group.PinGroup, LayoutObjType.PIN_GROUP) @property def voltage_regulators(self): - """:obj:`list` of :class:`VoltageRegulator `: \ + """:obj:`list` of :class:`.VoltageRegulator`: \ List of all voltage regulators in the layout. This property is read-only. """ - return self._get_items(layout.VoltageRegulator, LayoutObjType.VOLTAGE_REGULATOR) + return self._get_items(voltage_regulator.VoltageRegulator, LayoutObjType.VOLTAGE_REGULATOR) @property def extended_nets(self): - """:obj:`list` of :class:`ExtendedNet `: \ + """:obj:`list` of :class:`.ExtendedNet`: \ List of all extended nets in the layout. This property is read-only. @@ -169,9 +173,9 @@ def expanded_extent( Parameters ---------- - nets : list[:class:`Net `] + nets : list[:class:`.Net`] List of nets. - extent : :class:`ExtentType ` + extent : :class:`.ExtentType` Geometry extent type for expansion. expansion_factor : float Expansion factor for the polygon union. No expansion occurs if the value @@ -189,7 +193,7 @@ def expanded_extent( Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Notes ----- @@ -213,7 +217,7 @@ def convert_primitives_to_vias(self, primitives, is_pins=False): Parameters ---------- - primitives : list[:class:`Primitive `] + primitives : list[:class:`.Primitive`] List of primitives. is_pins : bool, default: False Whether the list consists of pins. The default is ``False``, in which @@ -236,7 +240,7 @@ def port_reference_terminals_connected(self): @property def zone_primitives(self): - """:obj:`list` of :class:`Primitive `: List of \ + """:obj:`list` of :class:`.Primitive`: List of \ all primitives in the :term:`zones `. This property is read-only. @@ -245,7 +249,7 @@ def zone_primitives(self): @property def fixed_zone_primitive(self): - """:class:`Primitive `: Fixed :term:`zones ` primitive.""" + """:class:`.Primitive`: Fixed :term:`zones ` primitive.""" msg = self.__stub.GetFixedZonePrimitive(self.msg) return None if msg is None else Primitive(msg).cast() @@ -255,7 +259,7 @@ def fixed_zone_primitive(self, value): @property def board_bend_defs(self): - """:obj:`list` of :class:`BoardBendDef `: List of all \ + """:obj:`list` of :class:`.BoardBendDef`: List of all \ board bend definitions in the layout. This property is read-only. @@ -268,11 +272,12 @@ def synchronize_bend_manager(self): @property def layout_instance(self): - """:class:`LayoutInstance `: Instance of the layout. + """:class:`.LayoutInstance`: \ + Instance of the layout. This property is read-only. """ - return LayoutInstance(self.__stub.GetLayoutInstance(self.msg)) + return layout_instance.LayoutInstance(self.__stub.GetLayoutInstance(self.msg)) def create_stride(self, filename): """Create a Stride model from an MCAD file. diff --git a/src/ansys/edb/core/layout/mcad_model.py b/src/ansys/edb/core/layout/mcad_model.py index 37c79c3211..d3c24f36cc 100644 --- a/src/ansys/edb/core/layout/mcad_model.py +++ b/src/ansys/edb/core/layout/mcad_model.py @@ -1,6 +1,5 @@ """MCAD model.""" -from ansys.edb.core import hierarchy from ansys.edb.core.inner import ObjBase, messages, parser from ansys.edb.core.session import McadModelServiceStub, StubAccessor, StubType @@ -15,7 +14,7 @@ def create_stride(cls, connectable=None, layout=None, filename=None): """Create a Stride model. This method makes a call directly on a :term:`Connectable` or - :func:`Layout`. + :func:`Layout `. """ return cls( cls.__stub.CreateStride( @@ -28,7 +27,7 @@ def create_hfss(cls, connectable=None, layout=None, filename=None, design=None): """Create an HFSS model. This method makes a call directly on a :term:`Connectable` or - :func:`Layout`. + :func:`Layout `. """ return cls( cls.__stub.CreateHfss( @@ -41,7 +40,7 @@ def create_3d_comp(cls, connectable=None, layout=None, filename=None): """Create a 3D component model. This method makes a call directly on a :term:`Connectable` or - :func:`Layout`. + :func:`Layout `. """ return cls( cls.__stub.Create3dComp( @@ -83,12 +82,14 @@ def is_mcad_3d_comp(cls, connectable): @property def cell_instance(self): - """:class:`CellInstance `: Cell instance \ + """:class:`.CellInstance`: Cell instance \ of the MCAD model. This property is read-only. """ - return hierarchy.CellInstance(self.__stub.GetCellInst(messages.edb_obj_message(self))) + from ansys.edb.core.hierarchy import cell_instance + + return cell_instance.CellInstance(self.__stub.GetCellInst(messages.edb_obj_message(self))) @property def model_name(self): @@ -108,7 +109,8 @@ def design_name(self): @property def origin(self): - """:class:`Point3DData `: Origin 3D point of the MCAD model.""" + """:class:`.Point3DData`: \ + Origin 3D point of the MCAD model.""" return self.__stub.GetOrigin(messages.edb_obj_message(self)) @origin.setter @@ -117,7 +119,7 @@ def origin(self, pnt): @property def rotation(self): - r""":obj:`tuple`\[:class:`Point3DData `, :class:`Point3DData `, :obj:`float`\]: Rotation from/to the axis and the angle.""" # noqa + r""":obj:`tuple`\[:class:`.Point3DData`, :class:`.Point3DData`, :obj:`float`\]: Rotation from/to the axis and the angle.""" # noqa msg = self.__stub.GetRotation(messages.edb_obj_message(self)) return ( parser.to_point3d_data(msg.axis_from), @@ -134,8 +136,8 @@ def set_rotation(self, axis_from, axis_to, angle): Parameters ---------- - axis_from : :class:`Point3DData ` - axis_to : :class:`Point3DData ` + axis_from : :class:`.Point3DData` + axis_to : :class:`.Point3DData` angle : float Angle in radians. """ diff --git a/src/ansys/edb/core/layout/voltage_regulator.py b/src/ansys/edb/core/layout/voltage_regulator.py index b9a587c417..1d1bf34322 100644 --- a/src/ansys/edb/core/layout/voltage_regulator.py +++ b/src/ansys/edb/core/layout/voltage_regulator.py @@ -3,9 +3,9 @@ from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import conn_obj, messages -from ansys.edb.core.primitive import PadstackInstance +from ansys.edb.core.primitive.primitive import PadstackInstance from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value class PowerModule: @@ -19,7 +19,7 @@ class PowerModule: Name of the positive output terminal. neg_output_terminal : str Name of the negative output terminal - relative_strength : :class:`Value ` + relative_strength : :class:`.Value` Relative strength as a percentage value. active : bool Whether the power module is active. @@ -70,7 +70,7 @@ def neg_output_terminal(self, neg_output_terminal): @property def relative_strength(self): - """:class:`Value `: Relative strength for the power module as a percentage. + """:class:`.Value`: Relative strength for the power module as a percentage. This property can be set with :term:`ValueLike`. """ @@ -129,7 +129,7 @@ def create(cls, layout, name, active, voltage, lrc, lrp): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the voltage regulator in. name : str Name of the voltage regulator. @@ -180,7 +180,7 @@ def active(self, newactive): @property def voltage(self): - """:class:`Value `: Voltage of the voltage regulator. + """:class:`.Value`: Voltage of the voltage regulator. This property can be set with :term:`ValueLike`. """ @@ -194,7 +194,7 @@ def voltage(self, newvoltage): @property def lrc(self): - """:class:`Value `: Load regulation current of the voltage regulator. + """:class:`.Value`: Load regulation current of the voltage regulator. This property can be set with :term:`ValueLike`. """ @@ -208,7 +208,7 @@ def lrc(self, newlrc): @property def lrp(self): - """:class:`Value `: Load regulation percent of the voltage regulator. + """:class:`.Value`: Load regulation percent of the voltage regulator. This property can be set with :term:`ValueLike`. """ @@ -222,8 +222,8 @@ def lrp(self, newlrp): @property def pos_remote_sense_pin(self): - """:class:`PadstackInstance `: Positive remote sense pin of the \ - voltage regulator. + """:class:`.PadstackInstance`: \ + Positive remote sense pin of the voltage regulator. .. seealso:: :obj:`neg_remote_sense_pin` """ @@ -235,8 +235,8 @@ def pos_remote_sense_pin(self, newpin): @property def neg_remote_sense_pin(self): - """:class:`PadstackInstance `: Negative remote sense pin of the \ - voltage regulator. + """:class:`.PadstackInstance`: \ + Negative remote sense pin of the voltage regulator. .. seealso:: :obj:`pos_remote_sense_pin` """ diff --git a/src/ansys/edb/core/layout_instance/__init__.py b/src/ansys/edb/core/layout_instance/__init__.py index 2305ce4f8d..c13dcbfe61 100644 --- a/src/ansys/edb/core/layout_instance/__init__.py +++ b/src/ansys/edb/core/layout_instance/__init__.py @@ -1,12 +1 @@ """Import layout instance classes.""" - -from ansys.edb.core.layout_instance.layout_instance import LayoutInstance -from ansys.edb.core.layout_instance.layout_instance_context import LayoutInstanceContext -from ansys.edb.core.layout_instance.layout_obj_instance import LayoutObjInstance -from ansys.edb.core.layout_instance.layout_obj_instance_2d_geometry import ( - LayoutObjInstance2DGeometry, -) -from ansys.edb.core.layout_instance.layout_obj_instance_3d_geometry import ( - LayoutObjInstance3DGeometry, -) -from ansys.edb.core.layout_instance.layout_obj_instance_geometry import LayoutObjInstanceGeometry diff --git a/src/ansys/edb/core/layout_instance/layout_instance.py b/src/ansys/edb/core/layout_instance/layout_instance.py index 610fc8c154..c77bd15b01 100644 --- a/src/ansys/edb/core/layout_instance/layout_instance.py +++ b/src/ansys/edb/core/layout_instance/layout_instance.py @@ -1,7 +1,7 @@ """Layout instance.""" import ansys.api.edb.v1.layout_instance_pb2 as layout_instance_pb2 -from ansys.edb.core.geometry import PointData +from ansys.edb.core.geometry.point_data import PointData from ansys.edb.core.inner import ObjBase, utils from ansys.edb.core.inner.messages import ( layer_ref_message, @@ -10,7 +10,7 @@ polygon_data_message, strings_message, ) -from ansys.edb.core.layout_instance.layout_obj_instance import LayoutObjInstance +from ansys.edb.core.layout_instance import layout_obj_instance from ansys.edb.core.session import LayoutInstanceServiceStub, StubAccessor, StubType @@ -28,18 +28,18 @@ def query_layout_obj_instances(self, layer_filter=None, net_filter=None, spatial Parameters ---------- - layer_filter : list[:class:`Layer ` or str or None], default: None + layer_filter : list[:class:`.Layer` or str or None], default: None Layers to query. The default is ``None``, in which case all layers are queried. - net_filter : list[:class:`Net ` or str or None], default: None + net_filter : list[:class:`.Net` or str or None], default: None Nets to query. The default is ``None``, in which case all nets are queried. - spatial_filter : :class:`PolygonData ` or - :class:`PointData ` or ``None``, default: None + spatial_filter : :class:`.PolygonData` or + :class:`.PointData` or ``None``, default: None Area of the design to query. The default is ``None``, in which case the entire spatial domain of the design is queried. Returns ------- - list[LayoutObjInstance] or tuple[list[LayoutObjInstance], list[LayoutObjInstance]] + list[:class:`.LayoutObjInstance`] or tuple[list[:class:`.LayoutObjInstance`], list[:class:`.LayoutObjInstance`]] If a polygonal spatial filter is specified, a tuple of lists of hits is returned in this format: ``[, ]``. Otherwise, a list containing all hits is returned. @@ -71,11 +71,13 @@ def to_msg_filter_list(client_filter, ref_msg_type): if hits.HasField("full_partial_hits"): full_partial_hits = hits.full_partial_hits - return utils.map_list(full_partial_hits.full.items, LayoutObjInstance), utils.map_list( - full_partial_hits.partial.items, LayoutObjInstance + return utils.map_list( + full_partial_hits.full.items, layout_obj_instance.LayoutObjInstance + ), utils.map_list( + full_partial_hits.partial.items, layout_obj_instance.LayoutObjInstance ) else: - return utils.map_list(hits.hits.items, LayoutObjInstance) + return utils.map_list(hits.hits.items, layout_obj_instance.LayoutObjInstance) def get_layout_obj_instance_in_context(self, layout_obj, context): """Get the layout object instance of the given :term:`connectable ` in the provided context. @@ -85,16 +87,16 @@ def get_layout_obj_instance_in_context(self, layout_obj, context): layout_obj : :term:`Connectable ` Layout object with the instances to search. context : list[str] - List of strings specifying the :class:`context ` that the / + List of strings specifying the :class:`context <.LayoutInstanceContext>` that the / layout object instance is retrieved from. - .. seealso:: :func:`LayoutObjInstance.context` + .. seealso:: :func:`context ` Returns ------- - LayoutObjInstance + :class:`.LayoutObjInstance` """ - return LayoutObjInstance( + return layout_obj_instance.LayoutObjInstance( self.__stub.GetLayoutObjInstanceInContext( layout_instance_pb2.GetLayoutObjInstanceInContextMessage( layout_inst=self.msg, @@ -109,17 +111,17 @@ def get_connected_objects(self, origin_layout_obj_inst, touching_only): Parameters ---------- - origin_layout_obj_inst : LayoutObjInstance + origin_layout_obj_inst : :class:`.LayoutObjInstance` Layout object instance that is to act as the origin to get connected objects from. touching_only : bool Whether to get only layout object instances touching the orgigin layout object instance - on the placement layer of the origin layout object. If ``False``` all layout object + on the placement layer of the origin layout object. If ``False`` all layout object instances across all layers that are electrically connected to the origin layout object instance are returned. Returns ------- - list[LayoutObjInstance] + list[:class:`.LayoutObjInstance`] List of layout object instances connected to the origin layout object instance. """ hits = self.__stub.GetConnectedObjects( @@ -129,4 +131,4 @@ def get_connected_objects(self, origin_layout_obj_inst, touching_only): touching_only=touching_only, ) ) - return utils.map_list(hits.items, LayoutObjInstance) + return utils.map_list(hits.items, layout_obj_instance.LayoutObjInstance) diff --git a/src/ansys/edb/core/layout_instance/layout_instance_context.py b/src/ansys/edb/core/layout_instance/layout_instance_context.py index 053ee18443..4ca8c641a3 100644 --- a/src/ansys/edb/core/layout_instance/layout_instance_context.py +++ b/src/ansys/edb/core/layout_instance/layout_instance_context.py @@ -2,7 +2,7 @@ from ansys.edb.core.inner import ObjBase, parser from ansys.edb.core.inner.messages import bool_property_message -import ansys.edb.core.layout as layout +from ansys.edb.core.layout import layout from ansys.edb.core.session import LayoutInstanceContextServiceStub, StubAccessor, StubType @@ -13,7 +13,7 @@ class LayoutInstanceContext(ObjBase): @property def layout(self): - """:class:`Layout `: Layout of the context. + """:class:`.Layout`: Layout of the context. This property is read-only. """ @@ -31,7 +31,7 @@ def get_bbox(self, local): Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Bounding box of the context. """ return self.__stub.GetBBox(bool_property_message(self, local)) diff --git a/src/ansys/edb/core/layout_instance/layout_obj_instance.py b/src/ansys/edb/core/layout_instance/layout_obj_instance.py index 0c06659a6b..7faa85fbcd 100644 --- a/src/ansys/edb/core/layout_instance/layout_obj_instance.py +++ b/src/ansys/edb/core/layout_instance/layout_obj_instance.py @@ -1,10 +1,9 @@ """Layout object instance.""" -from ansys.edb.core.inner import ObjBase, parser, utils -from ansys.edb.core.inner.factory import create_conn_obj +from ansys.edb.core.inner import ObjBase, factory, parser, utils from ansys.edb.core.inner.messages import bool_property_message, layer_ref_property_message -from ansys.edb.core.layer import Layer -from ansys.edb.core.layout_instance.layout_instance_context import LayoutInstanceContext +from ansys.edb.core.layer.layer import Layer +from ansys.edb.core.layout_instance import layout_instance_context from ansys.edb.core.layout_instance.layout_obj_instance_2d_geometry import ( LayoutObjInstance2DGeometry, ) @@ -33,7 +32,7 @@ class LayoutObjInstance(ObjBase): @property def layers(self): - """:obj:`list` of :class:`ansys.edb.core.layer.Layer`: All layer instances. + """:obj:`list` of :class:`.Layer`: All layer instances. This list contains the layer` instances that the layout object instance has geometry on. """ @@ -44,7 +43,7 @@ def get_geometries(self, layer): Parameters ---------- - layer : :class:`Layer ` or str + layer : :class:`.Layer` or str Layer. Returns @@ -58,8 +57,8 @@ def get_geometries(self, layer): def context(self): r""":obj:`list`\[:obj:`str`\]: All strings representing the context of the layout object instance. - This list of strings is a list of :class:`cell instance ` names - representing the hierarchy level this layout obj instance's :class:`context ` + This list of strings is a list of :class:`.CellInstance` + names representing the hierarchy level this layout obj instance's :class:`context <.LayoutInstanceContext>` resides on. The first entry represents the top-level context and the last entry represents the context that the layout object instance exists in. @@ -73,7 +72,9 @@ def layout_instance_context(self): This property is read-only. """ - return LayoutInstanceContext(self.__stub.GetLayoutInstanceContext(self.msg)) + return layout_instance_context.LayoutInstanceContext( + self.__stub.GetLayoutInstanceContext(self.msg) + ) @property def layout_obj(self): @@ -82,7 +83,7 @@ def layout_obj(self): This property is read-only. """ - return create_conn_obj(self.__stub.GetLayoutObj(self.msg)) + return factory.create_conn_obj(self.__stub.GetLayoutObj(self.msg)) @parser.to_polygon_data def get_bbox(self, local=False): @@ -91,12 +92,12 @@ def get_bbox(self, local=False): Parameters ---------- local : bool - Whether to return the bounding box in the local :class:`context `. + Whether to return the bounding box in the local :class:`context <.LayoutInstanceContext>`. If ``False``, the bounding box is returned in the global context. Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Bounding box of the layout object instance. """ return self.__stub.GetBBox(bool_property_message(self, local)) diff --git a/src/ansys/edb/core/layout_instance/layout_obj_instance_2d_geometry.py b/src/ansys/edb/core/layout_instance/layout_obj_instance_2d_geometry.py index fec89d83a9..a992a7ac7c 100644 --- a/src/ansys/edb/core/layout_instance/layout_obj_instance_2d_geometry.py +++ b/src/ansys/edb/core/layout_instance/layout_obj_instance_2d_geometry.py @@ -28,7 +28,7 @@ def get_polygon_data(self, apply_negatives=False): Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` """ return self.__stub.GetPolygonData( GetPolygonDataMessage(layout_obj_inst_geom=self.msg, apply_neg=apply_negatives) diff --git a/src/ansys/edb/core/layout_instance/layout_obj_instance_3d_geometry.py b/src/ansys/edb/core/layout_instance/layout_obj_instance_3d_geometry.py index 0943ecea07..6053c8b560 100644 --- a/src/ansys/edb/core/layout_instance/layout_obj_instance_3d_geometry.py +++ b/src/ansys/edb/core/layout_instance/layout_obj_instance_3d_geometry.py @@ -1,6 +1,6 @@ """Layout object instance 3D geometry.""" -from ansys.edb.core.geometry import Triangle3DData +from ansys.edb.core.geometry.triangle3d_data import Triangle3DData from ansys.edb.core.inner import utils from ansys.edb.core.inner.parser import to_point3d_data from ansys.edb.core.layout_instance.layout_obj_instance_geometry import LayoutObjInstanceGeometry @@ -16,7 +16,7 @@ class LayoutObjInstance3DGeometry(LayoutObjInstanceGeometry): @property def tesselation_data(self): - """:obj:`list` of :class:`ansys.edb.core.geometry.Triangle3DData`: All triangle 3D data instances. + """:obj:`list` of :class:`.Triangle3DData`: All triangle 3D data instances. This list contains triangle 3D data instances that correspond to the underlying tessellation data of the geometry. diff --git a/src/ansys/edb/core/net/__init__.py b/src/ansys/edb/core/net/__init__.py index c68bb6282b..e1beeb6be4 100644 --- a/src/ansys/edb/core/net/__init__.py +++ b/src/ansys/edb/core/net/__init__.py @@ -1,6 +1 @@ """Import net classes.""" - -from ansys.edb.core.net.differential_pair import DifferentialPair -from ansys.edb.core.net.extended_net import ExtendedNet -from ansys.edb.core.net.net import Net -from ansys.edb.core.net.net_class import NetClass diff --git a/src/ansys/edb/core/net/differential_pair.py b/src/ansys/edb/core/net/differential_pair.py index dd76ed4cc0..616a42654c 100644 --- a/src/ansys/edb/core/net/differential_pair.py +++ b/src/ansys/edb/core/net/differential_pair.py @@ -21,7 +21,7 @@ def create(cls, layout, name, pos_net=None, neg_net=None): Parameters ---------- - layout : :class:`Layout` + layout : :class:`.Layout` Layout to create the differential pair in. name : str Name of the new differential pair. @@ -47,7 +47,7 @@ def find_by_name(cls, layout, name): Parameters ---------- - layout : :class:`Layout` + layout : :class:`.Layout` Layout to search for the differential pair. name : str Name of the differential pair. @@ -55,14 +55,15 @@ def find_by_name(cls, layout, name): Returns ------- DifferentialPair - Differential pair that was found. Check the :obj:`is_null ` + Differential pair that was found. Check the :obj:`is_null + <.DifferentialPair.is_null>` property of the returned differential pair to see if it exists. """ return cls(cls.__stub.FindByName(messages.string_property_message(layout, name))) @property def differential_pair(self): - r""":obj:`tuple`\(:class:`Net`, :class:`Net`\): Nets (positive, negative) in the differential pair.""" + r""":obj:`tuple`\(:class:`.Net`, :class:`.Net`\): Nets (positive, negative) in the differential pair.""" msg = self.__stub.GetDifferentialPair(self.msg) return Net(msg.positive_net.id), Net(msg.negative_net.id) @@ -74,7 +75,7 @@ def differential_pair(self, value): @property def positive_net(self): - """:class:`Net`: Positive net in the differential pair.""" + """:class:`.Net`: Positive net in the differential pair.""" return self.differential_pair[0] @positive_net.setter @@ -85,7 +86,7 @@ def positive_net(self, value): @property def negative_net(self): - """:class:`Net`: Negative net in the differential pair.""" + """:class:`.Net`: Negative net in the differential pair.""" return self.differential_pair[1] @negative_net.setter @@ -106,7 +107,7 @@ def add_net(self, net): """Add a net. This method is invalid for a differential pair. Use - :obj:`ansys.edb.core.net.DifferentialPair.differential_pair` = (pos_net, neg_net) instead. + :obj:`ansys.edb.core.net.differential_pair.DifferentialPair` = (pos_net, neg_net) instead. """ raise TypeError("Net cannot be added to a differential pair.") @@ -121,6 +122,6 @@ def remove_net(self, net): def nets(self): """This property is invalid for a differential pair. - Use :obj:`ansys.edb.core.net.DifferentialPair.differential_pair` instead. + Use :obj:`ansys.edb.core.net.differential_pair.DifferentialPair` instead. """ return self.differential_pair diff --git a/src/ansys/edb/core/net/extended_net.py b/src/ansys/edb/core/net/extended_net.py index c8bc8c0fb4..c8b18f567a 100644 --- a/src/ansys/edb/core/net/extended_net.py +++ b/src/ansys/edb/core/net/extended_net.py @@ -33,7 +33,7 @@ def create(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the extended net in. name : str Name of the extended net. @@ -53,7 +53,7 @@ def find_by_name(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the extended net. name : str Name of the extended net. @@ -61,7 +61,7 @@ def find_by_name(cls, layout, name): Returns ------- ExtendedNet - Extended net that was found. Check the :obj:`is_null ` + Extended net that was found. Check the :obj:`is_null <.ExtendedNet.is_null>` property of the extended net to see if it exists. """ return ExtendedNet( diff --git a/src/ansys/edb/core/net/net.py b/src/ansys/edb/core/net/net.py index 721e2b3716..55f62bd9d1 100644 --- a/src/ansys/edb/core/net/net.py +++ b/src/ansys/edb/core/net/net.py @@ -4,9 +4,9 @@ from ansys.edb.core.inner import layout_obj, messages from ansys.edb.core.net.extended_net import ExtendedNet from ansys.edb.core.net.net_class import NetClass -from ansys.edb.core.primitive import PadstackInstance, Primitive +from ansys.edb.core.primitive.primitive import PadstackInstance, Primitive from ansys.edb.core.session import NetServiceStub, StubAccessor, StubType -from ansys.edb.core.terminal import Terminal, TerminalInstance +from ansys.edb.core.terminal.terminals import Terminal, TerminalInstance class Net(layout_obj.LayoutObj): @@ -28,7 +28,7 @@ def create(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the net in. name : str Name of the net. @@ -46,7 +46,7 @@ def find_by_name(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the net. name : str Name of net. @@ -54,7 +54,7 @@ def find_by_name(cls, layout, name): Returns ------- Net - Net found. Check the :obj:`is_null ` property + Net found. Check the :obj:`is_null <.Net.is_null>` property of the returned net to see if it exists. """ return Net(cls.__stub.FindByName(messages.string_property_message(layout, name))) @@ -70,7 +70,7 @@ def name(self, value): @property def is_power_ground(self): - """:class:`bool`: Flag indicating if the net belongs to a power/ground :class:`NetClass` instance. + """:class:`bool`: Flag indicating if the net belongs to a power/ground :class:`.NetClass` instance. This property is read-only. """ @@ -82,7 +82,7 @@ def is_power_ground(self, value): @property def primitives(self): - r""":obj:`list` of :class:`Primitive `: All primitives on the net. + r""":obj:`list` of :class:`.Primitive`: All primitives on the net. This property is read-only. """ @@ -90,24 +90,24 @@ def primitives(self): @property def padstack_instances(self): - """:obj:`list` of :class:`ansys.edb.core.primitive.PadstackInstance`: All padstack instances on the net \ + """:obj:`list` of :class:`.PadstackInstance`: All padstack instances on the net \ object instance.""" return [PadstackInstance(lo) for lo in self._layout_objs(LayoutObjType.PADSTACK_INSTANCE)] @property def terminals(self): - """:obj:`list` of :class:`ansys.edb.core.terminal.Terminal`: All terminal instances on the \ + """:obj:`list` of :class:`.Terminal`: All terminal instances on the \ net object instance.""" return [Terminal(lo).cast() for lo in self._layout_objs(LayoutObjType.TERMINAL)] @property def terminal_instances(self): - """:obj:`list` of :class:`ansys.edb.core.layer.Layer`: All terminal instances on the net object instance.""" + """:obj:`list` of :class:`.Layer`: All terminal instances on the net object instance.""" return [TerminalInstance(lo) for lo in self._layout_objs(LayoutObjType.TERMINAL_INSTANCE)] @property def net_classes(self): - r""":obj:`list` of :class:`NetClass`: All net classes on the net. + r""":obj:`list` of :class:`.NetClass`: All net classes on the net. This property is read-only. """ @@ -115,7 +115,7 @@ def net_classes(self): @property def extended_net(self): - """:class:`ExtendedNet` or :class:`None`: Extended net that the net belongs to. + """:class:`.ExtendedNet` or :class:`None`: Extended net that the net belongs to. :class:`None` means that the net does not belong to an extended net. diff --git a/src/ansys/edb/core/net/net_class.py b/src/ansys/edb/core/net/net_class.py index 13f062d3db..22a238c48b 100644 --- a/src/ansys/edb/core/net/net_class.py +++ b/src/ansys/edb/core/net/net_class.py @@ -26,7 +26,7 @@ def create(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the net class in. name : str Name of the net. @@ -45,7 +45,7 @@ def find_by_name(cls, layout, name): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to search for the net class. name : str Name of the net class. @@ -53,7 +53,7 @@ def find_by_name(cls, layout, name): Returns ------- NetClass - Net class found. Check the :obj:`is_null ` property + Net class found. Check the :obj:`is_null ` property of the returned net class to see if it exists. """ return NetClass(cls.__stub.FindByName(messages.edb_obj_name_message(layout, name))) @@ -87,7 +87,7 @@ def is_power_ground(self): @property def nets(self): - """:obj:`list` of :class:`Net `: List of nets in the net class. + """:obj:`list` of :class:`.Net`: List of nets in the net class. This property is read-only. """ diff --git a/src/ansys/edb/core/primitive/__init__.py b/src/ansys/edb/core/primitive/__init__.py index 12b745ad9a..e1beeb6be4 100644 --- a/src/ansys/edb/core/primitive/__init__.py +++ b/src/ansys/edb/core/primitive/__init__.py @@ -1,20 +1 @@ """Import net classes.""" - -from ansys.edb.core.primitive.primitive import ( - BackDrillType, - BoardBendDef, - Bondwire, - BondwireCrossSectionType, - BondwireType, - Circle, - PadstackInstance, - Path, - PathCornerType, - PathEndCapType, - Polygon, - Primitive, - PrimitiveType, - Rectangle, - RectangleRepresentationType, - Text, -) diff --git a/src/ansys/edb/core/primitive/primitive.py b/src/ansys/edb/core/primitive/primitive.py index b207f6a07e..129f9e979c 100644 --- a/src/ansys/edb/core/primitive/primitive.py +++ b/src/ansys/edb/core/primitive/primitive.py @@ -23,14 +23,13 @@ text_pb2_grpc, ) -from ansys.edb.core import hierarchy, terminal from ansys.edb.core.definition.padstack_def import PadstackDef from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import conn_obj, messages, parser -from ansys.edb.core.layer import Layer +from ansys.edb.core.layer.layer import Layer from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import Value from ansys.edb.core.utility.layer_map import LayerMap +from ansys.edb.core.utility.value import Value class _PrimitiveQueryBuilder: @@ -188,7 +187,7 @@ def set_hfss_prop(self, material, solve_inside): @property def layer(self): - """:class:`Layer `: Layer that the primitive object is on.""" + """:class:`.Layer`: Layer that the primitive object is on.""" layer_msg = self.__stub.GetLayer(self.msg) return Layer(layer_msg).cast() @@ -220,7 +219,7 @@ def has_voids(self): @property def voids(self): - """:obj:`list` of :class:`Primitive `: List of void\ + """:obj:`list` of :class:`.Primitive`: List of void\ primitive objects inside the primitive. This property is read-only. @@ -229,7 +228,7 @@ def voids(self): @property def owner(self): - """:class:`Primitive `: Owner of the primitive object. + """:class:`.Primitive`: Owner of the primitive object. This property is read-only. """ @@ -301,25 +300,25 @@ def create( Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the rectangle in. - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` Layer the rectangle is to created on. - net : str or :class:`Net ` or None + net : str or :class:`.Net` or None Net the rectangle is to have. rep_type : :class:`RectangleRepresentationType` Type that defines the meaning of the given parameters. - param1 : :class:`Value ` + param1 : :class:`.Value` X value of the lower-left point or center point. - param2 : :class:`Value ` + param2 : :class:`.Value` Y value of the lower-left point or center point. - param3 : :class:`Value ` + param3 : :class:`.Value` X value of the upper-right point or width. - param4 : :class:`Value ` + param4 : :class:`.Value` Y value of the upper-right point or height. - corner_rad : :class:`Value ` + corner_rad : :class:`.Value` Corner radius. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation. Returns @@ -351,12 +350,12 @@ def get_parameters(self): ------- tuple[ :class:`RectangleRepresentationType`, - :class:`Value `, - :class:`Value `, - :class:`Value `, - :class:`Value `, - :class:`Value `, - :class:`Value ` + :class:`.Value`, + :class:`.Value`, + :class:`.Value`, + :class:`.Value`, + :class:`.Value`, + :class:`.Value` ] Returns a tuple in this format: @@ -395,17 +394,17 @@ def set_parameters(self, rep_type, param1, param2, param3, param4, corner_rad, r ---------- rep_type : :class:`RectangleRepresentationType` Type that defines the meaning of the given parameters. - param1 : :class:`Value ` + param1 : :class:`.Value` X value of the lower-left point or center point. - param2 : :class:`Value ` + param2 : :class:`.Value` Y value of the lower-left point or center point. - param3 : :class:`Value ` + param3 : :class:`.Value` X value of the upper-right point or width. - param4 : :class:`Value ` + param4 : :class:`.Value` Y value of the upper-right point or height. - corner_rad : :class:`Value ` + corner_rad : :class:`.Value` Corner radius. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation. """ self.__stub.SetParameters( @@ -433,7 +432,8 @@ def can_be_zone_primitive(self): @property def polygon_data(self): - """:class:`PolygonData `: Polygon data object of the rectangle. + """:class:`.PolygonData`: \ + Polygon data object of the rectangle. This property is read-only. """ @@ -458,24 +458,24 @@ def render( ---------- rep_type : :class:`RectangleRepresentationType` Type that defines the meaning of the given parameters. - x_lower_left_or_center_x : :class:`Value ` + x_lower_left_or_center_x : :class:`.Value` X value of the lower-left point or center point. - y_lower_left_or_center_y : :class:`Value ` + y_lower_left_or_center_y : :class:`.Value` Y value of the lower-left point or center point. - x_upper_right_or_width : :class:`Value ` + x_upper_right_or_width : :class:`.Value` X value of the upper-right point or width. - y_upper_right_or_height : :class:`Value ` + y_upper_right_or_height : :class:`.Value` Y value of the upper-right point or height. - corner_radius : :class:`Value ` + corner_radius : :class:`.Value` Corner radius. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation. is_hole : bool, default: False Whether the rectangle is hole. Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Polygon data object created. """ if rep_type == RectangleRepresentationType.LOWER_LEFT_UPPER_RIGHT: @@ -522,17 +522,17 @@ def create(cls, layout, layer, net, center_x, center_y, radius): Parameters ---------- - layout: :class:`Layout ` + layout : :class:`.Layout` Layout to create this circle in. - layer: str or :class:`Layer ` + layer : str or :class:`.Layer` Layer to place the circle on. - net: str or :class:`Net ` or None + net : str or :class:`.Net` or None Net of the circle. - center_x: :class:`Value ` + center_x : :class:`.Value` X value of the center point. - center_y: :class:`Value ` + center_y : :class:`.Value` Y value of the center point. - radius: :class:`Value ` + radius : :class:`.Value` Radius value of the circle. Returns @@ -560,18 +560,18 @@ def render(cls, center_x, center_y, radius, is_hole): Parameters ---------- - center_x: :class:`Value ` + center_x : :class:`.Value` X value of the center point. - center_y: :class:`Value ` + center_y : :class:`.Value` Y value of the center point. - radius: :class:`Value ` + radius : :class:`.Value` Radius value of the circle. is_hole: bool Whether the circle object is a hole. Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Circle created. """ return cls.__stub.Render( @@ -589,9 +589,9 @@ def get_parameters(self): Returns ------- tuple[ - :class:`Value `, - :class:`Value `, - :class:`Value ` + :class:`.Value`, + :class:`.Value`, + :class:`.Value` ] Returns a tuple in this format: @@ -616,11 +616,11 @@ def set_parameters(self, center_x, center_y, radius): Parameters ---------- - center_x: :class:`Value ` + center_x : :class:`.Value` X value of the center point. - center_y: :class:`Value ` + center_y : :class:`.Value` Y value of the center point. - radius: :class:`Value ` + radius : :class:`.Value` Radius value of the circle. """ self.__stub.SetParameters( @@ -635,7 +635,8 @@ def set_parameters(self, center_x, center_y, radius): ) def get_polygon_data(self): - """:class:`PolygonData `: Polygon data object of the circle.""" + """:class:`.PolygonData`: \ + Polygon data object of the circle.""" return Circle.render(*self.get_parameters(), self.is_void) def can_be_zone_primitive(self): @@ -654,13 +655,13 @@ def create(cls, layout, layer, center_x, center_y, text): Parameters ---------- - layout: :class:`Layout ` + layout : :class:`.Layout` Layout to create the text object in. - layer: str or Layer + layer : str or Layer Layer to place the text object on. - center_x: :class:`Value ` + center_x : :class:`.Value` X value of the center point. - center_y: :class:`Value ` + center_y : :class:`.Value` Y value of the center point. text: str Text string. @@ -688,8 +689,8 @@ def get_text_data(self): Returns ------- tuple[ - :class:`Value `, - :class:`Value `, + :class:`.Value`, + :class:`.Value`, str ] Returns a tuple in this format: @@ -714,11 +715,11 @@ def set_text_data(self, center_x, center_y, text): Parameters ---------- - center_x: :class:`Value ` + center_x : :class:`.Value` X value of the center point. - center_y: :class:`Value ` + center_y : :class:`.Value` Y value of the center point. - text: str + text : str String value for the text object. """ self.__stub.SetTextData( @@ -755,13 +756,13 @@ def create(cls, layout, layer, net, polygon_data): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the polygon in. - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` Layer to place the polygon on. - net : str or :class:`Net ` or None + net : str or :class:`.Net` or None Net of the polygon. - polygon_data : :class:`PolygonData ` + polygon_data : :class:`.PolygonData` Outer contour of the polygon. Returns @@ -776,7 +777,7 @@ def create(cls, layout, layer, net, polygon_data): @property @parser.to_polygon_data def polygon_data(self): - """:class:`PolygonData `: Outer contour of the polygon.""" + """:class:`.PolygonData`: Outer contour of the polygon.""" return self.__stub.GetPolygonData(self.msg) @polygon_data.setter @@ -822,21 +823,21 @@ def create(cls, layout, layer, net, width, end_cap1, end_cap2, corner_style, poi Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the path in. - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` Layer to place the path on. - net : str or :class:`Net ` or None + net : str or :class:`.Net` or None Net of the path. - width: :class:`Value ` + width : :class:`.Value` Path width. - end_cap1: :class:`PathEndCapType` + end_cap1: :class:`.PathEndCapType` End cap style for the start of the path. - end_cap2: :class:`PathEndCapType` + end_cap2: :class:`.PathEndCapType` End cap style for the end of the path. - corner_style: :class:`PathCornerType` + corner_style : :class:`.PathCornerType` Corner style. - points : :class:`PolygonData ` + points : :class:`.PolygonData` Centerline polygon data to set. Returns @@ -859,20 +860,20 @@ def render(cls, width, end_cap1, end_cap2, corner_style, path): Parameters ---------- - width: :class:`Value ` + width : :class:`.Value` Path width. - end_cap1: :class:`PathEndCapType` + end_cap1 : :class:`.PathEndCapType` End cap style for the start of the path. - end_cap2: :class:`PathEndCapType` + end_cap2 : :class:`.PathEndCapType` End cap style for the end of the path. - corner_style: :class:`PathCornerType` + corner_style : :class:`PathCornerType` Corner style. - path: :class:`PolygonData ` + path : :class:`.PolygonData` Polygon data to set. Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Path rendered. """ return cls.__stub.Render( @@ -888,13 +889,13 @@ def render(cls, width, end_cap1, end_cap2, corner_style, path): @property @parser.to_polygon_data def polygon_data(self): - """:class:`PolygonData `: Polygon data of this Path.""" + """:class:`.PolygonData`: Polygon data of this Path.""" return self.__stub.GetPolygonData(self.msg) @property @parser.to_polygon_data def center_line(self): - """:class:`PolygonData `: Center line for the path.""" + """:class:`.PolygonData`: Center line for the path.""" return self.__stub.GetCenterLine(self.msg) @center_line.setter @@ -909,8 +910,8 @@ def get_end_cap_style(self): Returns ------- tuple[ - :class:`PathEndCapType`, - :class:`PathEndCapType` + :class:`.PathEndCapType`, + :class:`.PathEndCapType` ] Returns a tuple in this format: @@ -929,9 +930,9 @@ def set_end_cap_style(self, end_cap1, end_cap2): Parameters ---------- - end_cap1: :class:`PathEndCapType` + end_cap1: :class:`.PathEndCapType` End cap style for the start of the path. - end_cap2: :class:`PathEndCapType` + end_cap2: :class:`.PathEndCapType` End cap style for the end of the path. """ self.__stub.SetEndCapStyle( @@ -948,7 +949,7 @@ def get_clip_info(self): Returns ------- - tuple[:class:`PolygonData `, bool] + tuple[:class:`.PolygonData`, bool] Returns a tuple in this format: @@ -969,7 +970,7 @@ def set_clip_info(self, clipping_poly, keep_inside=True): Parameters ---------- - clipping_poly: :class:`PolygonData ` + clipping_poly : :class:`.PolygonData` Polygon data to use to clip the path. keep_inside: bool, default: True Whether the part of the path inside the polygon should be preserved. @@ -998,7 +999,7 @@ def corner_style(self, corner_type): @property def width(self): - """:class:`Value `: Path width.""" + """:class:`.Value`: Path width.""" return Value(self.__stub.GetWidth(self.msg).width) @width.setter @@ -1012,7 +1013,7 @@ def width(self, width): @property def miter_ratio(self): - """:class:`Value `: Miter ratio.""" + """:class:`.Value`: Miter ratio.""" return Value(self.__stub.GetMiterRatio(self.msg).miter_ratio) @miter_ratio.setter @@ -1164,7 +1165,7 @@ def create( Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the bondwire in. bondwire_type : :class:`BondwireType` Type of the bondwire. Options are ``kAPDBondWire`` and ``kJDECBondWire``. @@ -1172,27 +1173,27 @@ def create( Bondwire definition name. placement_layer : str Layer name to create the bondwire on. - width : :class:`Value ` + width : :class:`.Value` Bondwire width. material : str Bondwire material name. - start_context : :class:`CellInstance ` + start_context : :class:`.CellInstance` Start context. ``None`` means top-level,. start_layer_name : str Name of the start layer. - start_x : :class:`Value ` + start_x : :class:`.Value` X value of the start point. - start_y : :class:`Value ` + start_y : :class:`.Value` Y value of the start point. - end_context : :class:`CellInstance ` + end_context : :class:`.CellInstance` End context: End content. ``None`` means top-level. end_layer_name : str Name of the end layer. - end_x : :class:`Value ` + end_x : :class:`.Value` X value of the end point. - end_y : :class:`Value ` + end_y : :class:`.Value` Y value of the end point. - net : str or :class:`Net ` or None + net : str or :class:`.Net` or None Net of the bondwire. Returns @@ -1270,7 +1271,7 @@ def cross_section_type(self, bondwire_type): @property def cross_section_height(self): - """:class:`Value `: Cross-section height of the bondwire.""" + """:class:`.Value`: Cross-section height of the bondwire.""" return Value(self.__stub.GetCrossSectionHeight(self.msg)) @cross_section_height.setter @@ -1314,10 +1315,10 @@ def get_traj(self): Returns ------- tuple[ - :class:`Value `, - :class:`Value `, - :class:`Value `, - :class:`Value ` + :class:`.Value`, + :class:`.Value`, + :class:`.Value`, + :class:`.Value` ] Returns a tuple in this format: @@ -1345,20 +1346,20 @@ def set_traj(self, x1, y1, x2, y2): Parameters ---------- - x1 : :class:`Value ` + x1 : :class:`.Value` X value of the the start point. - y1 : :class:`Value ` + y1 : :class:`.Value` Y value of the the start point. - x2 : :class:`Value ` + x2 : :class:`.Value` X value of the the end point. - y2 : :class:`Value ` + y2 : :class:`.Value` Y value of the end point. """ self.__stub.SetTraj(_BondwireQueryBuilder.set_bondwire_traj_message(self, x1, y1, x2, y2)) @property def width(self): - """:class:`Value `: Width of the bondwire.""" + """:class:`.Value`: Width of the bondwire.""" val = self.__stub.GetWidthValue(self.msg) return Value(val) @@ -1371,12 +1372,12 @@ def get_start_elevation(self, start_context): Parameters ---------- - start_context : :class:`CellInstance ` + start_context : :class:`.CellInstance` Start cell context of the bondwire. Returns ------- - :class:`Layer ` + :class:`.Layer` Start elevation level of the bondwire. """ return Layer( @@ -1390,9 +1391,9 @@ def set_start_elevation(self, start_context, layer): Parameters ---------- - start_context : :class:`CellInstance ` + start_context : :class:`.CellInstance` Start cell context of the bondwire. ``None`` means top-level. - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` Start layer of the bondwire. """ self.__stub.SetStartElevation( @@ -1404,12 +1405,12 @@ def get_end_elevation(self, end_context): Parameters ---------- - end_context : :class:`CellInstance ` + end_context : :class:`.CellInstance` End cell context of the bondwire. Returns ------- - :class:`Layer ` + :class:`.Layer` End elevation layer of the bondwire. """ return Layer( @@ -1423,9 +1424,9 @@ def set_end_elevation(self, end_context, layer): Parameters ---------- - end_context : :class:`CellInstance ` + end_context : :class:`.CellInstance` End cell context of the bondwire. ``None`` means top-level. - layer : str or :class:`Layer ` + layer : str or :class:`.Layer` End layer of the bondwire. """ self.__stub.SetEndElevation( @@ -1605,27 +1606,27 @@ def create( Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the padstack instance in. - net : :class:`Net ` + net : :class:`.Net` Net of the padstack instance. name : str Name of the padstack instance. - padstack_def : PadstackDef + padstack_def : :class:`.PadstackDef` Padstack definition of the padstack instance. - position_x : :class:`Value ` + position_x : :class:`.Value` Position x of the padstack instance. - position_y : :class:`Value ` + position_y : :class:`.Value` Position y of the padstack instance. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation of the padstack instance. - top_layer : :class:`Layer ` + top_layer : :class:`.Layer` Top layer of the padstack instance. - bottom_layer : :class:`Layer ` + bottom_layer : :class:`.Layer` Bottom layer of the padstack instance. - solder_ball_layer : :class:`Layer ` + solder_ball_layer : :class:`.Layer` Solder ball layer of the padstack instance or ``None`` for none. - layer_map : :class:`LayerMap ` + layer_map : :class:`.LayerMap` Layer map of the padstack instance. ``None`` or empty results in auto-mapping. @@ -1654,7 +1655,8 @@ def create( @property def padstack_def(self): - """:class:`PadstackDef `: Definition of the padstack instance.""" + """:class:`.PadstackDef`: \ + Definition of the padstack instance.""" return PadstackDef(self.__stub.GetPadstackDef(self.msg)) @property @@ -1672,9 +1674,9 @@ def get_position_and_rotation(self): Returns ------- tuple[ - :class:`Value `, - :class:`Value `, - :class:`Value ` + :class:`.Value`, + :class:`.Value`, + :class:`.Value` ] Returns a tuple in this format: @@ -1699,11 +1701,11 @@ def set_position_and_rotation(self, x, y, rotation): Parameters ---------- - x : :class:`Value ` + x : :class:`.Value` x : X coordinate. - y : :class:`Value ` + y : :class:`.Value` y : Y coordinate. - rotation : :class:`Value ` + rotation : :class:`.Value` Rotation in radians. """ self.__stub.SetPositionAndRotation( @@ -1715,12 +1717,11 @@ def get_layer_range(self): Returns ------- - tuple[:class:`Layer `, :class:`Layer `] - - The tuple is in this format: ``(top_layer, bottom_layer)``. + tuple[:class:`.Layer`, :class:`.Layer`] + The tuple is in this format: ``(top_layer, bottom_layer)``. - - ``top_layer``: Top layer of the padstack instance - - ``bottom_layer``: Bottom layer of the padstack instance + - ``top_layer``: Top layer of the padstack instance + - ``bottom_layer``: Bottom layer of the padstack instance """ params = self.__stub.GetLayerRange(self.msg) return ( @@ -1733,9 +1734,9 @@ def set_layer_range(self, top_layer, bottom_layer): Parameters ---------- - top_layer : :class:`Layer ` + top_layer : :class:`.Layer` Top layer of the padstack instance. - bottom_layer : :class:`Layer ` + bottom_layer : :class:`.Layer` Bottom layer of the padstack instance. """ self.__stub.SetLayerRange( @@ -1744,7 +1745,7 @@ def set_layer_range(self, top_layer, bottom_layer): @property def solderball_layer(self): - """:class:`Layer `: Solderball layer of the padstack instance.""" + """:class:`.Layer`: Solderball layer of the padstack instance.""" return Layer(self.__stub.GetSolderBallLayer(self.msg)).cast() @solderball_layer.setter @@ -1755,7 +1756,7 @@ def solderball_layer(self, solderball_layer): @property def layer_map(self): - """:class:`LayerMap `: Layer map of the padstack instance.""" + """:class:`.LayerMap`: Layer map of the padstack instance.""" return LayerMap(self.__stub.GetLayerMap(self.msg)) @layer_map.setter @@ -1769,7 +1770,7 @@ def get_hole_overrides(self): ------- tuple[ bool, - :class:`Value ` + :class:`.Value` ] Returns a tuple in this format: @@ -1793,7 +1794,7 @@ def set_hole_overrides(self, is_hole_override, hole_override): ---------- is_hole_override : bool Whether the padstack instance is a hole override. - hole_override : :class:`Value ` + hole_override : :class:`.Value` Hole override diameter of the padstack instance. """ self.__stub.SetHoleOverrides( @@ -1844,8 +1845,8 @@ def get_back_drill_by_layer(self, from_bottom): ------- tuple[ bool, - :class:`Value `, - :class:`Value ` + :class:`.Value`, + :class:`.Value` ] Returns a tuple in this format: @@ -1874,13 +1875,13 @@ def set_back_drill_by_layer(self, drill_to_layer, offset, diameter, from_bottom) Parameters ---------- - drill_to_layer : :class:`Layer ` + drill_to_layer : :class:`.Layer` Layer to drill to. If drilling from the top, the drill stops at the upper elevation of the layer. If drilling from the bottom, the drill stops at the lower elevation of the layer. - offset : :class:`Value ` + offset : :class:`.Value` Layer offset (or depth if the layer is empty). - diameter : :class:`Value ` + diameter : :class:`.Value` Drilling diameter. from_bottom : bool Whether to set the back drill type from the bottom. @@ -1903,7 +1904,7 @@ def get_back_drill_by_depth(self, from_bottom): ------- tuple[ bool, - :class:`Value ` + :class:`.Value` ] Returns a tuple in this format: @@ -1923,9 +1924,9 @@ def set_back_drill_by_depth(self, drill_depth, diameter, from_bottom): Parameters ---------- - drill_depth : :class:`Value ` + drill_depth : :class:`.Value` Drilling depth, which may not align with the layer. - diameter : :class:`Value ` + diameter : :class:`.Value` Drilling diameter. from_bottom : bool Whether to set the back drill type from the bottom. @@ -1937,15 +1938,18 @@ def set_back_drill_by_depth(self, drill_depth, diameter, from_bottom): ) def get_padstack_instance_terminal(self): - """:class:`TerminalInstance `: Terminal of the padstack instance.""" - return terminal.TerminalInstance(self.__stub.GetPadstackInstanceTerminal(self.msg)) + """:class:`.TerminalInstance`: \ + Terminal of the padstack instance.""" + from ansys.edb.core.terminal import terminals + + return terminals.TerminalInstance(self.__stub.GetPadstackInstanceTerminal(self.msg)) def is_in_pin_group(self, pin_group): """Determine if the padstack instance is in a given pin group. Parameters ---------- - pin_group : :class:`PinGroup ` + pin_group : :class:`.PinGroup` Pin group to check if the padstack instance is in it. Returns @@ -1959,12 +1963,15 @@ def is_in_pin_group(self, pin_group): @property def pin_groups(self): - """:obj:`list` of :class:`PinGroup `: Pin groups of the padstack instance. + """:obj:`list` of :class:`.PinGroup`: \ + Pin groups of the padstack instance. This property is read-only. """ + from ansys.edb.core.hierarchy import pin_group + pins = self.__stub.GetPinGroups(self.msg).items - return [hierarchy.PinGroup(p) for p in pins] + return [pin_group.PinGroup(p) for p in pins] class BoardBendDef(Primitive): @@ -1978,9 +1985,9 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle): Parameters ---------- - layout : :class:`Layout ` + layout : :class:`.Layout` Layout to create the board bend definition in. - zone_prim : :class:`Primitive ` + zone_prim : :class:`.Primitive` Zone primitive to create the board bend definition on. bend_middle : (:term:`Point2DLike`, :term:`Point2DLike`) Tuple containing the starting and ending points of the line that represents @@ -2009,7 +2016,7 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle): @property def boundary_primitive(self): - """:class:`Primitive `: Zone primitive the board bend is placed on. + """:class:`.Primitive`: Zone primitive the board bend is placed on. This property is read-only. """ @@ -2046,7 +2053,7 @@ def angle(self, val): @property @parser.to_polygon_data_list def bent_regions(self): - """:obj:`list` of :class:`PolygonData `: Bent region polygons. + """:obj:`list` of :class:`.PolygonData`: Bent region polygons. This list of a collection of polygon data represents the areas bent by the bend definition. diff --git a/src/ansys/edb/core/simulation_setup/__init__.py b/src/ansys/edb/core/simulation_setup/__init__.py index 92e665ebdd..f9fd03d106 100644 --- a/src/ansys/edb/core/simulation_setup/__init__.py +++ b/src/ansys/edb/core/simulation_setup/__init__.py @@ -1,66 +1 @@ """Import simulation setup classes.""" - -from ansys.edb.core.simulation_setup.adaptive_solutions import ( - AdaptiveFrequency, - BroadbandAdaptiveSolution, - MatrixConvergenceData, - MatrixConvergenceDataEntry, - MultiFrequencyAdaptiveSolution, - SingleFrequencyAdaptiveSolution, -) -from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( - AdaptType, - BasisFunctionOrder, - HFSSAdvancedMeshingSettings, - HFSSAdvancedSettings, - HFSSDCRSettings, - HFSSGeneralSettings, - HFSSSettingsOptions, - HFSSSimulationSettings, - HFSSSolverSettings, - SolverType, -) -from ansys.edb.core.simulation_setup.hfss_simulation_setup import HfssSimulationSetup -from ansys.edb.core.simulation_setup.mesh_operation import ( - LengthMeshOperation, - MeshOperation, - SkinDepthMeshOperation, -) -from ansys.edb.core.simulation_setup.raptor_x_simulation_settings import ( - RaptorXAdvancedSettings, - RaptorXGeneralSettings, - RaptorXSimulationSettings, -) -from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import RaptorXSimulationSetup -from ansys.edb.core.simulation_setup.simulation_settings import ( - AdvancedMeshingSettings, - AdvancedSettings, - SettingsOptions, - SimulationSettings, - SolverSettings, - ViaStyle, -) -from ansys.edb.core.simulation_setup.simulation_setup import ( - FreqSweepType, - HFSSRegionComputeResource, - InterpolatingSweepData, - SimulationSetup, - SimulationSetupType, - SweepData, -) -from ansys.edb.core.simulation_setup.siwave_dcir_simulation_settings import ( - SIWaveDCIRSimulationSettings, -) -from ansys.edb.core.simulation_setup.siwave_dcir_simulation_setup import SIWaveDCIRSimulationSetup -from ansys.edb.core.simulation_setup.siwave_simulation_settings import ( - SIWaveAdvancedSettings, - SIWaveDCAdvancedSettings, - SIWaveDCSettings, - SIWaveGeneralSettings, - SIWaveSimulationSettings, - SIWaveSParameterSettings, - SParamDCBehavior, - SParamExtrapolation, - SParamInterpolation, -) -from ansys.edb.core.simulation_setup.siwave_simulation_setup import SIWaveSimulationSetup diff --git a/src/ansys/edb/core/simulation_setup/adaptive_solutions.py b/src/ansys/edb/core/simulation_setup/adaptive_solutions.py index 99a3116792..a918434e1c 100644 --- a/src/ansys/edb/core/simulation_setup/adaptive_solutions.py +++ b/src/ansys/edb/core/simulation_setup/adaptive_solutions.py @@ -62,7 +62,7 @@ class MatrixConvergenceData: Attributes ---------- mag_min_threshold : float - entry_list : list[:class:`MatrixConvergenceDataEntry`] + entry_list : list[:class:`.MatrixConvergenceDataEntry`] """ def __init__(self, mag_min_threshold=0.01, entry_list=None): @@ -111,7 +111,7 @@ def mag_min_threshold(self, mag_min_threshold): @property def entry_list(self): - """:obj:`list` of :class:`MatrixConvergenceDataEntry`: Matrix entries.""" + """:obj:`list` of :class:`.MatrixConvergenceDataEntry`: Matrix entries.""" return self._entry_list @entry_list.setter @@ -282,7 +282,7 @@ def max_passes(self, max_passes): @property def mx_conv_data(self): - """:class:`MatrixConvergenceData`: Matrix convergence data.""" + """:class:`.MatrixConvergenceData`: Matrix convergence data.""" return self._mx_conv_data @mx_conv_data.setter @@ -350,7 +350,7 @@ class MultiFrequencyAdaptiveSolution: ---------- max_passes : int Maximum number of adaptive passes. - adaptive_frequencies : list[:class:`AdaptiveFrequency`] + adaptive_frequencies : list[:class:`.AdaptiveFrequency`] """ def __init__(self, max_passes=10, adaptive_frequencies=None): @@ -365,7 +365,7 @@ def __init__(self, max_passes=10, adaptive_frequencies=None): @property def adaptive_frequencies(self): - """:obj:`list` of :class:`AdaptiveFrequency`: Frequencies that adaptive solutions are calculated for.""" + """:obj:`list` of :class:`.AdaptiveFrequency`: Frequencies that adaptive solutions are calculated for.""" return self._adaptive_frequencies @adaptive_frequencies.setter diff --git a/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py b/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py index 872f1d329a..75b65a6d34 100644 --- a/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py @@ -57,32 +57,32 @@ class HFSSSimulationSettings(SimulationSettings): @property def general(self): - """:class:`HFSSGeneralSettings`: General settings for HFSS simulations.""" + """:class:`.HFSSGeneralSettings`: General settings for HFSS simulations.""" return HFSSGeneralSettings(self._sim_setup) @property def options(self): - """:class:`HFSSSettingsOptions`: HFSS simulation setting options.""" + """:class:`.HFSSSettingsOptions`: HFSS simulation setting options.""" return HFSSSettingsOptions(self._sim_setup) @property def advanced(self): - """:class:`HFSSAdvancedSettings`: Advanced settings for HFSS simulations.""" + """:class:`.HFSSAdvancedSettings`: Advanced settings for HFSS simulations.""" return HFSSAdvancedSettings(self._sim_setup) @property def advanced_meshing(self): - """:class:`HFSSAdvancedMeshingSettings`: Advanced meshing settings for HFSS simulations.""" + """:class:`.HFSSAdvancedMeshingSettings`: Advanced meshing settings for HFSS simulations.""" return HFSSAdvancedMeshingSettings(self._sim_setup) @property def solver(self): - """:class:`HFSSSolverSettings`: Solver settings for HFSS simulations.""" + """:class:`.HFSSSolverSettings`: Solver settings for HFSS simulations.""" return HFSSSolverSettings(self._sim_setup) @property def dcr(self): - """:class:`HFSSDCRSettings`: DCR settings for HFSS simulations.""" + """:class:`.HFSSDCRSettings`: DCR settings for HFSS simulations.""" return HFSSDCRSettings(self._sim_setup) @@ -93,7 +93,7 @@ class HFSSGeneralSettings(SimulationSettingsBase): @property def single_frequency_adaptive_solution(self): - """:class:`SingleFrequencyAdaptiveSolution`: Settings for a single frequency adaptive solution.""" + """.SingleFrequencyAdaptiveSolution`: Settings for a single frequency adaptive solution.""" return parser.to_single_frequency_adaptive_solution( self.__stub.GetSingleFrequencyAdaptiveSolution(self.msg) ) @@ -111,7 +111,7 @@ def single_frequency_adaptive_solution(self, single_frequency_adaptive_solution) @property def multi_frequency_adaptive_solution(self): - """:class:`MultiFrequencyAdaptiveSolution`: Settings for a multi-frequency adaptive solution.""" + """:class:`.MultiFrequencyAdaptiveSolution`: Settings for a multi-frequency adaptive solution.""" return parser.to_multi_frequency_adaptive_solution( self.__stub.GetMultiFrequencyAdaptiveSolution(self.msg) ) @@ -129,7 +129,7 @@ def multi_frequency_adaptive_solution(self, multi_frequency_adaptive_solution): @property def broadband_adaptive_solution(self): - """:class:`BroadbandAdaptiveSolution`: Settings for a broadband adaptive solution.""" + """:class:`.BroadbandAdaptiveSolution`: Settings for a broadband adaptive solution.""" return parser.to_broadband_adaptive_solution( self.__stub.GetBroadbandFrequencyAdaptiveSolution(self.msg) ) @@ -251,7 +251,7 @@ def min_converged_passes(self, min_refinement_passes): @property def order_basis(self): - """:class:`BasisFunctionOrder`: Basis function order.""" + """:class:`.BasisFunctionOrder`: Basis function order.""" return BasisFunctionOrder(self.__stub.GetBasisFunctionOrder(self.msg).basis_function_order) @order_basis.setter @@ -264,7 +264,7 @@ def order_basis(self, order_basis): @property def solver_type(self): - """:class:`SolverType`: HFSS solver type.""" + """:class:`.SolverType`: HFSS solver type.""" return SolverType(self.__stub.GetSolverTypeOrder(self.msg).solver_type) @solver_type.setter diff --git a/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py b/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py index 95ad465a72..27962f40b3 100644 --- a/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py @@ -20,7 +20,7 @@ def create(cls, cell, name): Parameters ---------- - cell : :class:`Cell ` + cell : :class:`.Cell` Cell to create the simulation setup in. name : str Name of the simulation setup. @@ -34,7 +34,7 @@ def create(cls, cell, name): @property def mesh_operations(self): - """:obj:`list` of :class:`MeshOperation`: Mesh operations of the HFSS simulation setup.""" + """:obj:`list` of :class:`.MeshOperation`: Mesh operations of the HFSS simulation setup.""" return map_list(self.__stub.GetMeshOperations(self.msg).mesh_ops, parser.to_mesh_op) @mesh_operations.setter @@ -50,5 +50,5 @@ def mesh_operations(self, new_mesh_ops): @property def settings(self): - """:class:`HfssSimulationSettings`: Simulation settings of the HFSS simulation setup.""" + """:class:`.HfssSimulationSettings`: Simulation settings of the HFSS simulation setup.""" return HFSSSimulationSettings(self) diff --git a/src/ansys/edb/core/simulation_setup/raptor_x_simulation_settings.py b/src/ansys/edb/core/simulation_setup/raptor_x_simulation_settings.py index 0d1706abe1..2ff884d403 100644 --- a/src/ansys/edb/core/simulation_setup/raptor_x_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/raptor_x_simulation_settings.py @@ -42,12 +42,12 @@ class RaptorXSimulationSettings(SimulationSettings): @property def general(self): - """:class:`RaptorXGeneralSettings`: General settings for RaptorX simulations.""" + """:class:`.RaptorXGeneralSettings`: General settings for RaptorX simulations.""" return RaptorXGeneralSettings(self._sim_setup) @property def advanced(self): - """:class:`RaptorXAdvancedSettings`: Advanced settings for RaptorX simulations.""" + """:class:`.RaptorXAdvancedSettings`: Advanced settings for RaptorX simulations.""" return RaptorXAdvancedSettings(self._sim_setup) diff --git a/src/ansys/edb/core/simulation_setup/raptor_x_simulation_setup.py b/src/ansys/edb/core/simulation_setup/raptor_x_simulation_setup.py index 40d9607677..7317554094 100644 --- a/src/ansys/edb/core/simulation_setup/raptor_x_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/raptor_x_simulation_setup.py @@ -13,7 +13,7 @@ def create(cls, cell, name): Parameters ---------- - cell : :class:`Cell ` + cell : :class:`.Cell` Cell to create the simulation setup in. name : str Name of the simulation setup. @@ -27,5 +27,5 @@ def create(cls, cell, name): @property def settings(self): - """:class:`RaptorXSimulationSettings`: Simulation settings of the RaptorX simulation setup.""" + """:class:`.RaptorXSimulationSettings`: Simulation settings of the RaptorX simulation setup.""" return RaptorXSimulationSettings(self) diff --git a/src/ansys/edb/core/simulation_setup/simulation_settings.py b/src/ansys/edb/core/simulation_setup/simulation_settings.py index 3fee130b6b..0ad1ca83a9 100644 --- a/src/ansys/edb/core/simulation_setup/simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/simulation_settings.py @@ -183,7 +183,7 @@ def small_void_area(self, small_void_area): @property def via_model_type(self): - """:class:`ViaStyle`: Via model type.""" + """:class:`.ViaStyle`: Via model type.""" return ViaStyle(self.__stub.GetViaModelType(self.msg).via_model_type) @via_model_type.setter diff --git a/src/ansys/edb/core/simulation_setup/simulation_setup.py b/src/ansys/edb/core/simulation_setup/simulation_setup.py index 371dffedd7..14a0463fa6 100644 --- a/src/ansys/edb/core/simulation_setup/simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/simulation_setup.py @@ -16,7 +16,7 @@ from ansys.edb.core.inner.base import ObjBase from ansys.edb.core.inner.utils import map_list from ansys.edb.core.session import SimulationSetupServiceStub, StubAccessor, StubType -from ansys.edb.core.simulation_setup import MatrixConvergenceDataEntry +from ansys.edb.core.simulation_setup.adaptive_solutions import MatrixConvergenceDataEntry class SimulationSetupType(Enum): @@ -403,7 +403,7 @@ def position(self, position): @property def sweep_data(self): - """:obj:`list` of :class:`SweepData`: Frequency sweeps of the simulation setup.""" + """:obj:`list` of :class:`.SweepData`: Frequency sweeps of the simulation setup.""" sweep_data = [] for sweep_data_msg in self.__stub.GetSweepData(self.msg).sweep_data: sweep_data.append(_msg_to_sweep_data(sweep_data_msg)) @@ -422,7 +422,7 @@ def sweep_data(self, sweep_data): @property def type(self): - """:class:`SimulationSetupType`: Type of the simulation setup.""" + """:class:`.SimulationSetupType`: Type of the simulation setup.""" return SimulationSetupType(self.__stub.GetType(self.msg).type) def cast(self): @@ -432,12 +432,12 @@ def cast(self): ------- SimulationSetup """ - from ansys.edb.core.simulation_setup import ( - HfssSimulationSetup, - RaptorXSimulationSetup, + from ansys.edb.core.simulation_setup.hfss_simulation_setup import HfssSimulationSetup + from ansys.edb.core.simulation_setup.raptor_x_simulation_setup import RaptorXSimulationSetup + from ansys.edb.core.simulation_setup.siwave_dcir_simulation_setup import ( SIWaveDCIRSimulationSetup, - SIWaveSimulationSetup, ) + from ansys.edb.core.simulation_setup.siwave_simulation_setup import SIWaveSimulationSetup if self.is_null: return diff --git a/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_setup.py b/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_setup.py index ccf3c21b21..a4682e3d63 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_setup.py @@ -15,7 +15,7 @@ def create(cls, cell, name): Parameters ---------- - cell : :class:`Cell ` + cell : :class:`.Cell` Cell to create the simulation setup in. name : str Name of the simulation setup. @@ -29,5 +29,5 @@ def create(cls, cell, name): @property def settings(self): - """:class:`SIWaveSimulationSettings`: Simulation settings of the simulation setup.""" + """:class:`.SIWaveSimulationSettings`: Simulation settings of the simulation setup.""" return SIWaveDCIRSimulationSettings(self) diff --git a/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py b/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py index 078554aa20..1d12aba049 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py @@ -53,27 +53,27 @@ class SIWaveSimulationSettings(SimulationSettings): @property def general(self): - """:class:`SIWaveGeneralSettings`: General settings for SIWave simulations.""" + """:class:`.SIWaveGeneralSettings`: General settings for SIWave simulations.""" return SIWaveGeneralSettings(self._sim_setup) @property def advanced(self): - """:class:`SIWaveAdvancedSettings`: Advanced settings for SIWave simulations.""" + """:class:`.SIWaveAdvancedSettings`: Advanced settings for SIWave simulations.""" return SIWaveAdvancedSettings(self._sim_setup) @property def dc(self): - """:class:`SIWaveDCSettings`: DC settings for SIWave simulations.""" + """:class:`.SIWaveDCSettings`: DC settings for SIWave simulations.""" return SIWaveDCSettings(self._sim_setup) @property def dc_advanced(self): - """:class:`SIWaveDCAdvancedSettings`: Advanced DC settings for SIWave simulations.""" + """:class:`.SIWaveDCAdvancedSettings`: Advanced DC settings for SIWave simulations.""" return SIWaveDCAdvancedSettings(self._sim_setup) @property def s_parameter(self): - """:class:`SIWaveSParameterSettings`: S parameter settings for SIWave simulations.""" + """:class:`.SIWaveSParameterSettings`: S parameter settings for SIWave simulations.""" return SIWaveSParameterSettings(self._sim_setup) diff --git a/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py b/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py index c7ae19f333..16dd3bd10e 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py @@ -13,7 +13,7 @@ def create(cls, cell, name): Parameters ---------- - cell : :class:`Cell ` + cell : :class:`.Cell` Cell to create simulation setup in. name : str Name of the simulation setup. @@ -27,5 +27,5 @@ def create(cls, cell, name): @property def settings(self): - """:class:`SIWaveSimulationSettings`: Simulation settings of the SIWave simulation setup.""" + """:class:`.SIWaveSimulationSettings`: Simulation settings of the SIWave simulation setup.""" return SIWaveSimulationSettings(self) diff --git a/src/ansys/edb/core/terminal/__init__.py b/src/ansys/edb/core/terminal/__init__.py index 208ae44b0f..cfea10ef04 100644 --- a/src/ansys/edb/core/terminal/__init__.py +++ b/src/ansys/edb/core/terminal/__init__.py @@ -1,20 +1 @@ """Import terminal classes.""" - -from ansys.edb.core.terminal.terminals import ( - BoundaryType, - BundleTerminal, - Edge, - EdgeTerminal, - EdgeType, - HfssPIType, - PadEdge, - PadstackInstanceTerminal, - PinGroupTerminal, - PointTerminal, - PrimitiveEdge, - SourceTermToGroundType, - Terminal, - TerminalInstance, - TerminalInstanceTerminal, - TerminalType, -) diff --git a/src/ansys/edb/core/terminal/terminals.py b/src/ansys/edb/core/terminal/terminals.py index c84c57430d..89cc7cde0c 100644 --- a/src/ansys/edb/core/terminal/terminals.py +++ b/src/ansys/edb/core/terminal/terminals.py @@ -5,13 +5,13 @@ import ansys.api.edb.v1.edge_term_pb2 as edge_term_pb2 import ansys.api.edb.v1.term_pb2 as term_pb2 -from ansys.edb.core import hierarchy, primitive from ansys.edb.core.edb_defs import LayoutObjType -from ansys.edb.core.geometry import ArcData +from ansys.edb.core.geometry.arc_data import ArcData from ansys.edb.core.inner import ObjBase, TypeField, conn_obj, messages, parser -from ansys.edb.core.layer import Layer +from ansys.edb.core.layer.layer import Layer from ansys.edb.core.session import StubAccessor, StubType -from ansys.edb.core.utility import PortPostProcessingProp, Value +from ansys.edb.core.utility.port_post_processing_prop import PortPostProcessingProp +from ansys.edb.core.utility.value import Value class TerminalType(Enum): @@ -127,6 +127,8 @@ def create(cls, padstack_instance, layer, arc): @property def padstack_instance(self): """:class:`.PadstackInstance`: Padstack instance that the edge is on.""" + from ansys.edb.core.primitive import primitive + return primitive.PadstackInstance(self._params.padstack_instance) @property @@ -163,6 +165,8 @@ def create(cls, prim, point): @property def primitive(self): """:class:`.Primitive`: Primitive of the terminal.""" + from ansys.edb.core.primitive import primitive + return primitive.Primitive(self._params.primitive).cast() @property @@ -493,7 +497,9 @@ def create(cls, layout, cell_instance, name, net_ref): @property def owning_cell_instance(self): """:class:`.CellInstance`: Cell instance that owns the terminal.""" - return hierarchy.CellInstance(self.__stub.GetOwningCellInstance(self.msg)) + from ansys.edb.core.hierarchy import cell_instance + + return cell_instance.CellInstance(self.__stub.GetOwningCellInstance(self.msg)) @property def definition_terminal(self): @@ -522,7 +528,7 @@ def create(cls, layout, term_instance, name, net_ref, is_ref=False): Layout to create the terminal instance terminal in. term_instance : TerminalInstance Terminal instance to create the terminal instance terminal on. - name: :obj:`str` + name : :obj:`str` Name of the terminal instance terminal. net_ref : :class:`.Net` or :obj:`str` or None Net reference. @@ -685,6 +691,8 @@ def create(cls, layout, name, padstack_instance, layer, net, is_ref=False): @property def params(self): """:obj:`list` of :class:`.PadstackInstance` and :class:`.Layer`: Padstack instance and layer.""" + from ansys.edb.core.primitive import primitive + res = self.__stub.GetParameters(self.msg) padstack_instance = primitive.PadstackInstance(res.padstack_instance) layer = Layer(res.layer).cast() @@ -744,7 +752,9 @@ def create(cls, layout, name, pin_group, net, is_ref=False): @property def pin_group(self): """:class:`.PinGroup`: Pin group of the terminal.""" - return hierarchy.PinGroup(self.__stub.GetPinGroup(self.msg)) + from ansys.edb.core.hierarchy import pin_group + + return pin_group.PinGroup(self.__stub.GetPinGroup(self.msg)) @pin_group.setter def pin_group(self, value): diff --git a/src/ansys/edb/core/typing/__init__.py b/src/ansys/edb/core/typing/__init__.py index 13d55cb18e..a9655c8f6a 100644 --- a/src/ansys/edb/core/typing/__init__.py +++ b/src/ansys/edb/core/typing/__init__.py @@ -3,9 +3,9 @@ from typing import Iterable, Tuple, Union import ansys.edb.core.geometry.point_data as point_data -import ansys.edb.core.utility.value as value +from ansys.edb.core.utility.value import Value -ValueLike = Union[int, float, complex, str, value.Value] +ValueLike = Union[int, float, complex, str, Value] PointLike = Union[point_data.PointData, Iterable[ValueLike]] Point3DLike = Tuple[ValueLike, ValueLike, ValueLike] Triangle3DLike = Tuple[Point3DLike, Point3DLike, Point3DLike] diff --git a/src/ansys/edb/core/utility/__init__.py b/src/ansys/edb/core/utility/__init__.py index 1c366068b1..ad2cd95c97 100644 --- a/src/ansys/edb/core/utility/__init__.py +++ b/src/ansys/edb/core/utility/__init__.py @@ -1,14 +1 @@ """This package contains utility classes and functions available to users.""" - -from ansys.edb.core.utility.heat_sink import HeatSink -from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo -from ansys.edb.core.utility.material_property_thermal_modifier_params import ( - AdvancedQuadraticParams, - BasicQuadraticParams, -) -from ansys.edb.core.utility.port_post_processing_prop import PortPostProcessingProp -from ansys.edb.core.utility.rlc import PinPair, PinPairRlc, Rlc -from ansys.edb.core.utility.temperature_settings import TemperatureSettings -from ansys.edb.core.utility.transform3d import Transform3D -from ansys.edb.core.utility.transform import Transform -from ansys.edb.core.utility.value import Value diff --git a/src/ansys/edb/core/utility/conversions.py b/src/ansys/edb/core/utility/conversions.py index e368dc9901..cb6119a3f7 100644 --- a/src/ansys/edb/core/utility/conversions.py +++ b/src/ansys/edb/core/utility/conversions.py @@ -1,7 +1,8 @@ """This module performs conversions from arbitrary user input to explicit types.""" from ansys.api.edb.v1.edb_messages_pb2 import ValueMessage -from ansys.edb.core import geometry, utility +from ansys.edb.core.geometry import point3d_data, point_data +from ansys.edb.core.utility import value def to_value(val): @@ -13,12 +14,12 @@ def to_value(val): Returns ------- - utility.Value + :class:`.Value` """ - if isinstance(val, utility.Value): + if isinstance(val, value.Value): return val elif type(val) in [int, float, complex, str, ValueMessage]: - return utility.Value(val) + return value.Value(val) else: raise TypeError( f"Value-like objects must be either of type Value or int/float/complex/str. - Received '{val}'" @@ -34,15 +35,15 @@ def to_point(val): Returns ------- - geometry.PointData + :class:`.PointData` """ - if isinstance(val, geometry.PointData): + if isinstance(val, point_data.PointData): return val try: if len(val) == 2: - return geometry.PointData(val) + return point_data.PointData(val) except TypeError: - return geometry.PointData(val) + return point_data.PointData(val) raise TypeError( "Point-like objects must be either of type PointData or a list/tuple containing (start, end) or (arc_height)." @@ -54,14 +55,14 @@ def to_point3d(val): Parameters ---------- - val : geometry.Point3DData, tuple[:term:`ValueLike`,:term:`ValueLike`,:term:`ValueLike`] + val : Point3DData, tuple[:term:`ValueLike`,:term:`ValueLike`,:term:`ValueLike`] Value to convert. Returns ------- - geometry.Point3DData + :class:`.Point3DData` """ - if isinstance(val, geometry.Point3DData): + if isinstance(val, point3d_data.Point3DData): return val if len(val) == 3: - return geometry.Point3DData(val[0], val[1], val[2]) + return point3d_data.Point3DData(val[0], val[1], val[2]) diff --git a/src/ansys/edb/core/utility/hfss_extent_info.py b/src/ansys/edb/core/utility/hfss_extent_info.py index c8ea22b957..cfaf918483 100644 --- a/src/ansys/edb/core/utility/hfss_extent_info.py +++ b/src/ansys/edb/core/utility/hfss_extent_info.py @@ -23,7 +23,7 @@ class HfssExtentInfo: Polygon to use if the extent is the ``Polygon`` type. dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType Dielectric extent type. - dielectric_base_polygon: :class:`Primitive ` + dielectric_base_polygon : :class:`.Primitive` Polygon to use if dielectric extent is is the ``Polygon`` type. dielectric: (float, bool) Dielectric extent size. The first parameter is the value, and the second parameter \ @@ -45,9 +45,9 @@ class HfssExtentInfo: Whether to synchronize the airbox positive and negative vertical extent. is_pml_visible: bool Whether to check to see if the PML boxes are to rendered. - operating_frequency: :class:`Value ` + operating_frequency : :class:`.Value` PML operating frequency. - radiation_level: :class:`Value ` + radiation_level : :class:`.Value` PML radiation level for calculating the thickness of the boundary. user_xy_data_extent_for_vertical_expansion: bool Whether to retain the old behavior for the vertical expansion of the airbox. @@ -102,7 +102,7 @@ def __init__( Polygon to use if the extent is the ``Polygon`` type. dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType, default: BOUNDING_BOX Dielectric extent type. - dielectric_base_polygon: :class:`Primitive `, default: None + dielectric_base_polygon : :class:`.Primitive`, default: None Polygon to use if dielectric extent is the ``Polygon`` type. dielectric: (float, bool), default: (0, True) Dielectric extent size. The first parameter is the value. @@ -125,9 +125,9 @@ def __init__( Whether to synchronize the airbox positive and negative vertical extent. is_pml_visible: bool, default: False Whether to check to see if PML boxes are to be rendered. - operating_frequency: :class:`Value `, default: "5GHz" + operating_frequency : :class:`.Value`, default: "5GHz" PML operating frequency. - radiation_level: :class:`Value `, default: 0 + radiation_level : :class:`.Value`, default: 0 PML radiation level for calculating the thickness of the boundary. user_xy_data_extent_for_vertical_expansion: bool, default: True Whether to retain the old behavior for the vertical expansion of the airbox. diff --git a/src/ansys/edb/core/utility/transform.py b/src/ansys/edb/core/utility/transform.py index 0c1eb656d2..4c87572e3f 100644 --- a/src/ansys/edb/core/utility/transform.py +++ b/src/ansys/edb/core/utility/transform.py @@ -60,7 +60,7 @@ def create(cls, scale, angle, mirror, offset_x, offset_y): @property def scale(self): - """:class:`Value `: Scale property. + """:class:`.Value`: Scale property. This property can be set to :term:`ValueLike`. """ @@ -72,7 +72,7 @@ def scale(self, value): @property def rotation(self): - """:class:`Value `: Rotation property. + """:class:`.Value`: Rotation property. This property can be set to :term:`ValueLike`. """ @@ -84,7 +84,7 @@ def rotation(self, value): @property def offset_x(self): - """:class:`Value `: X offset property. + """:class:`.Value`: X offset property. This property can be set to :term:`ValueLike`. """ @@ -96,7 +96,7 @@ def offset_x(self, value): @property def offset_y(self): - """:class:`Value `: Y offset property. + """:class:`.Value`: Y offset property. This property can be set to :term:`ValueLike`. """ @@ -144,12 +144,12 @@ def transform_point(self, point): Parameters ---------- - point: :class:`PointData ` + point : :class:`.PointData` Point values [x, y] to transform. Returns ------- - :class:`PointData ` + :class:`.PointData` Transformed point. """ pnt_msg = self.__stub.TransformPoint(messages.point_property_message(self, point)) @@ -161,12 +161,12 @@ def transform_polygon(self, polygon): Parameters ---------- - polygon: :class:`PolygonData ` + polygon : :class:`.PolygonData` Polygon to transform. Returns ------- - :class:`PolygonData ` + :class:`.PolygonData` Transformed polygon. """ return self.__stub.TransformPolygon(messages.polygon_data_property_message(self, polygon)) diff --git a/src/ansys/edb/core/utility/transform3d.py b/src/ansys/edb/core/utility/transform3d.py index e7bf481301..2296be7549 100644 --- a/src/ansys/edb/core/utility/transform3d.py +++ b/src/ansys/edb/core/utility/transform3d.py @@ -197,7 +197,7 @@ def create_from_transform_2d(cls, transform, z_off): Parameters ---------- - transform : :class:`Transform ` + transform : :class:`.Transform` Transform data. z_off : :obj:`float` Z offset. diff --git a/src/ansys/edb/core/utility/value.py b/src/ansys/edb/core/utility/value.py index 3e90ffedd0..231d70ff64 100644 --- a/src/ansys/edb/core/utility/value.py +++ b/src/ansys/edb/core/utility/value.py @@ -16,9 +16,10 @@ class Value: ---------- val : :term:`ValueLike` Value assigned to the new value. - _owner : None, :class:`Database `, :class:`Cell `, - :class:`Layout `, \ - :class:`ComponentDef ` + _owner : None, :class:`.Database`, + :class:`.Cell`, + :class:`.Layout`, + :class:`.ComponentDef` Notes ----- @@ -26,8 +27,8 @@ class Value: parametric (such as.``w1 + w2``). If the value is parametric, the ``_owner`` attribute must be set to the object that hosts the - variables used. If the owner is :class:`Cell ` or - :class:`Layout `, the expression can reference both database variables + variables used. If the owner is :class:`.Cell` or + :class:`.Layout`, the expression can reference both database variables and cell variables. A better way to create a parametric values is to call the ``obj_with_variables.create_value(str)`` method, which automatically sets the ``_owner`` parameter to the correct object. diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index f22dcc8148..8882febf39 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -2,9 +2,11 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.definition import PadGeometryType, PadstackDef, PadstackDefData, PadType -from ansys.edb.core.layer import LayerType, StackupLayer -from ansys.edb.core.layout import Cell, CellType +from ansys.edb.core.definition.padstack_def import PadstackDef +from ansys.edb.core.definition.padstack_def_data import PadGeometryType, PadstackDefData, PadType +from ansys.edb.core.layer.layer import LayerType +from ansys.edb.core.layer.stackup_layer import StackupLayer +from ansys.edb.core.layout.cell import Cell, CellType from ansys.edb.core.session import session diff --git a/tests/e2e/integration_tests/test_padstack.py b/tests/e2e/integration_tests/test_padstack.py index e2041a6810..63f6d61a02 100644 --- a/tests/e2e/integration_tests/test_padstack.py +++ b/tests/e2e/integration_tests/test_padstack.py @@ -1,5 +1,6 @@ -from ansys.edb.core.definition import PadGeometryType, PadstackDef -from ansys.edb.core.layout import Cell +from ansys.edb.core.definition.padstack_def import PadstackDef +from ansys.edb.core.definition.padstack_def_data import PadGeometryType +from ansys.edb.core.layout.cell import Cell def test_get_hole_parameters(circuit_cell_with_padstack_def: Cell): diff --git a/tests/e2e/integration_tests/test_spiral_inductor.py b/tests/e2e/integration_tests/test_spiral_inductor.py index 638174f00b..ce85e92d6a 100644 --- a/tests/e2e/integration_tests/test_spiral_inductor.py +++ b/tests/e2e/integration_tests/test_spiral_inductor.py @@ -5,19 +5,16 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.definition import MaterialDef, MaterialProperty -from ansys.edb.core.geometry import PolygonData -from ansys.edb.core.hierarchy import ViaGroup -from ansys.edb.core.layer import ( - LayerCollection, - LayerCollectionMode, - LayerType, - StackupLayer, - ViaLayer, -) -from ansys.edb.core.layout import Cell, CellType -from ansys.edb.core.net import Net -from ansys.edb.core.primitive import ( +from ansys.edb.core.definition.material_def import MaterialDef, MaterialProperty +from ansys.edb.core.geometry.polygon_data import PolygonData +from ansys.edb.core.hierarchy.via_group import ViaGroup +from ansys.edb.core.layer.layer import LayerType +from ansys.edb.core.layer.layer_collection import LayerCollection, LayerCollectionMode +from ansys.edb.core.layer.stackup_layer import StackupLayer +from ansys.edb.core.layer.via_layer import ViaLayer +from ansys.edb.core.layout.cell import Cell, CellType +from ansys.edb.core.net.net import Net +from ansys.edb.core.primitive.primitive import ( Path, PathCornerType, PathEndCapType, @@ -26,13 +23,11 @@ RectangleRepresentationType, ) from ansys.edb.core.session import session -from ansys.edb.core.simulation_setup import ( - HfssSimulationSetup, - SingleFrequencyAdaptiveSolution, - SkinDepthMeshOperation, - SweepData, -) -from ansys.edb.core.terminal import PointTerminal +from ansys.edb.core.simulation_setup.adaptive_solutions import SingleFrequencyAdaptiveSolution +from ansys.edb.core.simulation_setup.hfss_simulation_setup import HfssSimulationSetup +from ansys.edb.core.simulation_setup.mesh_operation import SkinDepthMeshOperation +from ansys.edb.core.simulation_setup.simulation_setup import SweepData +from ansys.edb.core.terminal.terminals import PointTerminal # Wrapper class over Database # This will ensure clean entry and exit from database diff --git a/tests/e2e/scratch/sim_setup_scratch.py b/tests/e2e/scratch/sim_setup_scratch.py index 386134ac02..7cf6b9f485 100644 --- a/tests/e2e/scratch/sim_setup_scratch.py +++ b/tests/e2e/scratch/sim_setup_scratch.py @@ -1,28 +1,32 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.layout import Cell, CellType +from ansys.edb.core.layout.cell import Cell, CellType from ansys.edb.core.session import session -from ansys.edb.core.simulation_setup import ( +from ansys.edb.core.simulation_setup.adaptive_solutions import ( + BroadbandAdaptiveSolution, + MultiFrequencyAdaptiveSolution, + SingleFrequencyAdaptiveSolution, +) +from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( AdaptType, BasisFunctionOrder, - BroadbandAdaptiveSolution, HFSSAdvancedMeshingSettings, HFSSAdvancedSettings, HFSSDCRSettings, HFSSGeneralSettings, HFSSSettingsOptions, HFSSSimulationSettings, - HfssSimulationSetup, HFSSSolverSettings, + SolverType, +) +from ansys.edb.core.simulation_setup.hfss_simulation_setup import HfssSimulationSetup +from ansys.edb.core.simulation_setup.mesh_operation import ( LengthMeshOperation, - MultiFrequencyAdaptiveSolution, - SingleFrequencyAdaptiveSolution, SkinDepthMeshOperation, - SolverType, - SweepData, - ViaStyle, ) +from ansys.edb.core.simulation_setup.simulation_settings import ViaStyle +from ansys.edb.core.simulation_setup.simulation_setup import SweepData def do_hfss_sim_setup_test(hfss_sim_setup): diff --git a/tests/e2e/scratch/test_board_bend_def.py b/tests/e2e/scratch/test_board_bend_def.py index f84794b111..60a89cbc2f 100644 --- a/tests/e2e/scratch/test_board_bend_def.py +++ b/tests/e2e/scratch/test_board_bend_def.py @@ -1,12 +1,12 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.layer import Layer, LayerType +from ansys.edb.core.layer.layer import Layer, LayerType from ansys.edb.core.layer.layer_collection import LayerCollection, LayerCollectionMode -from ansys.edb.core.layout import Cell, CellType -from ansys.edb.core.primitive import BoardBendDef, Rectangle, RectangleRepresentationType +from ansys.edb.core.layout.cell import Cell, CellType +from ansys.edb.core.primitive.primitive import BoardBendDef, Rectangle, RectangleRepresentationType from ansys.edb.core.session import session -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value def do_test(): diff --git a/tests/e2e/scratch/test_component_property.py b/tests/e2e/scratch/test_component_property.py index 922472f476..af55b59f44 100644 --- a/tests/e2e/scratch/test_component_property.py +++ b/tests/e2e/scratch/test_component_property.py @@ -1,23 +1,19 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.definition import ( - ComponentDef, - DieOrientation, - DieProperty, - DieType, - ICComponentProperty, - IOComponentProperty, - PackageDef, - PortProperty, - RLCComponentProperty, - SolderBallProperty, - SolderballShape, -) -from ansys.edb.core.hierarchy import ComponentGroup, ComponentType, PinPairModel -from ansys.edb.core.layout import Cell, CellType +from ansys.edb.core.definition.component_def import ComponentDef +from ansys.edb.core.definition.die_property import DieOrientation, DieProperty, DieType +from ansys.edb.core.definition.ic_component_property import ICComponentProperty +from ansys.edb.core.definition.io_component_property import IOComponentProperty +from ansys.edb.core.definition.package_def import PackageDef +from ansys.edb.core.definition.port_property import PortProperty +from ansys.edb.core.definition.rlc_component_property import RLCComponentProperty +from ansys.edb.core.definition.solder_ball_property import SolderBallProperty, SolderballShape +from ansys.edb.core.hierarchy.component_group import ComponentGroup, ComponentType +from ansys.edb.core.hierarchy.pin_pair_model import PinPairModel +from ansys.edb.core.layout.cell import Cell, CellType from ansys.edb.core.session import session -from ansys.edb.core.utility import Rlc +from ansys.edb.core.utility.rlc import Rlc def do_test(): diff --git a/tests/e2e/scratch/test_power_module.py b/tests/e2e/scratch/test_power_module.py index 9c5a4034df..982ac20e06 100644 --- a/tests/e2e/scratch/test_power_module.py +++ b/tests/e2e/scratch/test_power_module.py @@ -1,7 +1,8 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.layout import Cell, CellType, PowerModule, VoltageRegulator +from ansys.edb.core.layout.cell import Cell, CellType +from ansys.edb.core.layout.voltage_regulator import PowerModule, VoltageRegulator from ansys.edb.core.session import launch_session diff --git a/tests/e2e/scratch/test_value.py b/tests/e2e/scratch/test_value.py index 523f8e327c..102fc7670c 100644 --- a/tests/e2e/scratch/test_value.py +++ b/tests/e2e/scratch/test_value.py @@ -1,12 +1,13 @@ import settings from ansys.edb.core.database import Database -from ansys.edb.core.layer import LayerType, StackupLayer -from ansys.edb.core.layout import Cell, CellType -from ansys.edb.core.net import Net -from ansys.edb.core.primitive import Circle +from ansys.edb.core.layer.layer import LayerType +from ansys.edb.core.layer.stackup_layer import StackupLayer +from ansys.edb.core.layout.cell import Cell, CellType +from ansys.edb.core.net.net import Net +from ansys.edb.core.primitive.primitive import Circle from ansys.edb.core.session import launch_session -from ansys.edb.core.utility import Value +from ansys.edb.core.utility.value import Value def test_value(): diff --git a/tests/mock/test_arc_data.py b/tests/mock/test_arc_data.py index 84a5f23357..69f5e4ae56 100644 --- a/tests/mock/test_arc_data.py +++ b/tests/mock/test_arc_data.py @@ -5,7 +5,8 @@ import pytest from utils.fixtures import * # noqa -from ansys.edb.core import geometry, utility +from ansys.edb.core.geometry import arc_data, polygon_data +from ansys.edb.core.utility import value @pytest.mark.parametrize( @@ -20,9 +21,9 @@ ], ) def test_height(mocked_stub, args, kwargs, expect_call): - mock = mocked_stub(geometry.arc_data, geometry.arc_data.ArcData).GetHeight + mock = mocked_stub(arc_data, arc_data.ArcData).GetHeight mock.return_value = wrappers_pb2.FloatValue(value=2) - _ = geometry.ArcData(*args, **kwargs).height + _ = arc_data.ArcData(*args, **kwargs).height if expect_call: mock.assert_called_once() @@ -31,10 +32,10 @@ def test_height(mocked_stub, args, kwargs, expect_call): test_arcs = [ - geometry.ArcData((1, 1), (2, 2)), - geometry.ArcData((1, 1), (1 - 1e-10, 1 + 1e-10)), - geometry.ArcData((1, 1), (1, 1), height=1e9), - geometry.ArcData((1, 1), (1 - 1e-8, 1 + 1e-8)), + arc_data.ArcData((1, 1), (2, 2)), + arc_data.ArcData((1, 1), (1 - 1e-10, 1 + 1e-10)), + arc_data.ArcData((1, 1), (1, 1), height=1e9), + arc_data.ArcData((1, 1), (1 - 1e-8, 1 + 1e-8)), ] @@ -53,12 +54,12 @@ def test_is_point(arc, tol, is_point): def test_center(mocked_stub): - mock = mocked_stub(geometry, geometry.ArcData).GetCenter + mock = mocked_stub(arc_data, arc_data.ArcData).GetCenter mock.return_value = point_data_pb2.PointMessage( x=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=2)), y=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=2)), ) - arc = geometry.ArcData((2, 0), (0, 2), height=2.0) + arc = arc_data.ArcData((2, 0), (0, 2), height=2.0) center = arc.center mock.assert_called_once() assert center.x == 2 @@ -66,7 +67,7 @@ def test_center(mocked_stub): def test_bbox(mocked_stub): - mock = mocked_stub(geometry, geometry.ArcData) + mock = mocked_stub(arc_data, arc_data.ArcData) mock.GetBoundingBox.return_value = point_data_pb2.BoxMessage( lower_left=point_data_pb2.PointMessage( x=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=0)), @@ -77,40 +78,40 @@ def test_bbox(mocked_stub): y=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=4)), ), ) - arc = geometry.ArcData((0, 0), (3, 4)) + arc = arc_data.ArcData((0, 0), (3, 4)) bbox = arc.bbox assert len(bbox) == 4 - assert bbox.points == geometry.PolygonData(lower_left=(0, 0), upper_right=(3, 4)).points + assert bbox.points == polygon_data.PolygonData(lower_left=(0, 0), upper_right=(3, 4)).points @pytest.mark.parametrize( "height, is_big", [[0, False], [2.4, False], [2.6, True], [-2.4, False], [-2.6, True]] ) def test_is_big(height, is_big): - arc = geometry.ArcData(start=(0, 0), end=(3, 4), height=height) - assert utility.Value(arc.start.distance(arc.end)).equals(5, 1e-6) + arc = arc_data.ArcData(start=(0, 0), end=(3, 4), height=height) + assert value.Value(arc.start.distance(arc.end)).equals(5, 1e-6) assert arc.is_big() == is_big @pytest.mark.parametrize( "expect_call, height, arc, length", [ - [False, 0, geometry.ArcData(start=(0, 0), end=(3, 4), height=0), 5], + [False, 0, arc_data.ArcData(start=(0, 0), end=(3, 4), height=0), 5], [ True, 1, - geometry.ArcData(start=(0, 0), end=(3, 4), radius=1, direction="cw", is_big=False), + arc_data.ArcData(start=(0, 0), end=(3, 4), radius=1, direction="cw", is_big=False), math.acos(1) / 4, ], ], ) def test_length(mocked_stub, expect_call, height, arc, length): - mock = mocked_stub(geometry, geometry.ArcData) + mock = mocked_stub(arc_data, arc_data.ArcData) mock.GetHeight.return_value = wrappers_pb2.FloatValue(value=1) mock.GetRadius.return_value = wrappers_pb2.FloatValue(value=2) mock.GetAngle.return_value = wrappers_pb2.FloatValue(value=math.acos(1) / 8) - assert utility.Value(arc.length).equals(length, 1e-6) + assert value.Value(arc.length).equals(length, 1e-6) if expect_call: mock.GetRadius.assert_called_once() mock.GetAngle.assert_called_once() @@ -120,28 +121,28 @@ def test_length(mocked_stub, expect_call, height, arc, length): def test_angle(mocked_stub): - mock = mocked_stub(geometry, geometry.ArcData) + mock = mocked_stub(arc_data, arc_data.ArcData) mock.GetAngle.return_value = wrappers_pb2.FloatValue(value=0.5) - arc = geometry.ArcData(start=(0, 0), end=(3, 4)) + arc = arc_data.ArcData(start=(0, 0), end=(3, 4)) assert arc.angle() == 0.5 mock.GetAngle.assert_called_once() - arc1 = geometry.ArcData(start=(0, 0), end=(3, 4)) - arc2 = geometry.ArcData(start=(0, 0), end=(-3, -4)) + arc1 = arc_data.ArcData(start=(0, 0), end=(3, 4)) + arc2 = arc_data.ArcData(start=(0, 0), end=(-3, -4)) arc1.angle(arc2) @pytest.mark.parametrize( "arc, tangent", [ - [geometry.ArcData(start=(0, 0), end=(3, 4)), (3, 4)], - [geometry.ArcData(start=(0, 0), end=(3, 4), height=-0.1), (-4, 3)], - [geometry.ArcData(start=(0, 0), end=(3, 4), height=+0.1), (4, -3)], + [arc_data.ArcData(start=(0, 0), end=(3, 4)), (3, 4)], + [arc_data.ArcData(start=(0, 0), end=(3, 4), height=-0.1), (-4, 3)], + [arc_data.ArcData(start=(0, 0), end=(3, 4), height=+0.1), (4, -3)], ], ) def test_tangent_at(mocked_stub, arc, tangent): - mock = mocked_stub(geometry, geometry.ArcData) + mock = mocked_stub(arc_data, arc_data.ArcData) mock.GetCenter.return_value = point_data_pb2.PointMessage( x=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=0)), y=edb_messages_pb2.ValueMessage(constant=edb_messages_pb2.ComplexMessage(real=0)), diff --git a/tests/mock/test_database.py b/tests/mock/test_database.py index 06f5b91c36..dc5eeec89e 100644 --- a/tests/mock/test_database.py +++ b/tests/mock/test_database.py @@ -5,7 +5,7 @@ from ansys.edb.core import database as database from ansys.edb.core.inner.messages import bool_message, empty_message, int64_message, str_message -from ansys.edb.core.layout import Cell +from ansys.edb.core.layout.cell import Cell # Helper fixtures and functions diff --git a/tests/mock/test_terminals.py b/tests/mock/test_terminals.py index 2311f09179..b87ccc3678 100644 --- a/tests/mock/test_terminals.py +++ b/tests/mock/test_terminals.py @@ -3,11 +3,12 @@ from utils.fixtures import * # noqa from utils.test_utils import create_edb_obj_msgs, equals -from ansys.edb.core import layer as layer_api -from ansys.edb.core import terminal from ansys.edb.core.geometry.point_data import PointData from ansys.edb.core.inner import messages -from ansys.edb.core.utility import PortPostProcessingProp, Rlc +from ansys.edb.core.layer import layer as layer_api +from ansys.edb.core.terminal import terminals as terminal +from ansys.edb.core.utility.port_post_processing_prop import PortPostProcessingProp +from ansys.edb.core.utility.rlc import Rlc @pytest.fixture diff --git a/tests/mock/utils/fixtures.py b/tests/mock/utils/fixtures.py index 0ed0fffdcf..1826ed2300 100644 --- a/tests/mock/utils/fixtures.py +++ b/tests/mock/utils/fixtures.py @@ -3,9 +3,9 @@ import pytest -from ansys.edb.core.layer import Layer -from ansys.edb.core.layout import Layout -from ansys.edb.core.net import Net +from ansys.edb.core.layer.layer import Layer +from ansys.edb.core.layout.layout import Layout +from ansys.edb.core.net.net import Net from .test_utils import create_edb_obj_msg, generate_random_int