From 53259d41a35c15935d095ef3389c1f27b262065b Mon Sep 17 00:00:00 2001 From: Kathy Pippert <84872299+PipKat@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:31:04 -0500 Subject: [PATCH] D338: Doc/overall review_part2 (#341) * Overall doc review--edit of base RST files * Fix codespell herror * Apply suggestions from code review Co-authored-by: SMoraisAnsys <146729917+SMoraisAnsys@users.noreply.github.com> * Fix link target * add missing link targets * Fix file name in overall index.rst file * Fix link to Contribute topic in README * Submit RST file edits based on HTML rendering * Edit PY files in core/definition * Edits to definition PY files based on doc rendering Edits to geometry PY files * Fix code style issues * Edits to hierarchy PY files * Edits in inner PY files * Edits to PY files * Fix formatting issues from late Friday * Push first-round edits to PY files not yet reviwewd * Update src/ansys/edb/core/geometry/point3d_data.py * Fix code style issue * Format properties and defaults consistently * Fix tagging mistake * Fix another tag * Fix bad role tagging * Clean up of PY files through middle of geometry directory * Changes through geometry folder * Additoinal edits based on visual rendering of additional PY files * Edit RN RST file * Fix one more tag issue --------- Co-authored-by: SMoraisAnsys <146729917+SMoraisAnsys@users.noreply.github.com> --- README.rst | 2 +- doc/source/api/hierarchy.rst | 4 +- doc/source/api/release_notes.rst | 2 +- src/ansys/edb/core/database.py | 176 ++----- src/ansys/edb/core/definition/bondwire_def.py | 69 ++- .../edb/core/definition/component_def.py | 16 +- .../edb/core/definition/component_model.py | 4 +- .../edb/core/definition/component_pin.py | 16 +- .../edb/core/definition/component_property.py | 14 +- src/ansys/edb/core/definition/dataset_def.py | 6 +- src/ansys/edb/core/definition/debye_model.py | 6 +- src/ansys/edb/core/definition/die_property.py | 6 +- .../definition/dielectric_material_model.py | 4 +- .../core/definition/ic_component_property.py | 8 +- .../core/definition/io_component_property.py | 4 +- src/ansys/edb/core/definition/material_def.py | 98 ++-- .../material_property_thermal_modifier.py | 16 +- src/ansys/edb/core/definition/package_def.py | 27 +- src/ansys/edb/core/definition/padstack_def.py | 15 +- .../edb/core/definition/padstack_def_data.py | 149 +++--- .../edb/core/definition/port_property.py | 12 +- .../core/definition/solder_ball_property.py | 14 +- src/ansys/edb/core/edb_defs.py | 2 +- src/ansys/edb/core/geometry/arc_data.py | 117 ++--- src/ansys/edb/core/geometry/point3d_data.py | 36 +- src/ansys/edb/core/geometry/point_data.py | 107 ++-- src/ansys/edb/core/geometry/polygon_data.py | 183 +++---- src/ansys/edb/core/geometry/r_tree.py | 107 ++-- .../edb/core/geometry/triangle3d_data.py | 10 +- src/ansys/edb/core/hierarchy/cell_instance.py | 60 ++- .../edb/core/hierarchy/component_group.py | 30 +- src/ansys/edb/core/hierarchy/group.py | 28 +- src/ansys/edb/core/hierarchy/hierarchy_obj.py | 38 +- src/ansys/edb/core/hierarchy/inst_array.py | 40 +- src/ansys/edb/core/hierarchy/model.py | 6 +- src/ansys/edb/core/hierarchy/netlist_model.py | 8 +- src/ansys/edb/core/hierarchy/pin_group.py | 34 +- .../edb/core/hierarchy/pin_pair_model.py | 13 +- .../edb/core/hierarchy/sparameter_model.py | 14 +- src/ansys/edb/core/hierarchy/spice_model.py | 26 +- src/ansys/edb/core/hierarchy/structure3d.py | 25 +- src/ansys/edb/core/hierarchy/via_group.py | 35 +- src/ansys/edb/core/inner/base.py | 29 +- src/ansys/edb/core/inner/conn_obj.py | 47 +- src/ansys/edb/core/inner/edb_logging.py | 102 ++-- src/ansys/edb/core/inner/exceptions.py | 22 +- src/ansys/edb/core/inner/factory.py | 4 +- src/ansys/edb/core/inner/interceptors.py | 10 +- src/ansys/edb/core/inner/layout_obj.py | 26 +- src/ansys/edb/core/inner/messages.py | 306 +++++------ src/ansys/edb/core/inner/parser.py | 72 +-- src/ansys/edb/core/inner/utils.py | 8 +- src/ansys/edb/core/inner/variable_server.py | 108 ++-- src/ansys/edb/core/layer/layer.py | 75 +-- src/ansys/edb/core/layer/layer_collection.py | 126 +++-- src/ansys/edb/core/layer/stackup_layer.py | 49 +- src/ansys/edb/core/layer/via_layer.py | 15 +- src/ansys/edb/core/layout/cell.py | 118 ++--- src/ansys/edb/core/layout/layout.py | 147 +++--- src/ansys/edb/core/layout/mcad_model.py | 88 ++-- .../edb/core/layout/voltage_regulator.py | 95 ++-- .../core/layout_instance/layout_instance.py | 52 +- .../layout_instance_context.py | 36 +- .../layout_instance/layout_obj_instance.py | 45 +- .../layout_obj_instance_2d_geometry.py | 6 +- .../layout_obj_instance_3d_geometry.py | 14 +- .../layout_obj_instance_geometry.py | 16 +- src/ansys/edb/core/net/differential_pair.py | 55 +- src/ansys/edb/core/net/extended_net.py | 30 +- src/ansys/edb/core/net/net.py | 70 +-- src/ansys/edb/core/net/net_class.py | 47 +- src/ansys/edb/core/primitive/primitive.py | 476 +++++++++-------- src/ansys/edb/core/session.py | 16 +- .../simulation_setup/adaptive_solutions.py | 63 ++- .../hfss_simulation_settings.py | 66 +-- .../simulation_setup/hfss_simulation_setup.py | 16 +- .../core/simulation_setup/mesh_operation.py | 128 ++--- .../raptor_x_simulation_settings.py | 65 +-- .../raptor_x_simulation_setup.py | 12 +- .../simulation_setup/simulation_settings.py | 22 +- .../core/simulation_setup/simulation_setup.py | 8 +- .../siwave_dcir_simulation_settings.py | 28 +- .../siwave_dcir_simulation_setup.py | 14 +- .../siwave_simulation_settings.py | 80 +-- .../siwave_simulation_setup.py | 12 +- src/ansys/edb/core/terminal/terminals.py | 493 ++++-------------- src/ansys/edb/core/typing/__init__.py | 2 +- src/ansys/edb/core/utility/conversions.py | 11 +- src/ansys/edb/core/utility/heat_sink.py | 18 +- .../edb/core/utility/hfss_extent_info.py | 118 ++--- src/ansys/edb/core/utility/layer_map.py | 28 +- ...terial_property_thermal_modifier_params.py | 60 ++- .../core/utility/port_post_processing_prop.py | 66 +-- src/ansys/edb/core/utility/rlc.py | 77 +-- .../edb/core/utility/temperature_settings.py | 7 +- src/ansys/edb/core/utility/transform.py | 38 +- src/ansys/edb/core/utility/transform3d.py | 65 +-- src/ansys/edb/core/utility/value.py | 117 ++--- 98 files changed, 2597 insertions(+), 2914 deletions(-) diff --git a/README.rst b/README.rst index 620bc7d555..aaed12a532 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ The documentation has five sections: - `API reference `_: Provides API member descriptions and usage examples. - `Examples `_: Provides examples showing -- end-to-end workflows for using PyEDB-Core. + end-to-end workflows for using PyEDB-Core. - `Contribute `_: Describes how to install PyEDB-Core in developer mode and how to contribute to this PyAnsys library. diff --git a/doc/source/api/hierarchy.rst b/doc/source/api/hierarchy.rst index 12c089980f..5eb87e317a 100644 --- a/doc/source/api/hierarchy.rst +++ b/doc/source/api/hierarchy.rst @@ -1,8 +1,8 @@ Hierarchy ========= -Hierarchy objects are :term:`Connectables ` that can act as a container for other :term:`Connectables `. -Sub-designs, MCAD Components, Coordinate systems etc.. are all examples of hierarchy objects. +Hierarchy objects are :term:`connectables ` that can act as a container for other :term:`connectables `. +Examples of hierarchy objects include subdesigns, MCAD components, and coordinate systems. Object types diff --git a/doc/source/api/release_notes.rst b/doc/source/api/release_notes.rst index 1b406b6680..ee8416330d 100644 --- a/doc/source/api/release_notes.rst +++ b/doc/source/api/release_notes.rst @@ -4,7 +4,7 @@ Release notes v1.0 ---- -Known issues: +**Known issues** * If a new database is opened after another one is closed, the server may fail to properly fetch objects that are created after the new database is opened. See `issue #154 `_. diff --git a/src/ansys/edb/core/database.py b/src/ansys/edb/core/database.py index ca120cc01a..3fb99b5511 100644 --- a/src/ansys/edb/core/database.py +++ b/src/ansys/edb/core/database.py @@ -37,7 +37,7 @@ class ProductIdType(Enum): """Provides an enum representing IDs of Ansys products that support EDB usage. - HFSS_3D_LAYOUT - - DESIGNER (Deprecated. Use HFSS_3D_LAYOUT instead.) + - DESIGNER (Deprecated. Use ``HFSS_3D_LAYOUT`` instead.) - SIWAVE - GENERIC_TRANSLATOR - USER_DEFINED @@ -67,12 +67,12 @@ def __init__(self, msg): @classmethod def create(cls, db_path): - """Create a database at the specified file location. + """Create a database in a given location. Parameters ---------- db_path : str - Path to the top-level database folder. + Path to the top-level database directory. Returns ------- @@ -83,19 +83,19 @@ def create(cls, db_path): @classmethod def open(cls, db_path, read_only): - """Open an existing database at the specified file location. + """Open a database in a given location. Parameters ---------- db_path : str - Path to the top-level database folder. + Path to the top-level database directory. read_only : bool Whether to open the database in read-only mode. Returns ------- Database object or None - Opened database object or ``None`` if no database object is found. + Database object opened or ``None`` if no database object is found. """ return Database( cls.__stub.Open( @@ -108,17 +108,17 @@ def open(cls, db_path, read_only): @classmethod def delete(cls, db_path): - """Delete a database at the specified file location. + """Delete a database in a given specified location. Parameters ---------- db_path : str - Path to the top-level database folder. + Path to the top-level database directory. """ cls.__stub.Delete(proto_wrappers.StringValue(value=db_path)) def save(self): - """Save any changes to a file.""" + """Save any changes to the database.""" self.__stub.Save(self.msg) def close(self): @@ -137,54 +137,27 @@ def _map_cell_edb_obj_collection(cells_msg): @property def top_circuit_cells(self): - """Top circuit cells in the database. - - Returns - ------- - list[:class:`Cell `] - """ + """: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): - """All circuit cells in the database. - - Returns - ------- - list[:class:`Cell `] - """ + """: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): - """All footprint cells in the database. - - Returns - ------- - list[:class:`Cell `] - """ + """:obj:`list` of :class:`Cell `: All footprint cells in the database.""" return Database._map_cell_edb_obj_collection(self.__stub.GetFootprints(self.msg)) @property def edb_uid(self): - """Unique EDB ID of the database. - - Returns - ------- - int - Unique EDB ID of the database. - """ + """:obj:`int`: Unique EDB ID of the database.""" return self.__stub.GetId(self.msg).value @property def is_read_only(self): - """Flag indicating if the database is open in read-only mode. - - Returns - ------- - bool - ``True`` when the database is open in read-only mode, ``False`` otherwise. - """ + """:obj:`bool`: Flag indicating if the database is open in read-only mode.""" return self.__stub.IsReadOnly(self.msg).value @classmethod @@ -210,8 +183,8 @@ def save_as(self, path, version=""): ---------- path : str Location for saving the new database file to. - version : str, optional - EDB version for the new database file. The default is ``""``, which means that + version : str, default: "" + EDB version for the new database file. The default is ``""``, in which case the new database file is saved for the current version. """ self.__stub.SaveAs( @@ -220,7 +193,7 @@ def save_as(self, path, version=""): @classmethod def get_version_by_release(cls, release): - """Get the EDB version corresponding to a given release name. + """Get the EDB version for a given release name. Parameters ---------- @@ -236,17 +209,11 @@ def get_version_by_release(cls, release): @property def directory(self): - """Directory of the database. - - Returns - ------- - str - Directory of the Database. - """ + """:obj:`str`: Directory where the database is located.""" return self.__stub.GetDirectory(self.msg).value def get_product_property(self, prod_id, attr_it): - """Get the product-specific property value. + """Get a product-specific property value. Parameters ---------- @@ -265,7 +232,7 @@ def get_product_property(self, prod_id, attr_it): ).value def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property associated with the given product and attribute IDs. + """Set the product property associated with the given product ID and attribute ID. Parameters ---------- @@ -281,7 +248,7 @@ def set_product_property(self, prod_id, attr_it, prop_value): ) def get_product_property_ids(self, prod_id): - """Get a list of attribute IDs corresponding to a product property ID. + """Get a list of attribute IDs for a given product property ID. Parameters ---------- @@ -307,9 +274,9 @@ def import_material_from_control_file(self, control_file, schema_dir=None, appen Full path to the control file. schema_dir : str Path to the schema directory. - append : bool, optional - Whether to keep existing materials in the database. The default is ``True``. If - ``False``, the existing materials in the database are removed. + append : bool, default: True + Whether to keep existing materials in the database. If ``False``, the + existing materials in the database are removed. """ self.__stub.ImportMaterialFromControlFile( database_pb2.ImportMaterialFromControlFileMessage( @@ -322,13 +289,7 @@ def import_material_from_control_file(self, control_file, schema_dir=None, appen @property def version(self): - """Version of the database. - - Returns - ------- - tuple(int, int) - Tuple of the version numbers [major, minor]. - """ + """:obj:`tuple` of (:obj:`int`, :obj:`int`): Version [major, minor] of the database.""" version_msg = self.__stub.GetVersion(self.msg) return version_msg.major.id, version_msg.minor.id @@ -344,15 +305,7 @@ def scale(self, scale_factor): @property def source(self): - """Source name for this database. - - This attribute is also used to set the source name. - - Returns - ------- - str - Name of the source - """ + """:obj:`str`: Name of the source database.""" return self.__stub.GetSource(self.msg).value @source.setter @@ -361,16 +314,7 @@ def source(self, source): @property def source_version(self): - """Source version for this database. - - This attribute is also used to set the version. - - Returns - ------- - str - version string - - """ + """:obj:`str`: Source version for the database.""" return self.__stub.GetSourceVersion(self.msg).value @source_version.setter @@ -378,7 +322,7 @@ def source_version(self, source_version): self.__stub.SetSourceVersion(edb_obj_name_message(self, source_version)) def copy_cells(self, cells_to_copy): - """Copy Cells from other databases or this database into this database. + """Copy cells from other databases or this database into this database. Parameters ---------- @@ -417,84 +361,52 @@ def _get_bondwire_definition_objs(self, def_class, bw_def_type_enum): @property def apd_bondwire_defs(self): - """All APD bondwire definitions in the database. - - Returns - ------- - list[:class:`ApdBondwireDef `] - """ + """: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): - """All JEDEC4 bondwire definitions in the database. - - Returns - ------- - list[:class:`Jedec4BondwireDef `] - """ + """: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): - """All JEDEC5 bondwire definitions in the database. - - Returns - ------- - list[:class:`Jedec5BondwireDef `] - """ + """: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): - """All padstack definitions in the database. - - Returns - ------- - list[:class:`PadstackDef `] - """ + """: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): - """All package definitions in the database. - - Returns - ------- - list[:class:`PackageDef `] - """ + """: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): - """All component definitions in the database. - - Returns - ------- - list[:class:`ComponentDef `] - """ + """: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): - """All material definitions in the database. - - Returns - ------- - list[:class:`MaterialDef `] - """ + """: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): - """All dataset definitions in the database. - - Returns - ------- - list[:class:`DatasetDef `] - """ + """: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/bondwire_def.py b/src/ansys/edb/core/definition/bondwire_def.py index 1941563227..c1d1ebaf03 100644 --- a/src/ansys/edb/core/definition/bondwire_def.py +++ b/src/ansys/edb/core/definition/bondwire_def.py @@ -67,19 +67,19 @@ class BondwireDef(ObjBase): @property def definition_type(self): - """:class:`DefinitionObjType`: type.""" + """:class:`DefinitionObjType`: Object type of the bondwire definition.""" return DefinitionObjType.BONDWIRE_DEF @property def name(self): """:obj:`str`: Name of the bondwire definition. - Read-Only. + This property is read-only. """ return self.__stub.GetName(self.msg) def delete(self): - """Delete a bondwire definition.""" + """Delete the bondwire definition.""" self.__stub.Delete(self.msg) @@ -92,11 +92,11 @@ class ApdBondwireDef(BondwireDef): @classmethod def create(cls, database, name): - """Create an APD bondwire definition. + """Create an APD bondwire definition in a given database. Parameters ---------- - database : :class:`Database `. + database : :class:`Database ` Database to create the APD bondwire definition in. name : str Name of the APD bondwire definition. @@ -111,12 +111,12 @@ def create(cls, database, name): @classmethod def load_definitions_from_file(cls, database, name): - """Load an APD bondwire definition into the given database. + """Load an APD bondwire definition into a given database. Parameters ---------- database : :class:`Database ` - Database to load the APD bondwire to. + Database to load the APD bondwire into. name : str Name of the APD bondwire definition. """ @@ -124,7 +124,7 @@ def load_definitions_from_file(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find an APD bondwire definition by name in the given database. + """Find an APD bondwire definition by name in a given database. Parameters ---------- @@ -143,30 +143,30 @@ def find_by_name(cls, database, name): ) def get_parameters(self): - """Get parameters of an APD bondwire definition. + """Get the parameters of the APD bondwire definition. Returns ------- str - String block of bondwire parameters. + String block of the bondwire parameters. """ return self.__stub.GetParameters(self.msg) def set_parameters(self, name): - """Set parameters of an APD bondwire definition. + """Set parameters of the APD bondwire definition. Parameters ---------- name : str - String block of bondwire parameters. + String block of the bondwire parameters. """ self.__stub.SetParameters(_QueryBuilder.bondwire_def_str_message(self, name)) @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the APD bondwire definition. + """:class:`BondwireDefType`: Type of the APD bondwire. - This attribute is read-only. + This property is read-only. """ return BondwireDefType.APD_BONDWIRE_DEF @@ -209,7 +209,7 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a JEDEC4 bondwire definition by name. + """Find a JEDEC4 bondwire definition by name in a given database. Parameters ---------- @@ -228,7 +228,7 @@ def find_by_name(cls, database, name): ) def get_parameters(self): - """Get parameters of a JEDEC4 bondwire definition. + """Get parameters of the JEDEC4 bondwire definition. Returns ------- @@ -238,7 +238,7 @@ def get_parameters(self): return Value(self.__stub.GetParameters(self.msg)) def set_parameters(self, top_to_die_distance): - """Set parameters of a JEDEC4 bondwire definition. + """Set parameters of the JEDEC4 bondwire definition. Parameters ---------- @@ -253,9 +253,9 @@ def set_parameters(self, top_to_die_distance): @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the JEDEC4 bondwire definition. + """:class:`BondwireDefType`: Type of the JEDEC4 bondwire. - This attribute is read-only. + This property is read-only. """ return BondwireDefType.JEDEC4_BONDWIRE_DEF @@ -305,7 +305,7 @@ def create(cls, database, name): Returns ------- Jedec5BondwireDef - Jedec5 Bondwire definition created. + JEDEC5 bondwire definition created. """ return Jedec5BondwireDef( cls.__stub.Create(_QueryBuilder.bondwire_def_str_message(database, name)) @@ -313,7 +313,7 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a JEDEC5 bondwire definition by name. + """Find a JEDEC5 bondwire definition by name in a given database. Parameters ---------- @@ -332,25 +332,18 @@ def find_by_name(cls, database, name): ) def get_parameters(self): - """Get parameters of a JEDEC5 bondwire definition. + """Get parameters of the JEDEC5 bondwire definition. Returns ------- - tuple[ - :class:`Value `, - :class:`Value `, - :class:`Value ` - ] - - Returns a tuple of the following format: - - **(top_to_die_distance,die_pad_angle,lead_pad_angle)** - - **top_to_die_distance** : Bondwire top to die distance. + tuple[:class:`Value `, :class:`Value `, \ + :class:`Value `] - **die_pad_angle** : Bondwire die pad angle. + The tuple is in this format: ``(top_to_die_distance,die_pad_angle,lead_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 ( @@ -360,7 +353,7 @@ def get_parameters(self): ) def set_parameters(self, top_to_die_distance, die_pad_angle, lead_pad_angle): - """Set parameters of a JEDEC5 bondwire definition. + """Set parameters of the JEDEC5 bondwire definition. Parameters ---------- @@ -379,8 +372,8 @@ def set_parameters(self, top_to_die_distance, die_pad_angle, lead_pad_angle): @property def bondwire_type(self): - """:class:`BondwireDefType`: Type of the JEDEC5 bondwire definition. + """:class:`BondwireDefType`: Type of the JEDEC5 bondwire. - This attribute is read-only. + This property is read-only. """ return BondwireDefType.JEDEC5_BONDWIRE_DEF diff --git a/src/ansys/edb/core/definition/component_def.py b/src/ansys/edb/core/definition/component_def.py index 371dcaaeda..3ef8ac4cb2 100644 --- a/src/ansys/edb/core/definition/component_def.py +++ b/src/ansys/edb/core/definition/component_def.py @@ -16,7 +16,7 @@ class ComponentDef(ObjBase): @classmethod def create(cls, db, comp_def_name, fp): - """Create a component definition. + """Create a component definition in a given database. Parameters ---------- @@ -38,7 +38,7 @@ def create(cls, db, comp_def_name, fp): @classmethod def find(cls, db, comp_def_name): - """Find a component definition in a database. + """Find a component definition in a given database. Parameters ---------- @@ -50,7 +50,7 @@ def find(cls, db, comp_def_name): Returns ------- ComponentDef - Component definition that was found or ``None`` otherwise. + Component definition found, ``None`` otherwise. """ return ComponentDef( cls.__stub.FindByName(messages.object_name_in_layout_message(db, comp_def_name)) @@ -58,7 +58,7 @@ def find(cls, db, comp_def_name): @property def definition_type(self): - """:class:`DefinitionObjType`: type.""" + """:class:`DefinitionObjType`: Definition type.""" return DefinitionObjType.COMPONENT_DEF @property @@ -82,9 +82,9 @@ def footprint(self, value): @property def component_models(self): """:obj:`list` of :class:`ComponentModel `: \ - List of component models associated with the component definition. + All component models associated with the component definition. - Read-Only. + This property is read-only. """ objs = self.__stub.GetComponentModels(self.msg).items return map_list(objs, component_model.ComponentModel) @@ -92,9 +92,9 @@ def component_models(self): @property def component_pins(self): """:obj:`list` of :class:`ComponentPin `: \ - List of component pins of the component definition. + All component pins of the component definition. - This attribute is read-only. + This property is read-only. """ objs = self.__stub.GetComponentPins(self.msg).items return map_list(objs, component_pin.ComponentPin) diff --git a/src/ansys/edb/core/definition/component_model.py b/src/ansys/edb/core/definition/component_model.py index 70c24c023e..0230d7c506 100644 --- a/src/ansys/edb/core/definition/component_model.py +++ b/src/ansys/edb/core/definition/component_model.py @@ -17,7 +17,7 @@ class ComponentModel(ObjBase): @property def reference_file(self): - """:obj:`str`: Name of the reference file associated with this component model.""" + """:obj:`str`: Name of the reference file associated with the component model.""" return self.__stub.GetReferenceFile(self.msg).value @reference_file.setter @@ -47,7 +47,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 ` instance. """ return NPortComponentModel(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 b4f652894d..af101b1790 100644 --- a/src/ansys/edb/core/definition/component_pin.py +++ b/src/ansys/edb/core/definition/component_pin.py @@ -13,14 +13,14 @@ class ComponentPin(ObjBase): @classmethod def create(cls, comp_def, name): - """Create a component pin. + """Create a component pin in a given component definition. Parameters ---------- comp_def : :class:`ComponentDef ` - Component definition that the component pin is to belong to. + Component definition to create the component pin in. name : str - Name of the component pin to create. + Name of the component pin. Returns ------- @@ -31,7 +31,7 @@ def create(cls, comp_def, name): @classmethod def find(cls, comp_def, name): - """Find a component pin in a component definition. + """Find a component pin in a given component definition. Parameters ---------- @@ -43,7 +43,7 @@ def find(cls, comp_def, name): Returns ------- ComponentPin - Component pin that was found, ``None`` otherwise. + Component pin found, ``None`` otherwise. """ return ComponentPin(cls.__stub.FindByName(messages.edb_obj_name_message(comp_def, name))) @@ -60,15 +60,15 @@ def name(self, value): def number(self): """:obj:`int`: Serial number of the component pin inside its component definition. - This attribute is read-only. + This property is read-only. """ return self.__stub.GetNumber(self.msg).value @property def component_def(self): - """:class:`ComponentDef `: Component definition that this component \ + """:class:`ComponentDef `: Component definition that the component \ pin belongs to. - This attribute is read-only. + This property is read-only. """ return component_def.ComponentDef(self.__stub.GetComponentDef(self.msg)) diff --git a/src/ansys/edb/core/definition/component_property.py b/src/ansys/edb/core/definition/component_property.py index d477fd2548..c5139e00df 100644 --- a/src/ansys/edb/core/definition/component_property.py +++ b/src/ansys/edb/core/definition/component_property.py @@ -20,15 +20,15 @@ def clone(self): Returns ------- ComponentProperty - Clone of the component property. + Component property cloned. """ return ComponentProperty(self.__stub.Clone(messages.edb_obj_message(self))) @property def package_mounting_offset(self): - """:class:`Value `: Offset of the package definition object. + """:class:`Value `: Mounting offset of the package definition object. - This attribute can be set with the :term:`ValueLike` term. + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetPackageMountingOffset(messages.edb_obj_message(self))) @@ -40,7 +40,7 @@ def package_mounting_offset(self, offset): @property def package_def(self): - """:obj:`PackageDef` : Package definition object.""" + """:obj:`PackageDef`: Package definition object.""" return package_def.PackageDef(self.__stub.GetPackageDef(messages.edb_obj_message(self))) @package_def.setter @@ -49,11 +49,9 @@ def package_def(self, value): @property def model(self): - """:class:`Model ` : Model object. + """:class:`Model `: Model object. - Returns - ------- - Copy of the model object. Use the setter for any modifications to be reflected. + 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)) diff --git a/src/ansys/edb/core/definition/dataset_def.py b/src/ansys/edb/core/definition/dataset_def.py index 40d7e356af..508b079f24 100644 --- a/src/ansys/edb/core/definition/dataset_def.py +++ b/src/ansys/edb/core/definition/dataset_def.py @@ -38,12 +38,12 @@ def create(cls, database, name): @classmethod def find_by_name(cls, database, name): - """Find a dataset definition in the database with a given name. + """Find a dataset definition by name in a given database. Parameters ---------- database : :class:`Database ` - Database that owns the dataset definition. + 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`: type.""" + """:class:`DefinitionObjType`: Definition type.""" return DefinitionObjType.DATASET_DEF @property diff --git a/src/ansys/edb/core/definition/debye_model.py b/src/ansys/edb/core/definition/debye_model.py index eac503bb8b..655259fa3d 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 whether the relative permitivity at optical frequency is enabled.""" + """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 whether the DC conductivity nominal value is used.""" + """bool: Flag indicating if the DC conductivity nominal value is used.""" return self.__stub.UseDCConductivity(self.msg).value @use_dc_conductivity.setter @@ -106,7 +106,7 @@ def use_dc_conductivity(self, enabled): @property def relative_permitivity_at_optical_frequency(self): - """:obj:`float`: Relative permitivity at optical frequency.""" + """:obj:`float`: Relative permitivity at the optical frequency.""" return self.__stub.GetRelativePermitivityAtOpticalFrequency(self.msg).value @relative_permitivity_at_optical_frequency.setter diff --git a/src/ansys/edb/core/definition/die_property.py b/src/ansys/edb/core/definition/die_property.py index 634acd5f12..b099215b46 100644 --- a/src/ansys/edb/core/definition/die_property.py +++ b/src/ansys/edb/core/definition/die_property.py @@ -59,7 +59,7 @@ def clone(self): Returns ------- DieProperty - Cloned die property created. + Die property cloned. """ return DieProperty(self.__stub.Clone(messages.edb_obj_message(self))) @@ -74,9 +74,9 @@ def die_type(self, value): @property def height(self): - """:class:`Value `: Height of the die property. + """:class:`Value `: Die height. - This attribute can be set with the :term:`ValueLike` term. + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetHeight(messages.edb_obj_message(self))) diff --git a/src/ansys/edb/core/definition/dielectric_material_model.py b/src/ansys/edb/core/definition/dielectric_material_model.py index 2f552c0b32..188ebdeae8 100644 --- a/src/ansys/edb/core/definition/dielectric_material_model.py +++ b/src/ansys/edb/core/definition/dielectric_material_model.py @@ -21,7 +21,7 @@ class DielectricMaterialModelType(Enum): class DielectricMaterialModel(ObjBase): - """Represents a dielectric material model object.""" + """Represents a dielectric material model.""" __stub: dielectric_material_model_pb2_grpc.DielectricMaterialModelServiceStub = ( session.StubAccessor(session.StubType.dielectric_material_model) @@ -29,5 +29,5 @@ class DielectricMaterialModel(ObjBase): @property def type(self): - """DielectricMaterialModelType: Type of dielectric material model.""" + """:class:`DielectricMaterialModelType`: Type of the dielectric material model.""" return DielectricMaterialModelType(self.__stub.GetType(self.msg).value) diff --git a/src/ansys/edb/core/definition/ic_component_property.py b/src/ansys/edb/core/definition/ic_component_property.py index 0e4a1c1a81..8f5a88b583 100644 --- a/src/ansys/edb/core/definition/ic_component_property.py +++ b/src/ansys/edb/core/definition/ic_component_property.py @@ -14,7 +14,7 @@ class ICComponentProperty(component_property.ComponentProperty): - """Representing an IC component property.""" + """Represents an IC component property.""" __stub: ICComponentPropertyServiceStub = StubAccessor(StubType.ic_component_property) @@ -32,7 +32,7 @@ def create(cls): @property def solder_ball_property(self): - """:obj:`SolderBallProperty` : Solder ball property. + """:obj:`SolderBallProperty`: Solder ball property. A copy is returned. Use the setter for any modifications to be reflected. """ @@ -48,7 +48,7 @@ def solder_ball_property(self, value): @property def die_property(self): - """:obj:`DieProperty` : Die property. + """:obj:`DieProperty`: Die property. A copy is returned. Use the setter for any modifications to be reflected. """ @@ -60,7 +60,7 @@ def die_property(self, value): @property def port_property(self): - """:obj:`PortProperty` : Port property. + """:obj:`PortProperty`: Port property. A copy is returned. Use the setter for any modifications to be reflected. """ diff --git a/src/ansys/edb/core/definition/io_component_property.py b/src/ansys/edb/core/definition/io_component_property.py index 39b005939a..b772727a8b 100644 --- a/src/ansys/edb/core/definition/io_component_property.py +++ b/src/ansys/edb/core/definition/io_component_property.py @@ -27,7 +27,7 @@ def create(cls): @property def solder_ball_property(self): - """:obj:`SolderBallProperty` : Solder ball property. + """:obj:`SolderBallProperty`: Solder ball property. A copy is returned. Use the setter for any modifications to be reflected. """ @@ -43,7 +43,7 @@ def solder_ball_property(self, value): @property def port_property(self): - """:obj:`PortProperty` : Port property. + """:obj:`PortProperty`: Port property. A copy is returned. Use the setter for any modifications to be reflected. """ diff --git a/src/ansys/edb/core/definition/material_def.py b/src/ansys/edb/core/definition/material_def.py index d479a0c9e1..1b01ddb66a 100644 --- a/src/ansys/edb/core/definition/material_def.py +++ b/src/ansys/edb/core/definition/material_def.py @@ -12,7 +12,7 @@ class MaterialProperty(Enum): - """Provides an enum representing property types. + """Provides an enum representing material property types. - PERMITTIVITY Permittivity property. @@ -29,11 +29,11 @@ class MaterialProperty(Enum): - MASS_DENSITY Mass density property. - SPECIFIC_HEAT - Specific Heat property. + Specific heat property. - YOUNGS_MODULUS - Youngs Modulus property. + Young's modulus property. - POISSONS_RATIO - Poissons Ratio property. + Poisson's ratio property. - THERMAL_EXPANSION_COEFFICIENT Thermal expansion coefficient property. - INVALID_PROPERTY @@ -145,7 +145,7 @@ class MaterialDef(ObjBase): @classmethod def create(cls, database, name, **kwargs): - """Create a material definition in the given database. + """Create a material definition in a given database. Parameters ---------- @@ -154,22 +154,21 @@ def create(cls, database, name, **kwargs): name : str Name of the material definition. kwargs : dict{ str : :class:`Value ` } - Dictionary to convert to MaterialDefPropertiesMessage. - Dictionary key is the material property name. - Dictionary value is the material property value. - Expected keys for kwargs are: - - - permittivity - - permeability - - conductivity - - dielectric_loss_tangent - - magnetic_loss_tangent - - thermal_conductivity - - mass_density - - specific_heat - - youngs_modulus - - poissons_ratio - - thermal_expansion_coefficient + 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: + + - ``permittivity`` + - ``permeability`` + - ``conductivity`` + - ``dielectric_loss_tangent`` + - ``magnetic_loss_tangent`` + - ``thermal_conductivity`` + - ``mass_density`` + - ``specific_heat`` + - ``youngs_modulus`` + - ``poissons_ratio`` + - ``thermal_expansion_coefficient`` Returns ------- @@ -180,7 +179,7 @@ def create(cls, database, name, **kwargs): @classmethod def find_by_name(cls, database, name): - """Find a material definition in the database by name. + """Find a material definition by name in a given database. Parameters ---------- @@ -192,7 +191,7 @@ def find_by_name(cls, database, name): Returns ------- MaterialDef - Naterial definition object found. + Naterial definition found. """ return MaterialDef(cls.__stub.FindByName(messages.edb_obj_name_message(database, name))) @@ -205,7 +204,7 @@ def definition_type(self): def name(self): """:obj:`str`: Name of the material definition. - This attribute is read-only. + This property is read-only. """ return self.__stub.GetName(messages.edb_obj_message(self)).value @@ -227,19 +226,19 @@ def delete(self): self.__stub.Delete(messages.edb_obj_message(self)) def set_property(self, material_property, value, component_id=None, col=None, row=None): - """Set a property value of the material. + """Set a material property for a given component. Parameters ---------- material_property : :class:`MaterialProperty` - Property ID. + ID of the material property. value : :class:`Value ` New value. - component_id : int, optional - Component ID. - row : int, optional + component_id : int, default: None + ID of the component. + row : int, default: None Tensor row. - col : int, optional + col : int, default: None Tensor column. """ self.__stub.SetProperty( @@ -251,14 +250,14 @@ def get_property(self, material_property, component_id=None, row=None, col=None) Parameters ---------- - material_property : :class:`MaterialProperty` - Property ID. The default is ``None``. - component_id : int, optional - Component ID. The default is ``None``. - row : int, optional - Tensor row. The default is ``None``. - col : int, optional - Tensor column. The default is ``None``. + material_property : :class:`MaterialProperty`, default: None + Material property ID. + component_id : int, default: None + Component ID. + row : int, default: None + Tensor row. + col : int, default: None + Tensor column. Returns ------- @@ -272,12 +271,12 @@ def get_property(self, material_property, component_id=None, row=None, col=None) ) def get_all_properties(self): - """Get all property value of the material. + """Get all properties of the material. Returns ------- - list [:class:`MaterialProperty`] - List of properties for the material definition. + list of :class:`MaterialProperty`` + All properties for the material definition. """ msg = self.__stub.GetAllProperties(messages.edb_obj_message(self)) return [MaterialProperty(i) for i in msg.properties] @@ -297,7 +296,7 @@ def remove_property(self, material_property): ) def get_dimensions(self, material_property_id): - """Get dimensions of a material definition. + """Get dimensions of a given material definition. Types are Simple 1x1, Anisotropic 3x1, and Tensor 3x3. @@ -311,13 +310,10 @@ def get_dimensions(self, material_property_id): ------- tuple[int, int] - Returns a tuple of the following format: - - **(col, row)** - - **col** : Number of rows of the material property. + The tuple is in a ``(col, row)`` format: - **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) @@ -325,7 +321,7 @@ def get_dimensions(self, material_property_id): return [msg.tensor.col, msg.tensor.row] def get_thermal_modifier(self, material_property_id): - """Get the thermal modifier of a material definition. + """Get the thermal modifier of a given material definition. Parameters ---------- @@ -362,7 +358,7 @@ def set_thermal_modifier(self, material_property_id, thermal_modifier): ) def get_anisotropic_thermal_modifier(self, material_property_id, component_id): - """Get the anisotropic thermal modifier of a material definition. + """Get the anisotropic thermal modifier of a given material definition. Parameters ---------- @@ -388,7 +384,7 @@ def get_anisotropic_thermal_modifier(self, material_property_id, component_id): def set_anisotropic_thermal_modifier( self, material_property_id, component_id, thermal_modifier ): - """Set the anisotropic thermal modifier of a material definition. + """Set the anisotropic thermal modifier of a given material definition. Parameters ---------- 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 5ee9f6a220..02e7aa1e5b 100644 --- a/src/ansys/edb/core/definition/material_property_thermal_modifier.py +++ b/src/ansys/edb/core/definition/material_property_thermal_modifier.py @@ -40,15 +40,17 @@ def create(cls, basic_quadratic_params=None, advanced_quadratic_params=None): Parameters ---------- - basic_quadratic_params: :class:`BasicQuadraticParams ` + basic_quadratic_params: :class:`BasicQuadraticParams `, \ + default: None Basic parameters needed for the thermal modifier. - advanced_quadratic_params : :class:`AdvancedQuadraticParams ` - Advanced parameeteres needed for the thermal modifier advanced parameters. + advanced_quadratic_params : :class:`AdvancedQuadraticParams `, \ + default: None + Advanced parameeteres needed for the thermal modifier. Returns ------- MaterialPropertyThermalModifier - Material property thermal modifiers created. + Material property thermal modifier created. """ if basic_quadratic_params is None: basic_quadratic_params = BasicQuadraticParams() @@ -66,11 +68,11 @@ def quadratic_model_params(self): :class:`AdvancedQuadraticParams `: \ Quadratic model parameters of the thermal modifier. - The quadratic model is of the following form: + 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 attribute is read-only. + This property is read-only. """ msg = self.__stub.GetQuadraticModelParams(messages.edb_obj_message(self)) return BasicQuadraticParams( @@ -89,6 +91,6 @@ def quadratic_model_params(self): def expression(self): """:class:`Value `: Expression value representing the thermal modifier. - This attribute is read-only. + This property is read-only. """ return Value(self.__stub.GetThermalModifierExpression(messages.edb_obj_message(self))) diff --git a/src/ansys/edb/core/definition/package_def.py b/src/ansys/edb/core/definition/package_def.py index 6fa0a28641..ca9b70721f 100644 --- a/src/ansys/edb/core/definition/package_def.py +++ b/src/ansys/edb/core/definition/package_def.py @@ -28,7 +28,7 @@ class PackageDef(ObjBase): @classmethod def create(cls, db, name): - """Create a package definition object. + """Create a package definition in a given database. Parameters ---------- @@ -40,12 +40,13 @@ def create(cls, db, name): Returns ------- PackageDef + Package definition created. """ return PackageDef(cls.__stub.Create(string_property_message(db, name))) @classmethod def find_by_name(cls, db, name): - """Find a package definition object by name. + """Find a package definition object by name in a given database. Parameters ---------- @@ -57,12 +58,13 @@ def find_by_name(cls, db, name): Returns ------- PackageDef + Package definition found, ``None`` otherwise. """ return PackageDef(cls.__stub.FindByName(string_property_message(db, name))) @classmethod def find_by_id(cls, db, uid): - """Find a package definition object by ID. + """Find a package definition object by ID in a given database. Parameters ---------- @@ -74,17 +76,18 @@ def find_by_id(cls, db, uid): Returns ------- PackageDef + Package definition found, ``None`` otherwise. """ return PackageDef(cls.__stub.FindByEDBUId(int_property_message(db, uid))) @property def definition_type(self): - """:class:`DefinitionObjType`: Type.""" + """:class:`DefinitionObjType`: Definition type.""" return DefinitionObjType.PACKAGE_DEF @property def name(self): - """:obj:`str`: Name of the package definition object.""" + """:obj:`str`: Name of the package definition.""" return self.__stub.GetName(edb_obj_message(self)).value @name.setter @@ -94,7 +97,7 @@ def name(self, value): @property @parser.to_polygon_data def exterior_boundary(self): - """:class:`PolygonData `: Exterior boundary for the package definition.""" + """:class:`PolygonData `: Exterior boundary of the package definition.""" return self.__stub.GetExteriorBoundary(edb_obj_message(self)) @exterior_boundary.setter @@ -157,7 +160,7 @@ def theta_jc(self, theta): @property def heat_sink(self): - """:class:`HeatSink `: Assigned heat sink model for 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, @@ -176,7 +179,7 @@ def delete(self): self.__stub.Delete(edb_obj_message(self)) def get_product_property(self, prod_id, attr_it): - """Get the product-specific property value. + """Get the product property for a given product ID and attribute ID. Parameters ---------- @@ -188,14 +191,14 @@ def get_product_property(self, prod_id, attr_it): Returns ------- str - Property value for the specified product and attribute IDs. + Product property for the given product ID and attribute ID. """ return self.__stub.GetProductProperty( get_product_property_message(self, prod_id, attr_it) ).value def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property associated with the given product and attribute IDs. + """Set the product property for the given product ID and attribute ID. Parameters ---------- @@ -211,7 +214,7 @@ def set_product_property(self, prod_id, attr_it, prop_value): ) def get_product_property_ids(self, prod_id): - """Get the list of attribute IDS for a given property ID. + """Get the list of property IDs for a given property ID. Parameters ---------- @@ -221,7 +224,7 @@ def get_product_property_ids(self, prod_id): Returns ------- list[int] - List of attribute IDs for the givens product ID. + Attribute IDs for the given product ID. """ attr_ids = self.__stub.GetProductPropertyIds( get_product_property_ids_message(self, prod_id) diff --git a/src/ansys/edb/core/definition/padstack_def.py b/src/ansys/edb/core/definition/padstack_def.py index f19674159f..4858af1cc6 100644 --- a/src/ansys/edb/core/definition/padstack_def.py +++ b/src/ansys/edb/core/definition/padstack_def.py @@ -53,19 +53,19 @@ class PadstackDef(ObjBase): @classmethod def create(cls, db, name): - """Create a padstack definition object. + """Create a padstack definition in a given database. Parameters ---------- db : :class:`Database ` - Database object to create the padstack definition in. + Database to create the padstack definition in. name : str Data to set on the padstack definition. Returns ------- PadstackDef - Padstack definition created in the given database. + Padstack definition created. """ return PadstackDef( cls.__stub.Create(_PadstackDefQueryBuilder.padstack_def_string_message(db, name)) @@ -73,7 +73,7 @@ def create(cls, db, name): @classmethod def find_by_name(cls, db, name): - """Find a padstack definition by name. + """Find a padstack definition by name in a given database. Parameters ---------- @@ -85,6 +85,7 @@ def find_by_name(cls, db, name): Returns ------- PadstackDef + Padstack definition found. """ return PadstackDef( cls.__stub.FindByName(_PadstackDefQueryBuilder.padstack_def_string_message(db, name)) @@ -92,21 +93,21 @@ def find_by_name(cls, db, name): @property def definition_type(self): - """:class:`DefinitionObjType`: Type.""" + """:class:`DefinitionObjType`: Definition type.""" return DefinitionObjType.PADSTACK_DEF @property def name(self): """:obj:`str`: Name of the padstack definition. - This attribute is read-only. + This property is read-only. """ return self.__stub.GetName(self.msg).value @property def data(self): """:class:`PadstackDefData `: \ - Data of the Padstack definition.""" + Data for the padstack definition.""" return PadstackDefData(self.__stub.GetData(self.msg)) @data.setter diff --git a/src/ansys/edb/core/definition/padstack_def_data.py b/src/ansys/edb/core/definition/padstack_def_data.py index 9343985fb0..06fceb3271 100644 --- a/src/ansys/edb/core/definition/padstack_def_data.py +++ b/src/ansys/edb/core/definition/padstack_def_data.py @@ -15,7 +15,7 @@ class _PadstackDefDataQueryBuilder: - """Provides for creating gRPC messages for padstack definition data.""" + """Provides for creating gRPC messages for padstack data definition.""" if TYPE_CHECKING: from padstack_def_data import PadstackDefData @@ -185,17 +185,17 @@ class PadGeometryType(Enum): - PADGEOMTYPE_BULLET Bullet shape. - PADGEOMTYPE_NSIDED_POLYGON - N-sided polygon. + N-sided polygon shape. - PADGEOMTYPE_POLYGON Polygonal shape. - PADGEOMTYPE_ROUND45 - Round gap with 45 degree thermal ties. + Round gap with 45-degree thermal ties. - PADGEOMTYPE_ROUND90 - Round gap with 90 degree thermal ties. + Round gap with 90-degree thermal ties. - PADGEOMTYPE_SQUARE45 - Square gap with 45 degree thermal ties. + Square gap with 45-degree thermal ties. - PADGEOMTYPE_SQUARE90 - Square gap with 90 degree thermal ties. + Square gap with 90-degree thermal ties. - PADGEOMTYPE_INVALID_GEOMETRY Invalid geometry. """ @@ -221,11 +221,11 @@ class PadstackHoleRange(Enum): - THROUGH Hole through all layers of the board. - BEGIN_ON_UPPER_PAD - Hole from upper pad to the bottom of the board. + Hole from the upper pad to the bottom of the board. - END_ON_LOWER_PAD - Hole from top of board to lower pad. + Hole from the top of the board to the lower pad. - UPPER_PAD_TO_LOWER_PAD - Hole from upper pad to lower pad. + Hole from the upper pad to the lower pad. - UNKNOWN_RANGE Undefined hole range. """ @@ -238,7 +238,7 @@ class PadstackHoleRange(Enum): class SolderballShape(Enum): - """Provides an enum representing solderball shapes. + """Provides an enum representing solder ball shapes. - NO_SOLDERBALL No solder ball. @@ -257,7 +257,7 @@ class SolderballShape(Enum): class SolderballPlacement(Enum): - """Provides an enum representing solderball placement. + """Provides an enum representing solder ball placement. - ABOVE_PADSTACK Solder ball is placed above the padstack. @@ -291,7 +291,7 @@ def create(cls): @property def material(self): - """:obj:`str`: Material name of the hole of the padstack definition daata object.""" + """:obj:`str`: Material name of the hole of the padstack definition data object.""" return self.__stub.GetMaterial(self.msg) @material.setter @@ -304,23 +304,23 @@ def material(self, name): def layer_names(self): """:obj:`list` of :obj:`str`: List of layer names in the padstack definition data object. - This attribute is read-only. + This property is read-only. """ layer_names_msg = self.__stub.GetLayerNames(self.msg).names return layer_names_msg @property def layer_ids(self): - """:obj:`list` of :obj:`int`: List of layer IDs in the padstack definition data object. + """:obj:`list` of :obj:`int`: All layer IDs in the padstack definition data object. - Read-Only. + This property is read-only. """ layer_ids_msg = self.__stub.GetLayerIds(self.msg) return layer_ids_msg.ids def add_layers(self, names): """ - Add a list of layers of given names to the padstack definition data object. + Add layers to the padstack definition data object. Parameters ---------- @@ -333,47 +333,37 @@ def add_layers(self, names): def get_pad_parameters(self, layer, pad_type): """ - Get a pad's parameters by layer name and pad type in its original value in the database. + Get pad parameters by layer name and pad type in their original values in the database. Parameters ---------- layer : Union[str, int, None] + Layer name. pad_type : PadType + Pad type. Returns ------- - tuple[:class:`PadGeometryType`, - list[:class:`Value `], - :class:`Value `, - :class:`Value `, - :class:`Value `] - - or - - tuple[:class:`PolygonData `, - :class:`Value `, - :class:`Value `, - :class:`Value `] - - Returns a tuple of the following format: - - **(pad_type, sizes, offset_x, offset_y, rotation)** - - or accordingly if geometry shape is polygon then + tuple[:class:`PadGeometryType`, list of :class:`Value `, \ + :class:`Value `, :class:`Value `, + :class:`Value `] - **(fp, offset_x, offset_y, rotation)** + or - **pad_type** : Pad type. + tuple[:class:`PolygonData `, \ + :class:`Value `, \ + :class:`Value `, :class:`Value `] - **sizes** : Pad parameters. + The tuple is in this format for other than polygons: ``(pad_type, sizes, offset_x, offset_y, rotation)``. - **offset_x** : X offset. + For polygons, the tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. - **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( @@ -400,7 +390,7 @@ def set_pad_parameters( self, layer, pad_type, offset_x, offset_y, rotation, type_geom=None, sizes=None, fp=None ): """ - Set a pad's parameters by layer name and pad type in its original value in the database. + Set pad parameters by layer name and pad type in their original values in the database. Parameters ---------- @@ -414,11 +404,11 @@ def set_pad_parameters( Y offset. rotation : :class:`Value ` Rotation. - type_geom : PadGeometryType, optional + type_geom : PadGeometryType, default: None Pad geometry type. The default is ``None`` if setting polygonal pad parameters. - sizes : List[:class:`Value `] - Pad sizes. The default is ``None`` if setting polygonal pad parameters. - fp : :class:`PolygonData ` + sizes : List[:class:`Value `], default: None + List of pad sizes. The default is ``None`` if setting polygonal pad parameters. + fp : :class:`PolygonData `, default: None Polygon geometry. The default is ``None`` if not setting polygonal pad parameters. """ self.__stub.SetPadParameters( @@ -433,24 +423,16 @@ def get_hole_parameters(self): Returns ------- - tuple[ - :class:`PolygonData `, - :class:`Value `, - :class:`Value `, - :class:`Value ` - ] - - Returns a tuple of the following format: - - **(fp, offset_x, offset_y, rotation)** - - **fp** : Polygon geometry. + tuple[:class:`PolygonData `, \ + :class:`Value `, \ + :class:`Value `, :class:`Value `] - **offset_x** : X offset. + The tuple is in this format: ``(fp, offset_x, offset_y, rotation)``. - **offset_y** : Y offset. - - **rotation** : Rotation. + - ``fp``: Polygon geometry + - ``offset_x``: X offset + - ``offset_y``: Y offset + - ``rotation`` : Rotation """ return self.get_pad_parameters(None, PadType.HOLE) @@ -460,20 +442,16 @@ def set_hole_parameters(self, offset_x, offset_y, rotation, type_geom, sizes): Parameters ---------- - type_geom : PadGeometryType - Pad geometry type. - sizes : List[:class:`Value `] - Pad parameters. offset_x : :class:`Value ` X offset. offset_y : :class:`Value ` Y offset. rotation : :class:`Value ` Rotation. - type_geom : PadGeometryType, optional - Pad geometry type. The default is ``None`` if setting polygonal pad parameters. + type_geom : PadGeometryType + Pad geometry type. sizes : List[:class:`Value `] - Pad sizes. The default is ``None`` if setting polygonal pad parameters. + List of pad sizes. """ return self.set_pad_parameters( -1, PadType.HOLE, offset_x, offset_y, rotation, type_geom, sizes @@ -481,7 +459,7 @@ def set_hole_parameters(self, offset_x, offset_y, rotation, type_geom, sizes): @property def hole_range(self): - """:class:`PadstackHoleRange`: Hole range of the padstack definition data.""" + """:class:`PadstackHoleRange`: Hole range of the padstack data definition.""" return PadstackHoleRange(self.__stub.GetHoleRange(self.msg).hole_range) @hole_range.setter @@ -492,7 +470,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 @@ -531,22 +509,13 @@ def solder_ball_placement(self, solderball_placement): @property def solder_ball_param(self): - """ - Get solder ball parameters in their original values in the database. - - Returns - ------- - tuple[ - :class:`Value `, - :class:`Value ` - ] - - Returns a tuple of the following format: - **(d1, d2)** - - **d1** : Diameter for a cylinder solder ball or top diameter for a spheroid solder ball. + """:obj:`tuple` of [:class:`Value `, \ + :class:`Value `]: Solder ball parameters ``(d1, d2)`` \ + in their original values in the database. - **d2** : Middle diameter for a spheroid solder ball. Not used for a cylinder solder ball. + - ``d1`` is the diameter for a cylinder solder ball or the top diameter for a spheroid + solder ball. + - ``d2`` is the middle diameter for a spheroid solder ball. It is not used for a cylinder solder ball. """ params = self.__stub.GetSolderBallParam(self.msg) return ( @@ -564,7 +533,7 @@ def solder_ball_param(self, params): @property def solder_ball_material(self): - """:obj:`str`: Solderball material name.""" + """:obj:`str`: Name of the solder ball material.""" return self.__stub.GetSolderBallMaterial(self.msg) @solder_ball_material.setter diff --git a/src/ansys/edb/core/definition/port_property.py b/src/ansys/edb/core/definition/port_property.py index 0fa84d6267..f25bb6dac8 100644 --- a/src/ansys/edb/core/definition/port_property.py +++ b/src/ansys/edb/core/definition/port_property.py @@ -32,7 +32,7 @@ def clone(self): Returns ------- PortProperty - Clone of port property created. + Port property cloned. """ return PortProperty(self.__stub.Clone(messages.edb_obj_message(self))) @@ -40,7 +40,7 @@ def clone(self): def reference_height(self): """:class:`Value `: Reference height of the port property. - This attribute can be set with the :term:`ValueLike` term. + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetReferenceHeight(messages.edb_obj_message(self))) @@ -52,7 +52,7 @@ def reference_height(self, height): @property def reference_size_auto(self): - """:obj:`bool`: If the reference size is automatic.""" + """:obj:`bool`: Flag indicating if the reference size is automatic.""" return self.__stub.GetReferenceSizeAuto(messages.edb_obj_message(self)).value @reference_size_auto.setter @@ -64,11 +64,7 @@ def get_reference_size(self): Returns ------- - tuple[ - :class:`Value `, - :class:`Value ` - ] - X and Y reference sizes. + 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 3b1fd1c269..3d75256b30 100644 --- a/src/ansys/edb/core/definition/solder_ball_property.py +++ b/src/ansys/edb/core/definition/solder_ball_property.py @@ -71,7 +71,7 @@ def create(cls): @property def material_name(self): - """:obj:`str`: Material name of the solder ball property.""" + """:obj:`str`: Name of the solder ball material.""" return self.__stub.GetMaterialName(edb_obj_message(self)).value @material_name.setter @@ -80,7 +80,7 @@ def material_name(self, name): @property def height(self): - """:term:`ValueLike`: Height of the solder ball property.""" + """:term:`ValueLike`: Height of the solder ball.""" return Value(self.__stub.GetHeight(edb_obj_message(self))) @height.setter @@ -88,7 +88,7 @@ def height(self, height): self.__stub.SetHeight(value_property_message(self, value_message(height))) def get_diameter(self): - """Get the diameter parameters. + """Get the diameter parameters of the solder ball property. Returns ------- @@ -101,7 +101,7 @@ def get_diameter(self): return Value(diameter_paramaters.diameter1), Value(diameter_paramaters.diameter2) def set_diameter(self, diameter1, diameter2): - """Set the diameter parameters. + """Set the diameter parameters of the solder ball property. Parameters ---------- @@ -116,7 +116,7 @@ def set_diameter(self, diameter1, diameter2): def uses_solderball(self): """:obj:`bool`: Flag indicating if the solder ball is used. - Read-Only. + This property is read-only. """ return self.__stub.UsesSolderball(self.msg).value @@ -131,7 +131,7 @@ def shape(self, shape): @property def placement(self): - """:class:`SolderballPlacement`: Solder ball shape.""" + """:class:`SolderballPlacement`: Solder ball placement.""" return SolderballPlacement(self.__stub.GetPlacement(self.msg).solderball_placement) @placement.setter @@ -145,6 +145,6 @@ def clone(self): Returns ------- SolderBallProperty - Clone of the solder ball property created. + Solder ball property cloned. """ return SolderBallProperty(self.__stub.Clone(edb_obj_message(self))) diff --git a/src/ansys/edb/core/edb_defs.py b/src/ansys/edb/core/edb_defs.py index b728c2e12d..88f63be3c1 100644 --- a/src/ansys/edb/core/edb_defs.py +++ b/src/ansys/edb/core/edb_defs.py @@ -1,4 +1,4 @@ -"""Common definitions used in the EDB.""" +"""Common definitions used in EDB.""" import enum diff --git a/src/ansys/edb/core/geometry/arc_data.py b/src/ansys/edb/core/geometry/arc_data.py index 61a5be5ef8..cc0b9f4e1f 100644 --- a/src/ansys/edb/core/geometry/arc_data.py +++ b/src/ansys/edb/core/geometry/arc_data.py @@ -1,4 +1,4 @@ -"""Arc Data.""" +"""Arc data.""" import enum import math @@ -10,7 +10,7 @@ class RotationDirection(enum.Enum): - """Represents possible directions of arc.""" + """Represents arc directions.""" CW = "cw" CCW = "ccw" @@ -18,7 +18,7 @@ class RotationDirection(enum.Enum): class ArcData: - """Class representing arc data.""" + """Represents arc data.""" __stub: arc_data_pb2_grpc.ArcDataServiceStub = session.StubAccessor(session.StubType.arc_data) @@ -47,7 +47,7 @@ def __init__(self, start, end, **kwargs): self._height_options["direction"] = RotationDirection(kwargs["direction"]) def __str__(self): - """Generate a readable string for arc. + """Generate a readable string for the arc. Returns ------- @@ -61,151 +61,125 @@ def __str__(self): @property def start(self): - """Get the start point of arc. - - Returns - ------- - geometry.PointData - """ + """:class:`geometry.PointData`: Start point of the arc.""" return self._start @property def end(self): - """Get the end point of arc. - - Returns - ------- - geometry.PointData - """ + """:class:`geometry.PointData`: End point of the arc.""" return self._end @property def height(self): - """Get the height of arc. - - Returns - ------- - float - """ + """:obj:`float`: Height of the arc.""" if self._height is None: self._height = self.__stub.GetHeight(messages.arc_message(self)).value return self._height def is_point(self, tolerance=0.0): - """Get if an arc is a point (i.e. start and end points are the same). + """Determine if the arc is a point. + + An arc is a point when its start and end points are the same. Parameters ---------- tolerance : float, optional + Tolearance. Returns ------- bool + ``True`` when the arc is a point, ``False`` otherwise. """ return self.is_segment(tolerance) and self.start.equals(self.end, tolerance) def is_segment(self, tolerance=0.0): - """Get if an arc is a straight line segment. + """Determine if the arc is a straight line segment. Parameters ---------- tolerance : float, optional + Tolearance. Returns ------- bool + ``True`` when the arc is a straight line segment, ``False`` otherwise. """ return math.fabs(self.height) <= tolerance @property @parser.to_point_data def center(self): - """Get the center point of arc. - - Returns - ------- - geometry.PointData - """ + """:class:`geometry.PointData`: Center point of the arc.""" return self.__stub.GetCenter(messages.arc_message(self)) @property @parser.to_point_data def midpoint(self): - """Get the midpoint of arc. - - Returns - ------- - geometry.PointData - """ + """:class:`geometry.PointData`: Midpoint of the arc.""" return self.__stub.GetMidpoint(messages.arc_message(self)) @property def radius(self): - """Get the radius of arc. - - Returns - ------- - float - """ + """:obj:`float`: Radius of the arc.""" return self.__stub.GetRadius(messages.arc_message(self)).value @property @parser.to_polygon_data def bbox(self): - """Get the rectangular bounding box of arc. - - Returns - ------- - geometry.PolygonData - """ + """:class:`geometry.PolygonData`: Rectangular bounding box of the arc.""" return self.__stub.GetBoundingBox(messages.arc_message(self)) def is_big(self): - """Get if the arc is big. + """Determine if the arc is big. Returns ------- bool + ``True`` when the arc is big, ``False`` otherwise. """ dist = self.start.distance(self.end) return 2 * math.fabs(self.height) > dist def is_left(self): - """Get if arc rotates clockwise. Same as is_cw. + """Determine if the arc rotates clockwise. + + This method is the same as the ``is_cw`` method. Returns ------- bool + ``True`` when the arc rotates clockwise, ``False`` otherwise. """ return self.is_cw() def is_cw(self): - """Get if arc rotates clockwise. + """Determine if the arc rotates clockwise. + + This method is the same as the ``is_left`` method. Returns ------- bool + ``True`` when the arc rotates clockwise, ``False`` otherwise. """ return self.height > 0.0 def is_ccw(self): - """Get if arc rotates counter-clockwise. + """Determine if the arc rotates counter-clockwise. Returns ------- bool + ``True`` when the arc rotates counter-clockwise, ``False`` otherwise. """ return self.height < 0.0 @property def direction(self): - """Get the rotational direction of arc. - - Returns - ------- - Literal["cw", "ccw", "colinear"] - """ + """:obj:`Literal["cw", "ccw", "colinear"]`: Rotational direction of the arc.""" if self.is_cw(): return "cw" elif self.is_ccw(): @@ -214,16 +188,17 @@ def direction(self): return "colinear" def angle(self, arc=None): - """Get the angle between another arc when provided, otherwise the angle of the arc itself. + """Get the angle between this arc and another arc if provided or the angle of this arc. Parameters ---------- - arc : ArcData + arc : ArcData, default: None + Other arc. Returns ------- float - angle in radian + Angle in radians. """ if arc is None: return self.__stub.GetAngle(messages.arc_message(self)).value @@ -239,12 +214,7 @@ def angle(self, arc=None): @property def length(self): - """Get the circumference length of arc. - - Returns - ------- - float - """ + """:obj:`str`: Circumference length of the arc.""" if self.is_segment(): return self.start.distance(self.end) else: @@ -252,20 +222,16 @@ def length(self): @property def points(self): - """Get geometric points representing the arc. - - Returns - ------- - list[geometry.PointData] - """ + """:obj:`list` of :class:`geometry.PointData`: Geometric points representing the arc.""" return [self._start, geometry.PointData(self.height), self._end] def tangent_at(self, point): - """Get the tangent vector of arc at a point. + """Get the tangent vector of the arc at a given point. Parameters ---------- point : ansys.edb.core.typing.PointLike + Point. Returns ------- @@ -284,11 +250,12 @@ def tangent_at(self, point): @parser.to_box def closest_points(self, other): - """Get the closest point from one arc to another, and vice versa. + """Get the closest points from this arc to another arc, and vice versa. Parameters ---------- other : ArcData + Other arc. Returns ------- diff --git a/src/ansys/edb/core/geometry/point3d_data.py b/src/ansys/edb/core/geometry/point3d_data.py index abfc3b3380..c703540416 100644 --- a/src/ansys/edb/core/geometry/point3d_data.py +++ b/src/ansys/edb/core/geometry/point3d_data.py @@ -1,9 +1,9 @@ -"""Point3D Data.""" +"""Point3D data.""" from ansys.edb.core.utility import conversions class Point3DData: - """Represent a point on 3D coordinate system.""" + """Represents a point on a 3D coordinate system.""" def __init__(self, x, y, z): """Initialize a 3D point. @@ -35,7 +35,7 @@ def __sub__(self, other): return NotImplemented def __mul__(self, other): - """Compute a cross product if `Point3DData` is provided. otherwise scalar multiplication.""" + """Compute a cross product if ``Point3DData`` is provided. Otherwise, perform scalar multiplication.""" if isinstance(other, Point3DData): x = self.y * other.z - self.z * other.y y = self.z * other.x - self.x * other.y @@ -46,22 +46,22 @@ def __mul__(self, other): return NotImplemented def __rmul__(self, other): - """Compute a scalar multiplication.""" + """Perform scalar multiplication.""" return self.__mul__(other) def __div__(self, other): - """Compute a scalar division.""" + """Perform scalar division.""" if isinstance(other, (int, float)): return Point3DData(self.x / other, self.y / other, self.z / other) return NotImplemented def __neg__(self): - """Negate the signs on point coordinates.""" + """Negate the signs on the point coordinates.""" return Point3DData(0, 0, 0) - 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 @@ -88,26 +88,28 @@ def z(self, z): @property def magnitude(self): - """:obj:`float`: The magnitude or a length of a point.""" + """:obj:`float`: Magnitude or length of the point.""" return self.magnitude_sqr.sqrt.double @property def magnitude_sqr(self): - """:obj:`float`: The magnitude-square of a point.""" + """:obj:`float`: Magnitude-square of the point.""" return self.x * self.x + self.y * self.y + self.z * self.z def equals(self, other, tolerance=1e-9): """ - Compare equality of two points within tolerance. + Compare the equality of two 3D points within a given tolerance. Parameters ---------- other : Point3DData - tolerance : float, optional + tolerance : float, default: 1e-9 + Tolerance. Returns ------- bool + ``True`` if the 3D points are equal, ``False`` otherwise. """ if isinstance(other, Point3DData): return ( @@ -119,30 +121,34 @@ def equals(self, other, tolerance=1e-9): def distance(self, other): """ - Compute the distance to another point. + Compute the distance from this point to another point. Parameters ---------- other : Point3DData + Other point Returns ------- float + Distance to the other point. """ if isinstance(other, Point3DData): return (self - other).magnitude def midpoint(self, other): """ - Compute the midpoint of two points. + Compute the midpoint of this point and another point. Parameters ---------- other : Point3DData + Other point Returns ------- Point3DData + Midpoint of the two points. """ if isinstance(other, Point3DData): return 0.5 * (self + other) diff --git a/src/ansys/edb/core/geometry/point_data.py b/src/ansys/edb/core/geometry/point_data.py index da24b27922..65fd090bdb 100644 --- a/src/ansys/edb/core/geometry/point_data.py +++ b/src/ansys/edb/core/geometry/point_data.py @@ -1,4 +1,4 @@ -"""Point Data.""" +"""Point data.""" from functools import reduce import math import operator @@ -12,14 +12,14 @@ class PointData: - """Represent arbitrary (x, y) coordinates that exist on 2D space.""" + """Represents arbitrary (x, y) coordinates that exist on a 2D space.""" __stub: point_data_pb2_grpc.PointDataServiceStub = session.StubAccessor( session.StubType.point_data ) def __init__(self, *data): - """Initialize a point data from list of coordinates. + """Initialize point data from a list of coordinates. Parameters ---------- @@ -45,12 +45,12 @@ def __init__(self, *data): self._arc_h = self._x else: raise TypeError( - "PointData must receive either one value representing arc height or " + "`PointData` must receive either one value representing arc height or " f"two values representing x and y coordinates. - Received '{data}'" ) def __eq__(self, other): - """Compare if two objects represent the same coordinates. + """Determine if two objects represent the same coordinates. Parameters ---------- @@ -98,7 +98,7 @@ def __sub__(self, other): return self.__class__(self._map_reduce(other, operator.__sub__)) def __str__(self): - """Generate unique name for point object. + """Generate unique name for the point object. Returns ------- @@ -108,7 +108,7 @@ def __str__(self): return f"<{coord}>" if self.is_arc else f"({coord})" def equals(self, other, tolerance=0.0): - """Get if two points are located at the same coordinates. + """Determine if two points are located at the same coordinates. Parameters ---------- @@ -118,6 +118,8 @@ def equals(self, other, tolerance=0.0): Returns ------- bool + ``True`` if the two points are located at the same coordinates, + ``False`` otherwise. """ def value_equals(a, b): @@ -130,12 +132,7 @@ def value_equals(a, b): @property def _matrix_values(self): - """Return coordinates of this point as a list of Value. - - Returns - ------- - list of utility.Value - """ + """:obj:`list` of :class:`utility.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): @@ -144,60 +141,36 @@ def _map_reduce(self, other, op): @property def is_arc(self): - """Return if the point represents an arc. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the point represents an arc.""" return self._arc_h is not None @property def arc_height(self): - """Return the height of arc. - - Returns - ------- - utility.Value - """ + """:class:`utility.Value`: Height of the arc.""" return self._arc_h @property def x(self): - """Return the x coordinate. - - Returns - ------- - utility.Value - """ + """:class:`utility.Value`: X coordinate.""" return self._x @property def y(self): - """Return the y coordinate. - - Returns - ------- - utility.Value - """ + """:class:`utility.Value`: Y coordinate.""" return self._y @property def is_parametric(self): - """Return if this point contains parametric values (variable expressions). - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the point contains parametric values (variable expressions).""" return any(val.is_parametric for val in self._matrix_values) def magnitude(self): - """Return the magnitude of point vector. + """Get the magnitude of the point vector. Returns ------- float + Magnitude of the point vector. """ if self.is_arc: return 0 @@ -216,30 +189,32 @@ def normalized(self): @parser.to_point_data def closest(self, start, end): - """Return the closest point on the line segment [start, end] from the point. - - Return None if either point is an arc. + """Get the closest point on a line segment from the point. Parameters ---------- start : ansys.edb.core.typing.PointLike + Start point of the line segment. end : ansys.edb.core.typing.PointLike + End point of the line segment. Returns ------- - typing.Optional[PointData] + typing.Optional[PointData] or ``None`` if either point is an arc. """ if not self.is_arc: return self.__stub.ClosestPoint(messages.point_data_with_line_message(self, start, end)) def distance(self, start, end=None): - """Compute the shortest distance from the point to the line segment [start, end] when end point is given, \ - otherwise the distance between the point and another. + """Compute the shortest distance from the point to a line segment when an end point is given. \ + Otherwise, compute the distance between this point and another point. Parameters ---------- start : ansys.edb.core.typing.PointLike - end : ansys.edb.core.typing.PointLike, optional + Start point of the line segment. + end : ansys.edb.core.typing.PointLike, default: None + End point of the line segment. Returns ------- @@ -253,17 +228,16 @@ def distance(self, start, end=None): ).value def cross(self, other): - """Compute the cross product of the point vector with another. - - Return None if either point is an arc. + """Compute the cross product of the point vector with another point vector. Parameters ---------- other : ansys.edb.core.typing.PointLike + Other point vector. Returns ------- - typing.Optional[utility.Value] + typing.Optional[utility.Value] or ``None`` if either point is an arc. """ other = conversions.to_point(other) if not self.is_arc and not other.is_arc: @@ -272,15 +246,14 @@ def cross(self, other): def move(self, vector): """Move the point by a vector. - Return None if either point is an arc. - Parameters ---------- vector : ansys.edb.core.typing.PointLike + Vector. Returns ------- - typing.Optional[PointData] + typing.Optional[PointData] or ``None`` if either point is an arc. """ vector = conversions.to_point(vector) if not self.is_arc and not vector.is_arc: @@ -288,47 +261,49 @@ def move(self, vector): @parser.to_point_data def rotate(self, angle, center): - """Rotate a point at the specified center by the specified angle. - - Return None if either point is an arc. + """Rotate a point at a given center by a given angle. Parameters ---------- angle : float - in radians. + Angle in radians. center : ansys.edb.core.typing.PointLike + Center. Returns ------- - typing.Optional[PointData] + typing.Optional[PointData] or ``None`` if either point is an arc. """ if not self.is_arc: return self.__stub.Rotate(messages.point_data_rotate_message(self, center, angle)) def dot(self, other): - """Perform per-component multiplication (dot product) of two points. + """Perform per-component multiplication (dot product) of this point and another point. Parameters ---------- other : ansys.edb.core.typing.PointLike + Other point. Returns ------- float + Dot product of the two points. """ return sum(self._map_reduce(other, operator.__mul__), utility.Value(0)).value def angle(self, other): - """Get the angle between another vector. + """Get the angle between this vector and another vector. Parameters ---------- other : ansys.edb.core.typing.PointLike + Other vector. Returns ------- float - angle in radian. + Angle in radians. """ other = conversions.to_point(other) return math.acos(self.dot(other) / (self.magnitude() * other.magnitude())) diff --git a/src/ansys/edb/core/geometry/polygon_data.py b/src/ansys/edb/core/geometry/polygon_data.py index 420826c113..3647e8cb6d 100644 --- a/src/ansys/edb/core/geometry/polygon_data.py +++ b/src/ansys/edb/core/geometry/polygon_data.py @@ -1,4 +1,4 @@ -"""Polygon Data.""" +"""Polygon data.""" from enum import Enum import itertools @@ -13,7 +13,7 @@ class PolygonSenseType(Enum): - """Direction of polygon sense. + """Provides an enum representing the direction of polygon sense. - SENSE_UNKNOWN - SENSE_CW @@ -26,7 +26,7 @@ class PolygonSenseType(Enum): class ExtentType(Enum): - """Extent types for geometries. + """Provides an enum representing extent types for geometries. - CONFORMING - BOUNDING_BOX @@ -37,7 +37,7 @@ class ExtentType(Enum): class PolygonData: - """Class representing a polygon data object.""" + """Represents a polygon data object.""" __stub: polygon_data_pb2_grpc.PolygonDataServiceStub = session.StubAccessor( session.StubType.polygon_data @@ -57,13 +57,13 @@ def __init__( Parameters ---------- - points : list[ansys.edb.core.typing.PointLike], optional - arcs : list[ArcData], optional - lower_left : ansys.edb.core.typing.PointLike, optional - upper_right : ansys.edb.core.typing.PointLike, optional - holes : List[ansys.edb.core.geometry.PolygonData] - sense : ansys.edb.core.geometry.PolygonSenseType, optional - closed : bool, optional + points : list[ansys.edb.core.typing.PointLike], default: None + 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 + closed : bool, default: True """ self._holes, self._sense, self._is_closed = ( [] if holes is None else holes, @@ -99,32 +99,17 @@ def __len__(self): @property def points(self): - """Get the list of coordinates. - - Returns - ------- - list[ansys.edb.core.geometry.PointData] - """ + """:obj:`list` of :class:`ansys.edb.core.geometry.PointData`: List of coordinates for the points.""" return self._points @property def holes(self): - """Get the list of holes. - - Returns - ------- - list[PolygonData] - """ + """:obj:`list` of :class:`PolygonData`: List of holes.""" return self._holes @property def arc_data(self): - """Return a list of segments that represent the arc data of a polygon. - - Returns - ------- - bool - """ + """:obj:`list`: List of segments that represent the arc data of a polygon.""" i, n = 0, len(self) i_max = n if self.is_closed else n - 1 segments = [] @@ -144,106 +129,106 @@ def _is_ccw(self): @property def is_closed(self): - """Return whether a polygon is closed between first and last points. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if a polygon is closed between the first and last points.""" return self._is_closed @property def sense(self): - """Return the polygon sense type. - - Returns - ------- - PolygonSenseType - """ + """:class:`PolygonSenseType`: Polygon sense type.""" return self._sense def is_hole(self): - """Return whether a polygon is a hole. + """Determine whether the polygon is a hole. Returns ------- bool + ``True`` when the polygon is a hole, ``False`` otherwise. """ return self.is_closed and not self._is_ccw() def is_parametric(self): - """Return whether a polygon contains any parametrized points. + """Determine whether a polygon contains any parametrized points. Returns ------- bool + ``True`` when the polygon contains parametrized points, ``False`` otherwise. """ return any(pt.is_parametric for pt in self.points) def has_arcs(self): - """Return whether a polygon contains any arcs. + """Determine whether the polygon contains any arcs. Returns ------- bool + ``True`` when the polygon contains arcs, ``False`` otherwise. """ return any(pt.is_arc for pt in self.points) def has_holes(self): - """Return whether a polygon contains any holes. + """Determine whether the polygon contains any holes. Returns ------- bool + ``True`` when the polygon contains holes, ``False`` otherwise. """ return len(self.holes) > 0 def is_circle(self): - """Return whether the outer contour of a polygon is a circle. + """Determine whether the outer contour of the polygon is a circle. Returns ------- bool + ``True`` when the outer contour of the polygon is a circle holes, ``False`` otherwise. """ return self.__stub.IsCircle(messages.polygon_data_message(self)).value def is_box(self): - """Return whether the outer contour of a polygon is a box. + """Determine whether the outer contour of the polygon is a box. Returns ------- bool + ``True`` when the outer corner of the polygon is a box, ``False`` otherwise. """ return self.__stub.IsBox(messages.polygon_data_message(self)).value def is_convex(self): - """Return whether a polygon is a convex hull. + """Determine whether the polygon is a convex hull. Returns ------- bool + ``True`` when the polygon is a convex hull, ``False`` otherwise. """ return self.__stub.IsConvex(messages.polygon_data_message(self)).value def area(self): - """Compute the area of polygon. + """Compute the area of the polygon. Returns ------- float + Area of the polygon. """ return self.__stub.GetArea(messages.polygon_data_message(self)).value def has_self_intersections(self, tol=1e-9): - """Return whether this polygon contains self-intersections. + """Determine whether the polygon contains any self-intersections. Parameters ---------- - tol : float, optional + tol : float, default: 1e-9 + Tolerance. Returns ------- bool + ``True`` when the polygon contains self-intersections, ``False`` otherwise. """ return self.__stub.HasSelfIntersections( messages.polygon_data_with_tol_message(self, tol) @@ -251,11 +236,12 @@ def has_self_intersections(self, tol=1e-9): @parser.to_polygon_data def remove_self_intersections(self, tol=1e-9): - """Create new polygon with all self-intersections removed. + """Create a polygon with all self-intersections removed. Parameters ---------- - tol : float, optional + tol : float, default: 1e-9 + Tolerance. Returns ------- @@ -267,7 +253,7 @@ def remove_self_intersections(self, tol=1e-9): @parser.to_point_data_list def normalized(self): - """Return normalized points of a polygon. + """Get the normalized points of the polygon. Returns ------- @@ -277,11 +263,12 @@ def normalized(self): @parser.to_polygon_data def move(self, vector): - """Move a polygon by a (x, y) vector. + """Move the polygon by a vector. Parameters ---------- vector : ansys.edb.core.typing.PointLikeT + Vector in the form: ``(x, y)``. Returns ------- @@ -291,13 +278,14 @@ def move(self, vector): @parser.to_polygon_data def rotate(self, angle, center): - """Rotate a polygon at a center by an angle. + """Rotate the polygon at a center by an angle. Parameters ---------- angle : float - in radian. + Angle in radians. center : ansys.edb.core.typing.PoinyLikeT + Center. Returns ------- @@ -309,12 +297,14 @@ def rotate(self, angle, center): @parser.to_polygon_data def scale(self, factor, center): - """Scale a polygon by a linear factor from a center. + """Scale the polygon by a linear factor from a center. Parameters ---------- factor : float + Linear factor. center : ansys.edb.core.typing.PointLikeT + Center. Returns ------- @@ -331,6 +321,7 @@ def mirror_x(self, x): Parameters ---------- x : float + X line. Returns ------- @@ -351,11 +342,12 @@ def bbox(self): @classmethod @parser.to_box def bbox_of_polygons(cls, polygons): - """Compute the bounding box of polygons. + """Compute the bounding box of a list of polygons. Parameters ---------- polygons: list[PolygonData] + List of polygons. Returns ------- @@ -365,7 +357,7 @@ def bbox_of_polygons(cls, polygons): @parser.to_circle def bounding_circle(self): - """Compute the bounding circle of a polygon. + """Compute the bounding circle of the polygon. Returns ------- @@ -376,11 +368,12 @@ def bounding_circle(self): @classmethod @parser.to_polygon_data def convex_hull(cls, polygons): - """Compute the convex hull of the union of polygons. + """Compute the convex hull of the union of a list of polygons. Parameters ---------- others : list[PolygonData] + List of polygons. Returns ------- @@ -390,13 +383,13 @@ def convex_hull(cls, polygons): @parser.to_polygon_data def without_arcs(self, max_chord_error=0, max_arc_angle=math.pi / 6, max_points=8): - """Return a polygon data with all arcs removed. + """Get polygon data with all arcs removed. Parameters ---------- - max_chord_error : float, optional - max_arc_angle : float, optional - max_points : int, optional + max_chord_error : float, default: 0 + max_arc_angle : float, default: math.pi + max_points : int, default: 8 Returns ------- @@ -414,7 +407,8 @@ def defeature(self, tol=1e-9): Parameters ---------- - tol : float, optional + tol : float, default: 1e-9 + Tolerance. Returns ------- @@ -423,7 +417,7 @@ def defeature(self, tol=1e-9): return self.__stub.Defeature(messages.polygon_data_with_tol_message(self, tol)) def is_inside(self, point): - """Return whether the point is inside a polygon. + """Determine whether the point is inside the polygon. Parameters ---------- @@ -432,36 +426,43 @@ def is_inside(self, point): Returns ------- bool + ``True`` if the point is inside the polygon, ``False`` otherwise. """ return self.__stub.IsInside(messages.polygon_data_with_point_message(self, point)).value def intersection_type(self, other, tol=1e-9): - """Return the intersection type with another polygon. + """Get the intersection type with another polygon. Parameters ---------- other : PolygonData - tol : float, optional + Other polygon. + tol : float, default: 1e-9 + Tolerance. Returns ------- bool + ``True`` when successful, ``False`` when failed. """ return self.__stub.GetIntersectionType( messages.polygon_data_pair_with_tolerance_message(self, other, tol) ) def circle_intersect(self, center, radius): - """Return whether a circle intersects with a polygon. + """Determine whether the circle intersects with a polygon. Parameters ---------- center : ansys.edb.core.typing.PointLikeT + Center. radius : float + Radius. Returns ------- bool + ``True`` if the circle intersects with a polygon, ``False`` otherwise. """ return self.__stub.CircleIntersectsPolygon( messages.polygon_data_with_circle_message(self, center, radius) @@ -469,15 +470,17 @@ def circle_intersect(self, center, radius): @parser.to_point_data def closest_point(self, point): - """Compute a point on a polygon that is closest to another point. + """Compute a point on the polygon that is closest to another point. Parameters ---------- point : ansys.edb.core.typing.PointLikeT + Other point. Returns ------- ansys.edb.core.geometry.PointData + Point closest to the given point. """ return self.__stub.GetClosestPoints( messages.polygon_data_with_points_message(self, point=point) @@ -502,11 +505,12 @@ def closest_points(self, polygon): @classmethod @parser.to_polygon_data_list def unite(cls, polygons): - """Compute union of polygons. + """Compute the union of a list of polygons. Parameters ---------- polygons: list[PolygonData] + List of polygons. Returns ------- @@ -517,12 +521,14 @@ def unite(cls, polygons): @classmethod @parser.to_polygon_data_list def intersect(cls, polygons1, polygons2): - """Compute intersection of polygons. + """Compute the intersection of one or more lists of polygons. Parameters ---------- - polygons1: list[PolygonData] or PolygonData - polygons2: list[PolygonData] or PolygonData, optional + polygons1: list of :class:`PolygonData` or `PolygonData` + First list of polygons. + polygons2: list of :class:`PolygonData` or `PolygonData` + Second optional list of polygons. Returns ------- @@ -533,16 +539,14 @@ def intersect(cls, polygons1, polygons2): @classmethod @parser.to_polygon_data_list def subtract(cls, polygons1, polygons2): - """Compute geometric subtraction of polygons. - - Subtract a set of polygons from another set of polygons. + """Subtract a set of polygons from another set of polygons. Parameters ---------- polygons1 : list[PolygonData], PolygonData - base polygons. + List of base polygons. polygons2 : list[PolygonData], PolygonData - polygons to subtract. + List of polygons to subtract. Returns ------- @@ -553,14 +557,14 @@ def subtract(cls, polygons1, polygons2): @classmethod @parser.to_polygon_data_list def xor(cls, polygons1, polygons2): - """Compute an exclusive OR of polygons. - - Exclusive OR between a set of polygons and another set of polygons. + """Compute an exclusive OR between a set of polygons and another set of polygons. Parameters ---------- polygons1 : list[PolygonData], PolygonData + First list of polygons. polygons2 : list[PolygonData], PolygonData + Second list of polygons. Returns ------- @@ -570,17 +574,19 @@ def xor(cls, polygons1, polygons2): @parser.to_polygon_data_list def expand(self, offset, round_corner, max_corner_ext, tol=1e-9): - """Expand a polygon by an offset. + """Expand the polygon by an offset. Parameters ---------- offset : float - Expansion offset. negative value to shrink. + Expansion offset. Specify a negative value to shrink the polygon. round_corner : bool - True for rounded corners, straight edge otherwise. + Whether the corners are rounded corners. If ``False``, the corners + are straight edges. max_corner_ext : float - Max corner extension at which point the corner is clipped. - tol : float, optional + Maximum corner extension to clip the corner at. + tol : float, default: 1e-9 + Tolerance. Returns ------- @@ -598,6 +604,7 @@ def alpha_shape(cls, points, alpha): Parameters ---------- points : list[ansys.edb.core.typing.PointLikeT] + List of points. alpha : float Returns diff --git a/src/ansys/edb/core/geometry/r_tree.py b/src/ansys/edb/core/geometry/r_tree.py index f638184bb4..23022e8573 100644 --- a/src/ansys/edb/core/geometry/r_tree.py +++ b/src/ansys/edb/core/geometry/r_tree.py @@ -10,7 +10,7 @@ class _QueryBuilder: @staticmethod def r_tree_obj_message(rtree, polygon, prop_id): - """Create an RTreeObjMessage.""" + """Create an RTree object message.""" return pb.RTreeObjMessage( target=messages.edb_obj_message(rtree), polygon=messages.polygon_data_message(polygon), @@ -19,7 +19,7 @@ def r_tree_obj_message(rtree, polygon, prop_id): @staticmethod def r_tree_search_message(rtree, box, bb_search): - """Create a RTreeSearchMessage.""" + """Create an RTree search message.""" return pb.RTreeSearchMessage( target=messages.edb_obj_message(rtree), box=messages.box_message(box[0], box[1]), @@ -28,7 +28,7 @@ def r_tree_search_message(rtree, box, bb_search): @staticmethod def r_tree_geometry_request_message(rtree, polygon, prop_id, increment_visit): - """Create an RTreeGeometryRequestMessage.""" + """Create an RTree geometry request message.""" return pb.RTreeGeometryRequestMessage( target=messages.edb_obj_message(rtree), polygon=messages.polygon_data_message(polygon), @@ -38,24 +38,24 @@ def r_tree_geometry_request_message(rtree, polygon, prop_id, increment_visit): class RTree(ObjBase): - """Class representing an RTree.""" + """Provides the base RTree class.""" class RTreeObj: - """Class representing an RTreeObj object.""" + """Represents an RTree object.""" def __init__( self, polygon, obj, ): - """Construct a RTreeObj object using given values. + """Construct an RTree object using given values. Parameters ---------- polygon: :class:`PolygonData ` - The polygon representation for the object in the spatial index. + Polygon representation for the object in the spatial index. obj: ObjBase - The object to be stored in the index. + Object to store in the index. """ self._unique_id = None self.polygon = polygon @@ -64,7 +64,7 @@ def __init__( __stub: r_tree_pb2_grpc.RTreeServiceStub = StubAccessor(StubType.r_tree) def __init__(self, msg): - """Init method for RTree.""" + """Initialize an RTree object.""" super().__init__(msg) self._id_to_obj = {} self._obj_to_id = {} @@ -76,13 +76,13 @@ def create(cls, tolerance=1e-9): Parameters ---------- - tolerance : double - The tolerance of the R-tree, in meters. + tolerance : float, default: 1e-9 + Tolerance of the R-tree in meters. Returns ------- RTree - The new RTree created. + RTree created. """ rtree_created = RTree(cls.__stub.Create(messages.double_message(tolerance))) return rtree_created @@ -93,23 +93,24 @@ def _handle_rtree_obj(self, rtree_obj): rtree_obj._unique_id = self._obj_to_id[(rtree_obj.obj, rtree_obj.polygon)] return True else: - raise Exception("RTreeObj does not exist in RTree.") + raise Exception("RTree object does not exist in the RTree.") else: return True @property @parser.to_box def extent(self): - """Tuple[geometry.PointData, geometry.PointData]: Get the bounding-box for the contents of the RTree.""" + """:obj:`tuple` of [:class:`geometry.PointData`, :class:`geometry.PointData`]: Bounding box \ + for the contents of the RTree.""" return self.__stub.GetExtent(self.msg) def insert(self, rtree_obj): - """Insert RTreeObj from the RTree object. + """Insert an RTree object from a given RTree object. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree data object with an index. """ unique_id = 1 if self._unique_id is None else self._unique_id + 1 self.__stub.InsertIntObject( @@ -121,12 +122,12 @@ def insert(self, rtree_obj): self._obj_to_id[(rtree_obj.obj, rtree_obj.polygon)] = unique_id def delete(self, rtree_obj): - """Delete RTreeObj from the RTree object. + """Delete the RTree from a given RTree object. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree data object with index in this form: ``(polygon, id pair)``. """ if self._handle_rtree_obj(rtree_obj): self.__stub.DeleteIntObject( @@ -136,49 +137,52 @@ def delete(self, rtree_obj): del self._obj_to_id[(rtree_obj.obj, rtree_obj.polygon)] def empty(self): - """Check if the RTree is contains no geometry. + """Determine if the RTree is emppty (contains no geometry). Returns ------- bool + ``True`` if the RTree is empty, ``False`` otherwise. """ msg_empty = self.__stub.Empty(self.msg).value return msg_empty def search(self, box, bb_search): - """Search all objects intersecting the given box. + """Search all objects intersecting a given box. Parameters ---------- box: Tuple[:class:`PointData `, :class:`PointData `] - The testing region, described as a (lower-left, upper-right) box. + Testing region, described as a "lower-left, upper-right" box. bb_search: bool - If true, an RTreeObj intersects when the bounding-box of it's \ - :class:`PolygonData ` \ - intersects the testing object. If false, an explicit intersection is required for a hit. + Whether the RTree object intersects when the bounding-box of its + :class:`PolygonData ` instance + intersects the testing object. If ``False``, an explicit intersection + is required for a hit. Returns ------- - :obj:`list` of RTreeObj - A list of intersecting RTreeObj. + :obj:`list` of :class:`RTreeObj` + List of intersecting RTree objects. """ msg = self.__stub.Search(_QueryBuilder.r_tree_search_message(self, box, bb_search)) return [self._id_to_obj[int(to_id)] for to_id in msg.props] def nearest_neighbor(self, rtree_obj): - """Find the nearest-neighbor of the given RTree object (polygon, id pair). + """Find the nearest neighbor of a given RTree object. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree object with index in this form: ``(polygon, id pair)``. Returns ------- :obj:`tuple` of RTreeObj, tuple[geometry.PointData, geometry.PointData] - RTreeObj: The nearest-neighbor in the RTree to the provided obj, or null if nothing is found. - tuple[geometry.PointData, geometry.PointData]: A line-segment spanning the closest points between obj and \ - nearest. + + - ``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 + and the nearest neighbor. """ if self._handle_rtree_obj(rtree_obj): msg = self.__stub.NearestNeighbor( @@ -187,19 +191,21 @@ def nearest_neighbor(self, rtree_obj): return self._id_to_obj[int(msg.id)], parser.to_box(msg.coordinates) def touching_geometry(self, rtree_obj, increment_visit): - """Find all geometry touching the provided RTree object (polygon, id pair). Note that the provided RTree \ - object is not returned in the touching list. + """Find all geometries touching an RTree object. + + The provided RTree object is not returned in the touching list. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree data object with index in this form: ``(polygon, id pair)``. increment_visit: bool - If True, increment the visit counter for items returned in connected. + Whether to increment the visit counter for items returned in the list + of connected geometries. Returns ------- - :obj:`list` of RTreeObj + :obj:`list` of :class:`RTreeObj` All touching RTree objects. """ if self._handle_rtree_obj(rtree_obj): @@ -211,19 +217,21 @@ def touching_geometry(self, rtree_obj, increment_visit): return [self._id_to_obj[int(to_id)] for to_id in msg.props] def connected_geometry(self, rtree_obj, increment_visit): - """Find connected geometry. Note that, if connections exists, the provided RTree object \ - will be returned in the connected list. + """Find the connected geometries. + + If a connections exists, the provided RTree object is returned in the connected list. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. - increment_visit: If True, increment the visit counter for items returned in connected. + 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 - The connected geometry list. + List of connected geometries. """ if self._handle_rtree_obj(rtree_obj): msg = self.__stub.ConnectedGeometry( @@ -235,8 +243,8 @@ def connected_geometry(self, rtree_obj, increment_visit): @property def connected_geometry_sets(self): - """:obj:`list` of :obj:`list` of RTreeObj: Connected geometry sets of an RTree \ - (ids, sizes).""" + """: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 rtree_obj_sets = [] @@ -249,20 +257,21 @@ def connected_geometry_sets(self): return rtree_obj_sets def increment_visit(self): - """Increment the visit count, effectively marking all items in the tree unvisited.""" + """Increment the visit count, effectively marking all items in the tree as unvisited.""" self.__stub.IncrementVisit(messages.edb_obj_message(self)) def is_visited(self, rtree_obj): - """Check whether a given object has been visited. + """Determine whether an RTree object has been visited. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree data object with index in this form: ``(polygon, id pair)``. Returns ------- bool + ``True`` if the Rtree object has been visited, ``False`` otherwise. """ if self._handle_rtree_obj(rtree_obj): return self.__stub.IsVisited( @@ -270,12 +279,12 @@ def is_visited(self, rtree_obj): ).value def visit(self, rtree_obj): - """Increment a given RTree object (polygon, id pair) count. + """Increment the count of a given RTree object. Parameters ---------- rtree_obj: RTreeObj - An R-tree data object, with index. + R-tree data object with index in this form: ``(polygon, id pair)``. """ if self._handle_rtree_obj(rtree_obj): self.__stub.Visit( @@ -284,5 +293,5 @@ def visit(self, rtree_obj): @property def get_visit(self): - """Int: Visit count for the tree.""" + """:obj:`int`: Visit count for the R-tree.""" return self.__stub.GetVisit(messages.edb_obj_message(self)).value diff --git a/src/ansys/edb/core/geometry/triangle3d_data.py b/src/ansys/edb/core/geometry/triangle3d_data.py index 561b087aaf..666119546b 100644 --- a/src/ansys/edb/core/geometry/triangle3d_data.py +++ b/src/ansys/edb/core/geometry/triangle3d_data.py @@ -1,8 +1,8 @@ -"""Triangle3DData Class.""" +"""Triangle 3D data.""" class Triangle3DData: - """Triangle defined by three 3D points.""" + """Represents a triangle defined by three 3D points.""" def __init__(self, point_1, point_2, point_3): """Create a 3D triangle. @@ -19,7 +19,7 @@ def __init__(self, point_1, point_2, point_3): @property def point_1(self): - """:class:`Point3DData`: First point.""" + """:class:`Point3DData`: First 3D point.""" return self._point_1 @point_1.setter @@ -28,7 +28,7 @@ def point_1(self, point_1): @property def point_2(self): - """:class:`Point3DData`: Second point.""" + """:class:`Point3DData`: Second 3D point.""" return self._point_2 @point_2.setter @@ -37,7 +37,7 @@ def point_2(self, point_2): @property def point_3(self): - """:class:`Point3DData`: Third point.""" + """:class:`Point3DData`: Third 3D point.""" return self._point_3 @point_3.setter diff --git a/src/ansys/edb/core/hierarchy/cell_instance.py b/src/ansys/edb/core/hierarchy/cell_instance.py index 1ed5147b24..4e774518c5 100644 --- a/src/ansys/edb/core/hierarchy/cell_instance.py +++ b/src/ansys/edb/core/hierarchy/cell_instance.py @@ -1,4 +1,4 @@ -"""Cell Instance.""" +"""Cell instance.""" from ansys.api.edb.v1.cell_instance_pb2_grpc import CellInstanceServiceStub @@ -11,28 +11,28 @@ class CellInstance(hierarchy_obj.HierarchyObj): - """Class representing a cell instance object.""" + """Represents a cell instance object.""" __stub: CellInstanceServiceStub = StubAccessor(StubType.cell_instance) layout_obj_type = LayoutObjType.CELL_INSTANCE @classmethod def create(cls, layout, name, ref): - """Create a cell instance object with a layout. + """Create a cell instance with a given layout. Parameters ---------- layout : :class:`Layout ` - Layout that owns the cell instance. + Layout to create the cell instance in. name : str - Name of cell instance to be created. + Name of the cell instance. ref : :class:`Layout ` Layout that the cell instance refers to. Returns ------- CellInstance - Newly created cell instance. + Cell instance created. """ return CellInstance( cls.__stub.Create(messages.cell_instance_creation_message(layout, name, ref)) @@ -40,21 +40,21 @@ def create(cls, layout, name, ref): @classmethod def create_with_component(cls, layout, name, ref): - """Create a cell instance object with a component definition. + """Create a cell instance with a component definition. Parameters ---------- layout : :class:`Layout ` - Layout that owns the cell instance. + Layout to create the cell instance in. name : str - Name of the cell instance to be created. + Name of the cell instance. ref : :class:`ComponentDef ` - The component this cell instance refers to. + Component that the cell instance refers to. Returns ------- CellInstance - Newly created cell instance. + Cell instance created. """ return CellInstance( cls.__stub.CreateWithComponent( @@ -64,19 +64,19 @@ def create_with_component(cls, layout, name, ref): @classmethod def find(cls, layout, name): - """Find a cell instance in layout by name. + """Find a cell instance by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout to search the cell instance in. + Layout to search for the cell instance. name : str - Name of the cell instance to be searched. + Name of the cell instance. Returns ------- CellInstance - Cell instance that is found, None otherwise. + Cell instance that is found, ``None`` otherwise. """ return CellInstance( cls.__stub.FindByName(messages.object_name_in_layout_message(layout, name)) @@ -86,16 +86,16 @@ def find(cls, layout, name): def reference_layout(self): """:class:`Layout `: Reference layout of the cell instance. - Read-Only. + This property is read-only. """ return layout.Layout(self.__stub.GetReferenceLayout(self.msg)) @property def term_instances(self): - """:obj:`list` of :class:`TerminalInstances `: List of terminal \ - instances associated with this cell instance. + """:obj:`list` of :class:`TerminalInstances `: Terminal \ + instances associated with the cell instance. - Read-Only. + This property is read-only. """ from ansys.edb.core.terminal import TerminalInstance @@ -104,9 +104,9 @@ def term_instances(self): @property def placement_3d(self): - """:obj:`bool`: Determine if this cell instance is 3D placed in the owning layout. + """:obj:`bool`: Flag indicating if the cell instance is 3D placed in the owning layout. - If True, transformation can be set using :obj:`transform3d`. + If ``True``, transformation can be set using the :obj:`transform3d` object. """ return self.__stub.GetIs3DPlacement(self.msg).value @@ -118,15 +118,19 @@ def placement_3d(self, value): @property def transform3d(self): """:class:`Transform3D `: \ - 3D transformation information of this cell instance. + 3D transformation information of the cell instance. - :obj:`placement_3d` must be True for the transformation to be applied. + For the transformation to be applied, the :obj:`placement_3d` property + must be set to ``True``. """ return Transform3D(self.__stub.Get3DTransform(self.msg)) @transform3d.setter def transform3d(self, value): - """Set the 3D transformation for this cell instance. The cell instance must be 3D placed.""" + """Set the 3D transformation for the cell instance. + + The cell instance must be 3D placed. + """ self.__stub.Set3DTransform(messages.pointer_property_message(self, value)) def get_parameter_override(self, param_name): @@ -135,24 +139,24 @@ def get_parameter_override(self, param_name): Parameters ---------- param_name : str - Name of the parameter to override. + Name of the cell instance parameter. Returns ------- :class:`Value ` - Override value for the parameter. + Override value for the cell instance parameter. """ return Value( self.__stub.GetParameterOverride(messages.string_property_message(self, param_name)) ) def set_parameter_override(self, param_name, param_value): - """Set override value for the given cell instance parameter. + """Set an override value for a given cell instance parameter. Parameters ---------- param_name : str - Name of the parameter to override. + Name of the cell instance parameter. param_value : :class:`Value ` Value to override with. """ diff --git a/src/ansys/edb/core/hierarchy/component_group.py b/src/ansys/edb/core/hierarchy/component_group.py index 3674f58c8d..895d42a456 100644 --- a/src/ansys/edb/core/hierarchy/component_group.py +++ b/src/ansys/edb/core/hierarchy/component_group.py @@ -1,4 +1,4 @@ -"""Component Group.""" +"""Component group.""" from enum import Enum @@ -12,7 +12,7 @@ class ComponentType(Enum): - """Enum representing component types. + """Provides an enum representing component types. - OTHER - RESISTOR @@ -33,7 +33,7 @@ class ComponentType(Enum): class ComponentGroup(Group): - """Class representing a component group object.""" + """Represents a component group object.""" __stub: ComponentGroupServiceStub = StubAccessor(StubType.component_group) @@ -44,17 +44,17 @@ def create_with_component(cls, layout, name, comp_name): Parameters ---------- layout : :class:`Layout ` - Layout that owns the component group. + Layout to create the component group in. name : str - Name of the component group to be created. + Name of the component group. comp_name : str - Name of the :class:`ComponentDef ` the component group \ - refers to. + Name of the :class:`ComponentDef ` instance that \ + the component group refers to. Returns ------- ComponentGroup - Newly created component group. + Component group created. """ return ComponentGroup( cls.__stub.Create(messages.component_group_create_message(layout, name, comp_name)) @@ -64,7 +64,7 @@ def create_with_component(cls, layout, name, comp_name): def num_pins(self): """:obj:`int`: Number of pins in the component group. - Read-Only. + This property is read-only. """ return self.__stub.GetNumberOfPins(self.msg).value @@ -97,7 +97,7 @@ def component_property(self): @component_property.setter def component_property(self, value): - """Set the component property on the component group.""" + """Component property on the component group.""" self.__stub.SetComponentProperty(messages.pointer_property_message(self, value)) @property @@ -107,24 +107,24 @@ def component_type(self): @component_type.setter def component_type(self, value): - """Set the component type on the component group.""" + """Component type on the component group.""" self.__stub.SetComponentType(messages.set_component_group_type_message(self, value)) @classmethod def find_by_def(cls, layout, comp_def_name): - """Find all the components belonging to a specific component definition. + """Find all components belonging to a given component definition. Parameters ---------- layout : :class:`Layout ` - Layout to search the component group(s) in. + Layout to search for component groups. comp_def_name : str - Name of the :class:`ComponentDef `. + Name of the :class:`ComponentDef ` instance. Returns ------- list[ComponentGroup] - List of component group(s) that are found. + List of component groups that are found. """ objs = cls.__stub.FindByDef( messages.object_name_in_layout_message(layout, comp_def_name) diff --git a/src/ansys/edb/core/hierarchy/group.py b/src/ansys/edb/core/hierarchy/group.py index e842375a4f..02f3bfdd59 100644 --- a/src/ansys/edb/core/hierarchy/group.py +++ b/src/ansys/edb/core/hierarchy/group.py @@ -10,13 +10,13 @@ class Group(HierarchyObj): - """Class representing a group object.""" + """Represents a group object.""" __stub: GroupServiceStub = StubAccessor(StubType.group) layout_obj_type = LayoutObjType.GROUP def cast(self): - """Cast the group object to correct concrete type. + """Cast the group object to the correct concrete type. Returns ------- @@ -44,14 +44,14 @@ def create(cls, layout, name): Parameters ---------- layout : :class:`Layout ` - Layout that owns the group. + Layout to create the group in. name : str - Name of group to be created. + Name of the group. Returns ------- Group - Newly created group. + Group created. """ return Group(cls.__stub.Create(messages.object_name_in_layout_message(layout, name))) @@ -62,14 +62,14 @@ def find(cls, layout, name): Parameters ---------- layout : :class:`Layout ` - Layout to search the group in. + Layout to search for the group. name : str - Name of the group to be searched. + Name of the group. Returns ------- Group - Group that is found, None otherwise. + Group that is found, ``None`` otherwise. """ return Group( cls.__stub.FindByName(messages.object_name_in_layout_message(layout, name)) @@ -81,7 +81,7 @@ def add_member(self, member): Parameters ---------- member : :term:`Connectable` - Object to be added to the group. + Object to add to the group. """ self.__stub.AddMember(messages.group_modify_member_message(self, member)) @@ -91,25 +91,25 @@ def remove_member(self, member): Parameters ---------- member : :term:`Connectable` - Object to be removed from the group. + Object to remove from the group. """ self.__stub.RemoveMember(messages.group_modify_member_message(self, member)) def ungroup(self, recursive): - """Dissolves the group. + """Dissolve the group. Parameters ---------- recursive : bool - True if all containing groups should also be dissolved, False otherwise. + Whether all containing groups should also be resolved. """ self.__stub.Ungroup(messages.bool_property_message(self, recursive)) @property def members(self): - """:obj:`list` of :term:`Connectables `: List of all the group members. + """:obj:`list` of :term:`Connectables `: All group members. - Read-Only. + This property is read-only. """ from ansys.edb.core.inner import factory diff --git a/src/ansys/edb/core/hierarchy/hierarchy_obj.py b/src/ansys/edb/core/hierarchy/hierarchy_obj.py index 6555543f3a..672db91192 100644 --- a/src/ansys/edb/core/hierarchy/hierarchy_obj.py +++ b/src/ansys/edb/core/hierarchy/hierarchy_obj.py @@ -1,4 +1,4 @@ -"""Hierarchy Obj.""" +"""Hierarchy object.""" from ansys.edb.core.definition import component_def from ansys.edb.core.inner import conn_obj, messages @@ -8,13 +8,13 @@ class HierarchyObj(conn_obj.ConnObj): - """Base class representing hierarchy object.""" + """Provides the base class for an hierarchy object.""" __stub = StubAccessor(StubType.hierarchy_obj) @property def transform(self): - """:class:`Transform `: Transformation information of the object.""" + """:class:`Transform `: Transformation information of the hierarchy object.""" transform_msg = self.__stub.GetTransform(self.msg) return Transform( transform_msg.scale, @@ -31,62 +31,62 @@ def transform(self, value): @property def name(self): - """:obj:`str`: Name of the object.""" + """:obj:`str`: Name of the hierarchy object.""" return self.__stub.GetName(self.msg).value @name.setter def name(self, value): - """Set name of the object.""" self.__stub.SetName(messages.edb_obj_name_message(self, value)) @property def component_def(self): - """:class:`ComponentDef `: Component definition for this \ - object if it exists, None otherwise. + """:class:`ComponentDef `: Component definition for the \ + hierarchy object if it exists, ``None`` otherwise. - Read-Only. + This property is read-only. """ return component_def.ComponentDef(self.__stub.GetComponent(self.msg)) @property def placement_layer(self): - """:class:`Layer `: Placement layer for this object.""" + """:class:`Layer `: Placement layer for the hierarchy object.""" return Layer(self.__stub.GetPlacementLayer(self.msg)).cast() @placement_layer.setter def placement_layer(self, value): - """Set placement layer.""" self.__stub.SetPlacementLayer(messages.pointer_property_message(self, value)) @property def location(self): """:obj:`tuple` (:class:`Value `, \ :class:`Value `): \ - [x, y] location of the object on the :obj:`placement_layer`.""" + 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)] @location.setter def location(self, value): - """Set the location on placement layer.""" self.__stub.SetLocation(messages.point_property_message(self, value)) @property def solve_independent_preference(self): - """:obj:`bool`: Determine whether the object is assigned to solve independent of its parent context. + """:obj:`bool`: Flag indicating if the object is assigned to solve independent of its parent context. - True if solving independently, False if embedded. + Returns + ------- + bool + ``True`` if the object is assigned to solve independently, ``False`` if the object is embedded. Notes ----- - For a :class:`ComponentModel `, this flag indicates if the - model is embedded with the field-solver or not, when applicable. - For a :class:`CellInstance `, it indicates if the design's - geometry is flattened/meshed with the parent or not, 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. """ return self.__stub.GetSolveIndependentPreference(self.msg).value @solve_independent_preference.setter def solve_independent_preference(self, value): - """Set solve independent preference.""" self.__stub.SetSolveIndependentPreference(messages.bool_property_message(self, value)) diff --git a/src/ansys/edb/core/hierarchy/inst_array.py b/src/ansys/edb/core/hierarchy/inst_array.py index e19872c8de..7a345fa390 100644 --- a/src/ansys/edb/core/hierarchy/inst_array.py +++ b/src/ansys/edb/core/hierarchy/inst_array.py @@ -1,4 +1,4 @@ -"""Inst Array.""" +"""Instance array.""" from ansys.api.edb.v1.inst_array_pb2_grpc import InstArrayServiceStub @@ -10,38 +10,38 @@ class InstArray(cell_instance.CellInstance): - """Class representing an instance array object.""" + """Represents an instance array object.""" __stub: InstArrayServiceStub = StubAccessor(StubType.inst_array) layout_obj_type = LayoutObjType.INST_ARRAY @classmethod def create(cls, layout, name, ref, orig, xaxis, yaxis, xcount, ycount): - """Create an instance array object with a layout. + """Create an instance array with a layout. Parameters ---------- layout : :class:`Layout ` - Layout that owns the instance array. + Layout to create the instance array in. name : str - Name of instance array to be created. + Name of the instance array. ref : :class:`Layout ` Layout that the instance array refers to. orig : :class:`PointData ` - PointData that represents the origin of the instance array. + Point data that represents the origin of the instance array. xaxis : :class:`PointData ` - PointData that represents the xaxis of the instance array. + Point data that represents the x axis of the instance array. yaxis : :class:`PointData ` - PointData that represents the yaxis of the instance array. + Point data that represents the y axis of the instance array. xcount : :class:`Value ` - Value of x count of the instance array. + Value for the x count of the instance array. ycount : :class:`Value ` - Value of y count of the instance array. + Value for the y count of the instance array. Returns ------- InstArray - Newly created instance array. + Instance array created. """ return InstArray( cls.__stub.Create( @@ -53,32 +53,32 @@ def create(cls, layout, name, ref, orig, xaxis, yaxis, xcount, ycount): @classmethod def find(cls, layout, name): - """Find an instance array in layout by name. + """Find an instance array by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout to search for the instance array in. + Layout to search for the instance array. name : str - Name of the instance array to be searched for. + Name of the instance array. Returns ------- InstArray - instance array that is found, None otherwise. + Instance array that is found, ``None`` otherwise. """ return InstArray(cls.__stub.FindByName(messages.string_property_message(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/model.py b/src/ansys/edb/core/hierarchy/model.py index 2f4c7b1d1f..60b23428fc 100644 --- a/src/ansys/edb/core/hierarchy/model.py +++ b/src/ansys/edb/core/hierarchy/model.py @@ -1,10 +1,10 @@ -"""Base Hierarchy Model.""" +"""Base hierarchy model.""" from ansys.edb.core.inner import ObjBase, messages from ansys.edb.core.session import ModelServiceStub, StubAccessor, StubType class Model(ObjBase): - """Class representing a base hierarchy model object.""" + """Represents a base hierarchy model object.""" __stub: ModelServiceStub = StubAccessor(StubType.model) @@ -13,6 +13,6 @@ def clone(self): Returns ------- - Model + Model cloned. """ return self.__class__(self.__stub.Clone(messages.edb_obj_message(self))) diff --git a/src/ansys/edb/core/hierarchy/netlist_model.py b/src/ansys/edb/core/hierarchy/netlist_model.py index aea495c0ff..f620e023da 100644 --- a/src/ansys/edb/core/hierarchy/netlist_model.py +++ b/src/ansys/edb/core/hierarchy/netlist_model.py @@ -1,25 +1,27 @@ -"""Netlist Model.""" +"""Netlist model.""" from ansys.edb.core.hierarchy.model import Model from ansys.edb.core.inner import messages from ansys.edb.core.session import NetlistModelServiceStub, StubAccessor, StubType class NetlistModel(Model): - """Class representing a Netlist model object.""" + """Represents a netlist model object.""" __stub: NetlistModelServiceStub = StubAccessor(StubType.netlist_model) @classmethod def create(cls, name): - """Create a new netlist model with a netlist name. + """Create a netlist model. Parameters ---------- name : str + Name of the netlist model. Returns ------- NetlistModel + Netlist model created. """ return cls(cls.__stub.Create(messages.str_message(name))) diff --git a/src/ansys/edb/core/hierarchy/pin_group.py b/src/ansys/edb/core/hierarchy/pin_group.py index f67501c607..50230864ff 100644 --- a/src/ansys/edb/core/hierarchy/pin_group.py +++ b/src/ansys/edb/core/hierarchy/pin_group.py @@ -1,4 +1,4 @@ -"""Pin Group.""" +"""Pin group.""" from ansys.edb.core.edb_defs import LayoutObjType from ansys.edb.core.inner import ObjBase, messages @@ -7,7 +7,7 @@ class PinGroup(ObjBase): - """Class representing a pin group object.""" + """Represents a pin group object.""" __stub = StubAccessor(StubType.pin_group) layout_obj_type = LayoutObjType.PIN_GROUP @@ -19,15 +19,16 @@ def create(cls, layout, name, padstack_instances): Parameters ---------- layout : :class:`Layout ` - Layout that owns the pin group. + Layout to create the pin group in. name : str - Name of pin group to be created. + Name of the pin group. padstack_instances : list[:class:`PadstackInstance `] + List of padstack instances. Returns ------- PinGroup - Newly created pin group. + Pin group created. """ return PinGroup( cls.__stub.Create(messages.pin_group_creation_message(layout, name, padstack_instances)) @@ -35,36 +36,37 @@ def create(cls, layout, name, padstack_instances): @classmethod def find(cls, layout, name): - """Find a pin group by name. + """Find a pin group by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout to search the pin group in. + Layout to search for the pin group. name : str Name of the pin group. Returns ------- PinGroup - Pin group that is found, None otherwise. + Pin group found, ``None`` otherwise. """ return PinGroup(cls.__stub.FindByName(messages.pin_group_lookup_message(layout, name))) @classmethod def unique_name(cls, layout, prefix): - """Return a unique pin group name in the layout using the given prefix. + """Get a unique pin group name in the layout using a given prefix. Parameters ---------- layout : :class:`Layout ` - Layout to search the pin group in. + Layout to search for the pin group. prefix : str Prefix of the unique name. Returns ------- str + Name of the pin group found. """ return cls.__stub.GetUniqueName( messages.pin_group_get_unique_name_message(layout, prefix) @@ -74,34 +76,36 @@ def unique_name(cls, layout, prefix): def name(self): """:obj:`str`: Name of the pin group. - Read-Only. + This property is read-only. """ return self.__stub.GetName(self.msg).value @property def pins(self): """:obj:`list` of :class:`PadstackInstances `: \ - List of padstack instances. + Padstack instances. - Read-Only. + This property is read-only. """ ps = self.__stub.GetPins(self.msg).items return [PadstackInstance(p) for p in ps] def add_pins(self, pins): - """Add the list of padstack instances to the group. + """Add a list of padstack instances to the group. Parameters ---------- pins : list[:class:`PadstackInstance `] + List of padstick instances. """ self.__stub.AddPins(messages.pin_group_pins_modify_message(self, pins)) def remove_pins(self, pins): - """Remove the list of padstack instances from the group. + """Remove a list of padstack instances from the group. Parameters ---------- 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 9038ea2b84..87470c1a8c 100644 --- a/src/ansys/edb/core/hierarchy/pin_pair_model.py +++ b/src/ansys/edb/core/hierarchy/pin_pair_model.py @@ -1,4 +1,4 @@ -"""Pin Pair Model.""" +"""Pin pair model.""" import google.protobuf.empty_pb2 as empty_pb2 @@ -8,22 +8,23 @@ class PinPairModel(Model): - """Class representing a Pin Pair model object.""" + """Represents a pin pair model object.""" __stub: PinPairModelServiceStub = StubAccessor(StubType.pin_pair_model) @classmethod def create(cls): - """Create a new pin pair model. + """Create a pin pair model. Returns ------- PinPairModel + Pin pair model created. """ return cls(cls.__stub.Create(empty_pb2.Empty())) def rlc(self, pin_pair): - """Get RLC value for a pin pair. + """Get the RLC value for a pin pair. Parameters ---------- @@ -40,7 +41,7 @@ def rlc(self, pin_pair): return None def set_rlc(self, pin_pair, rlc): - """Set RLC value for a pin pair. + """Set the RLC value for a pin pair. Parameters ---------- @@ -50,7 +51,7 @@ def set_rlc(self, pin_pair, rlc): self.__stub.SetRlc(messages.pin_pair_model_rlc_message(self, pin_pair, rlc)) def delete_rlc(self, pin_pair): - """Delete RLC value for a pin pair. + """Delete the RLC value for a pin pair. Parameters ---------- diff --git a/src/ansys/edb/core/hierarchy/sparameter_model.py b/src/ansys/edb/core/hierarchy/sparameter_model.py index 8a9c8d9869..21bddf549a 100644 --- a/src/ansys/edb/core/hierarchy/sparameter_model.py +++ b/src/ansys/edb/core/hierarchy/sparameter_model.py @@ -1,24 +1,24 @@ -"""S-Parameter Model.""" +"""S-parameter model.""" from ansys.edb.core.hierarchy.model import Model from ansys.edb.core.inner import messages from ansys.edb.core.session import SParameterModelServiceStub, StubAccessor, StubType class SParameterModel(Model): - """Class representing a S-Parameter model object.""" + """Represents an S-parameter model object.""" __stub: SParameterModelServiceStub = StubAccessor(StubType.sparameter_model) @classmethod def create(cls, name, ref_net): - """Create a new SParameter Model. + """Create an S-parameter model. Parameters ---------- name : str - Name of component model. + Name of the S-parameter model. ref_net : str - Name of reference net. + Name of the reference net. """ return cls(cls.__stub.Create(messages.sparameter_model_message(name, ref_net))) @@ -28,7 +28,7 @@ def _properties(self): @property def component_model(self): - """:obj:`str`: Name of component model.""" + """:obj:`str`: Name of the component model.""" return self._properties.name @component_model.setter @@ -37,7 +37,7 @@ def component_model(self, name): @property def reference_net(self): - """:obj:`str`: Name of reference net.""" + """:obj:`str`: Name of the reference net.""" return self._properties.ref_net @reference_net.setter diff --git a/src/ansys/edb/core/hierarchy/spice_model.py b/src/ansys/edb/core/hierarchy/spice_model.py index 3822d57aab..6c7d337524 100644 --- a/src/ansys/edb/core/hierarchy/spice_model.py +++ b/src/ansys/edb/core/hierarchy/spice_model.py @@ -5,22 +5,22 @@ class SPICEModel(Model): - """Class representing a SPICE model object.""" + """Represents a SPICE model object.""" __stub: SpiceModelServiceStub = StubAccessor(StubType.spice_model) @classmethod def create(cls, name, path, sub_circuit): - """Create a new SPICE model. + """Create a SPICE model. Parameters ---------- name : str - SPICE model file name. + Name of the SPICE model file. path : str - SPICE model file path. + Path to the SPICE model file. sub_circuit : str - Sub circuit name of SPICE model. + Subcircuit name of the SPICE model. """ return cls(cls.__stub.Create(messages.spice_model_message(name, path, sub_circuit))) @@ -30,7 +30,7 @@ def _properties(self): @property def model_name(self): - """:obj:`str`: Name of SPICE model file.""" + """:obj:`str`: Name of the SPICE model file.""" return self._properties.name @model_name.setter @@ -39,7 +39,7 @@ def model_name(self, name): @property def model_path(self): - """:obj:`str`: File path of SPICE model.""" + """:obj:`str`: Path to the SPICE model file.""" return self._properties.path @model_path.setter @@ -48,7 +48,7 @@ def model_path(self, path): @property def sub_circuit(self): - """:obj:`str`: The name of the sub circuit in the SPICE model.""" + """:obj:`str`: Name of the subcircuit in the SPICE model.""" return self._properties.sub_ckt @sub_circuit.setter @@ -56,25 +56,25 @@ def sub_circuit(self, name): self.__stub.SetSubCkt(messages.string_property_message(self, name)) def add_terminal(self, terminal, pin): - """Add a terminal with pin number. + """Add a terminal with a pin number. Parameters ---------- terminal : str - The terminal name to associate with the pin. + Terminal name to associate with the pin. pin : str - The pin number. + Pin number. """ self.__stub.AddTerminalPinPair( messages.spice_model_net_terminal_pin_message(self, terminal, pin) ) def remove_terminal(self, terminal): - """Remove a terminal with pin number. + """Remove a terminal. Parameters ---------- terminal : str - The terminal name. + Terminal name. """ self.__stub.RemoveTerminalPinPair(messages.string_property_message(self, terminal)) diff --git a/src/ansys/edb/core/hierarchy/structure3d.py b/src/ansys/edb/core/hierarchy/structure3d.py index 60eb3146b5..c28bbe00be 100644 --- a/src/ansys/edb/core/hierarchy/structure3d.py +++ b/src/ansys/edb/core/hierarchy/structure3d.py @@ -12,7 +12,7 @@ class MeshClosure(Enum): - """Enum representing mesh closure types. + """Provides an enum representing mesh closure types. - OPEN_ENDED - ENDS_CLOSED @@ -27,35 +27,35 @@ class MeshClosure(Enum): class Structure3D(Group): - """Class representing a structure3d object.""" + """Represents a 3D structure.""" __stub: Structure3DServiceStub = StubAccessor(StubType.structure3d) @classmethod def create(cls, layout, name): - """Create Structure3D. + """Create a 3D structure. Parameters ---------- layout : :class:`Layout ` - Layout that owns the structure3d. + Layout to create the 3D structure in. name : str - Name of the structure3d object. + Name of the 3D structure. Returns ------- Structure3D - Newly created structure3d. + 3D structure created. """ return Structure3D(cls.__stub.Create(messages.object_name_in_layout_message(layout, name))) def get_material(self, evaluate): - """Get material for the structure3d. + """Get the material for the 3D structure. Parameters ---------- evaluate : bool - Any references in the material name will be resolved if True. + Whether to resolve any references in the material name. Returns ------- @@ -64,32 +64,31 @@ def get_material(self, evaluate): return self.__stub.GetMaterial(messages.bool_property_message(self, evaluate)).value def set_material(self, mat_name): - """Set material for the structure3d. + """Set material for the 3D structure. Parameters ---------- mat_name : str + Material name. """ self.__stub.SetMaterial(messages.string_property_message(self, mat_name)) @property def thickness(self): - """:class:`Value `: Thickness for the structure3d.""" + """:class:`Value `: Thickness for the 3D structure.""" return Value(self.__stub.GetThickness(self.msg)) @thickness.setter def thickness(self, value): - """Set thickness for the structure3d.""" self.__stub.SetThickness( messages.value_property_message(self, messages.value_message(value)) ) @property def mesh_closure(self): - """:obj:`MeshClosure`: Mesh closure property for the structure3d.""" + """:obj:`MeshClosure`: Mesh closure property for the 3D structure.""" return MeshClosure(self.__stub.GetMeshClosureProp(self.msg).closure_type) @mesh_closure.setter def mesh_closure(self, value): - """Set mesh closure property for the structure3d.""" self.__stub.SetMeshClosureProp(messages.set_closure_message(self, value)) diff --git a/src/ansys/edb/core/hierarchy/via_group.py b/src/ansys/edb/core/hierarchy/via_group.py index cc7df6aed2..883b0df088 100644 --- a/src/ansys/edb/core/hierarchy/via_group.py +++ b/src/ansys/edb/core/hierarchy/via_group.py @@ -1,4 +1,4 @@ -"""Via Group.""" +"""Via group.""" from ansys.api.edb.v1.via_group_pb2_grpc import ViaGroupServiceStub @@ -8,27 +8,28 @@ class ViaGroup(Group): - """Class representing a via group object.""" + """Represents a via group object.""" __stub: ViaGroupServiceStub = StubAccessor(StubType.via_group) @classmethod def create_with_primitives(cls, layout, primitives, is_persistent): - """Create a via group(s) with primitives. + """Create one or more via groups with primitives. Parameters ---------- layout : :class:`Layout ` - Layout that owns the via group. + Layout to create the via groups in. primitives : list[:class:`Primitive `] - List of primitives that will be used to create the via groups. + List of primitives to use to create the via groups. is_persistent : bool - Primitives are preserved during via group creation if True, deleted otherwise. + Whether to preserve primitives during via group creation. If ``False`` + primitives are deleted during via group creation. Returns ------- list[ViaGroup] - List of newly created via group(s). + List of newly created via groups. """ via_groups = cls.__stub.CreateWithPrimitives( messages.via_group_create_with_primitives_message(layout, primitives, is_persistent) @@ -45,17 +46,17 @@ def create_with_outline(cls, layout, outline, conductivity_ratio, layer, net=Non Layout that owns the via group. outline : list[:class:`Point2D `] or \ list[:class:`PolygonData `] - List of primitives that will be used to create the via groups. + List of primitives to use to create the via group. conductivity_ratio : float layer : str or :class:`Layer ` Placement layer for the via group. - net : str or :class:`Net `, optional - Net the via group should belong to. + net : str or :class:`Net `, default: None + Net that the via group is to belong to. Returns ------- ViaGroup - Newly created via group. + Via group created. """ return ViaGroup( cls.__stub.CreateWithOutline( @@ -72,14 +73,14 @@ def find(cls, layout, name): Parameters ---------- layout : :class:`Layout ` - Layout to search the via group in. + Layout to search for the via group. name : str Name of the via group. Returns ------- ViaGroup - ViaGroup that is found, None otherwise. + Via group that is found, ``None`` otherwise. """ return ViaGroup(cls.__stub.FindByName(messages.object_name_in_layout_message(layout, name))) @@ -88,7 +89,7 @@ def find(cls, layout, name): def outline(self): """:class:`PolygonData `: Via group outline. - Read-Only. + This property is read-only. """ return self.__stub.GetOutline(self.msg) @@ -96,14 +97,14 @@ def outline(self): def conductor_percentage(self): """:obj:`float`: Conductor percentage of the via group. - Read-Only. + This property is read-only. """ return self.__stub.GetConductorPercentage(self.msg).value @property def persistent(self): - """:obj:`bool`: Determine whether the primitives in the via group are persistent. + """:obj:`bool`: Flag indicating if the primitives in the via group are persistent. - Read-Only. + This property is read-only. """ return self.__stub.IsPersistent(self.msg).value diff --git a/src/ansys/edb/core/inner/base.py b/src/ansys/edb/core/inner/base.py index 25d6721b1e..cd49e82084 100644 --- a/src/ansys/edb/core/inner/base.py +++ b/src/ansys/edb/core/inner/base.py @@ -1,13 +1,13 @@ -"""Base Model.""" +"""Base model.""" from ansys.api.edb.v1.edb_messages_pb2 import EDBObjMessage class ObjBase: - """Class representing a base object that all gRPC-related models extend from.""" + """Provides the base object that all gRPC-related models extend from.""" def __init__(self, msg): - """Initialize object. + """Initialize the base object. Parameters ---------- @@ -17,40 +17,41 @@ def __init__(self, msg): @property def is_null(self): - """:obj:`bool`: Determine whether this object exists in EDB. + """:obj:`bool`: Flag indicating if the object exists in the database. - Read-Only. + This property is read-only. """ return self.id == 0 @property def id(self): - """:obj:`int`: The unique ID of an EDB object. 0 indicates invalid object. + """:obj:`int`: Unique ID of the EDB object. - Read-Only. + A ``0`` indicates an invalid object. + + This property is read-only. """ return self._id @property def msg(self): - """:obj:`EDBObjMessage` : Protobuf message that represents this object's ID. + """:obj:`EDBObjMessage`: Protobuf message that represents the object's ID. - This property can only be set to None. + This property can only be set to ``None``. """ return EDBObjMessage(id=self.id) @msg.setter def msg(self, val): - """Modify protobuf message that represents this object's ID. can only be used to reset ID to None.""" if val is None: self._id = 0 class TypeField(object): - """A descriptor for a type field that can be overridden by subclasses. + """Provides a descriptor for a type field that can be overridden by subclasses. - Can have optional `@property def _type(self)` in the same class as a fallback method to - fetch the type from server, in case static type is unknown. + You can have an optional ``@property def _type(self)`` in the same class as a fallback method to + fetch the type from the server in case the static type is unknown. Examples -------- @@ -77,7 +78,7 @@ def __init__(self, tp): self._type = tp def __get__(self, instance, owner): - """Return the static type if possible, otherwise fetch and return the instance type.""" + """Get the static type if possible. Otherwise, fetch and return the instance type.""" if self._type is not None: # return static type return self._type diff --git a/src/ansys/edb/core/inner/conn_obj.py b/src/ansys/edb/core/inner/conn_obj.py index 87aafe1930..2bf062d387 100644 --- a/src/ansys/edb/core/inner/conn_obj.py +++ b/src/ansys/edb/core/inner/conn_obj.py @@ -1,4 +1,4 @@ -"""ConnObj.""" +"""Connection object.""" from ansys.api.edb.v1 import connectable_pb2 from ansys.edb.core.edb_defs import LayoutObjType @@ -23,7 +23,7 @@ def set_net_message(target, net): class ConnObj(layout_obj.LayoutObj): - """Base class representing ConnObj.""" + """Provides the base class representing the connection object.""" __stub: ConnectableServiceStub = StubAccessor(StubType.connectable) layout_obj_type = LayoutObjType.INVALID_LAYOUT_OBJ @@ -65,19 +65,19 @@ def get_client_prim_type_from_class(): @classmethod def find_by_id(cls, layout, uid): - """Find a :term:`Connectable` object by Database ID. + """Find a :term:`Connectable` object by database ID in a given layout. Parameters ---------- layout : :class:`Layout ` - The owning Layout. + Layout to search for the :term:`Connectable` object. uid : int - Database ID + Database ID. Returns ------- :term:`Connectable` - Connectable of the given uid. + Connectable object with the given database ID. """ found_edb_obj_msg = cls.__stub.FindByIdAndType( _QueryBuilder.find_id_layout_obj_message( @@ -88,12 +88,12 @@ def find_by_id(cls, layout, uid): @property def edb_uid(self): - """:obj:`int`: The unique, persistent ID for the :term:`Connectable` object. + """:obj:`int`: Unique, persistent ID for the :term:`Connectable` object. - This id is unique across the all :term:`Connectable` objects in the cell and persistent across closing and \ + This ID is unique across all :term:`Connectable` objects in the cell and persistent across closing and \ reopening the database. - Read-Only. + This property is read-only. """ return self.__stub.GetId(self.msg).id @@ -114,14 +114,13 @@ def group(self): @group.setter def group(self, group): - """Set the group of the connectable object.""" self.__stub.SetGroup(messages.pointer_property_message(target=self, value=group)) @property def net(self): """:class:`Net `: Net of the :term:`Connectable` object. - This property can be set with :class:`Net `, str, None. + This property can be set with a :class:`Net ` instance, a string, or ``None``. """ from ansys.edb.core.net import Net @@ -129,64 +128,66 @@ def net(self): @net.setter def net(self, net): - """Set the net of the connectable object.""" self.__stub.SetNet(_QueryBuilder.set_net_message(self, net)) def create_stride(self): - """Create a stride model. + """Create a Stride model from an MCAD file. Returns ------- :class:`McadModel ` + Stride model created. """ return mm.McadModel.create_stride(connectable=self) def create_hfss(self): - """Create a HFSS model. + """Create an HFSS model from an MCAD file. Returns ------- :class:`McadModel ` + HFSS model created. """ return mm.McadModel.create_hfss(connectable=self) def create_3d_comp(self): - """Create a 3dComp model. + """Create a 3D composite model from an MCAD file. Returns ------- :class:`McadModel ` + 3D composite model created. """ return mm.McadModel.create_3d_comp(connectable=self) @property def is_mcad(self): - """:obj:`bool`: True if this is a Mcad Model. + """:obj:`bool`: Flag indicating if this is an MCAD model. - Read-Only. + This property is read-only. """ return mm.McadModel.is_mcad(self) @property def is_mcad_stride(self): - """:obj:`bool`: True if this is a Stride Mcad Model. + """:obj:`bool`: Flag indicating if this is a Stride MCAD model. - Read-Only. + This property is read-only. """ return mm.McadModel.is_mcad_stride(self) @property def is_mcad_hfss(self): - """:obj:`bool`: True if this is a HFSS Mcad Model. + """:obj:`bool`: Flag indicating if this is an HFSS MCAD model. - Read-Only. + This property is read-only. """ return mm.McadModel.is_mcad_hfss(self) @property def is_mcad_3d_comp(self): - """:obj:`bool`: True if this is a 3D Comp Mcad Model. + """:obj:`bool`: Flag indicating if this is a 3D composite MCAD model. - Read-Only. + This property is read-only. """ return mm.McadModel.is_mcad_3d_comp(self) diff --git a/src/ansys/edb/core/inner/edb_logging.py b/src/ansys/edb/core/inner/edb_logging.py index b8e5ac49a1..02f518596d 100644 --- a/src/ansys/edb/core/inner/edb_logging.py +++ b/src/ansys/edb/core/inner/edb_logging.py @@ -1,9 +1,9 @@ -"""``log`` module. +"""Log module. ## Objective This module intends to create a general framework for logging. -This module is built upon ``logging`` library and it does NOT intend to -replace it rather provide a way to interact between ``logging`` and ``EDB Client``. +This module is built upon the ``logging`` library and it does NOT intend to +replace it but rather provide a way to interact between ``logging`` and ``EDB Client``. Usage ----- @@ -11,29 +11,29 @@ Global logger ------------- -There is a global logger named ``EDB_LOGGER` -If you want to use this global logger, you must call at the top of your module: +There is a global logger named ``EDB_LOGGER``. +If you want to use this global logger, you must call it at the top of your module: .. code:: from ansys.edb.core.utility import EDB_LOG -It should be noticed that the default logging level of ``LOG`` is ``ERROR``. -To change this and output lower level messages you can use the next snippet: +The default logging level of ``LOG`` is ``ERROR``. +To change this and output lower-level messages, you can use this code: .. code:: EDB_LOG.setLevel(logging.DEBUG) By default, this logger does not log to a file. -If you wish to do so, you can add a file handler using: +If you want to log to a file, can add a file handler using this code: .. code:: import os file_path = os.path.join(os.getcwd(), 'edb_client.log') EDB_LOG.log_to_file(file_path) -This sets the logger to be redirected also to that file. +The preceding code also sets the logger to be redirected to the file. -To log using this logger, just call the desired method as a normal logger. +To log using this logger, call the desired method as a normal logger: .. code:: import logging @@ -69,77 +69,78 @@ class EDBLogger: - """EDBLogger used for each edb_client session. + """Provides the EDB logger used for each EDC client session. - This class allows you to add handler to a file or standard output. + This class allows you to add a handler to a file or to the standard output. """ file_handler = None std_out_handler = None def __init__(self, level=logging.DEBUG, to_file=False, to_stdout=True, filename=FILE_NAME): - """Customize logger class for edb_client. + """Customize logger class for the EDB cclient. Parameters ---------- - level : int, optional - Level of logging as defined in the package ``logging``. By default 'DEBUG'. - to_file : bool, optional - To record the logs in a file, by default ``False``. - to_stdout : bool, optional - To output the logs to the standard output, which is the - command line. By default ``True``. - filename : str, optional - Name of the output file. By default ``edb_client.log``. + level : int, default: DEBUG + Level of logging as defined in the ``logging`` package. + to_file : bool, default: False + Whether to record the logs in a file. + to_stdout : bool, default: True + Whether to output the logs to the standard output, which is the + command line. + filename : str, default: FILE_NAME + Name of the output file. The default is ``FILE_NAME, in which case + ``edb_client.log`` is used. """ self.logger = logging.getLogger("edb_client") # Creating default main logger. self.logger.setLevel(level) self.logger.propagate = True if to_file or filename != FILE_NAME: - # We record to file + # Record to file self.log_to_file(filename=filename, level=level) if to_stdout: self.log_to_stdout(level=level) - add_handling_uncaught_exceptions(self.logger) # Using logger to record unhandled exceptions + add_handling_uncaught_exceptions(self.logger) # Use logger to record unhandled exceptions def __getattr__(self, item): - """Delegate method calls to logger.""" + """Delegate method calls to the logger.""" return getattr(self.logger, item) def stop_logging_to_stdout(self): - """Stop logging to stdout.""" + """Stop logging to the standard output.""" if self.std_out_handler is not None: self.logger.removeHandler(self.std_out_handler) self.std_out_handler = None def stop_logging_to_file(self): - """Stop logging to file.""" + """Stop logging to the file.""" if self.file_handler is not None: self.logger.removeHandler(self.file_handler) self.file_handler = None def log_to_file(self, filename=FILE_NAME, level=LOG_LEVEL): - """Add file handler to logger. + """Add file handler to the logger. Parameters ---------- - filename : str, optional - Name of the file where the logs are recorded. By default FILE_NAME - level : str, optional - Level of logging. E.x. 'DEBUG'. By default LOG_LEVEL + filename : str, default: FILE_NAME + Name of the file where logs are recorded. + level : str, default: default: LOG_LEVEL + Level of logging, such as ``DEBUG``. """ addfile_handler(self, filename=filename, level=level, write_headers=True) def log_to_stdout(self, level=LOG_LEVEL): - """Add standard output handler to the logger. + """Add the standard output handler to the logger. Parameters ---------- - level : str, optional - Level of logging record. By default LOG_LEVEL + level : str, default: LOG_LEVEL + Level of logging record. """ add_stdout_handler(self, level=level) @@ -148,7 +149,7 @@ def log_to_stdout(self, level=LOG_LEVEL): def add_handling_uncaught_exceptions(logger): - """Redirects the output of an exception to the logger.""" + """Redirect the output of an exception to the logger.""" def handle_exception(exc_type, exc_value, exc_traceback): if issubclass(exc_type, KeyboardInterrupt): @@ -166,18 +167,18 @@ def addfile_handler(edb_logger, filename=FILE_NAME, level=LOG_LEVEL, write_heade Parameters ---------- edb_logger : EDBLogger - EDBLogger where to add the file handler. - filename : str, optional - Name of the output file. By default FILE_NAME - level : str, optional - Level of log recording. By default LOG_LEVEL - write_headers : bool, optional - Record the headers to the file. By default False + EDB logger to add the file handler to. + filename : str, default: FILE_NAME. + Name of the output file. + level : str, default: LOG_LEVEL + Level of log recording. + write_headers : bool, default: False + Whether to write the headers to the file. Returns ------- logger - Return the EDBLogger object. + EDBLogger object. """ file_handler = logging.FileHandler(filename) file_handler.setLevel(level) @@ -200,16 +201,17 @@ def add_stdout_handler(edb_logger, level=LOG_LEVEL, write_headers=False): Parameters ---------- edb_logger : EDBLogger - EDBLogger where to add the file handler. - level : str, optional - Level of log recording. By default ``logging.DEBUG``. - write_headers : bool, optional - Record the headers to the file. By default ``False``. + EDBLogger to add the file handler to. + level : str, default: LOG_LEVEL + Level of log recording. The default is ``LOG_LEVEL``, in which + case ``logging.DEBUG`` is used. + write_headers : bool, default: False + Whether to write the headers to the file. Returns ------- logger - The EDBLogger object. + EDBLogger object. """ std_out_handler = logging.StreamHandler() std_out_handler.setLevel(level) diff --git a/src/ansys/edb/core/inner/exceptions.py b/src/ansys/edb/core/inner/exceptions.py index 4d06d2c0e0..6fefd00d97 100644 --- a/src/ansys/edb/core/inner/exceptions.py +++ b/src/ansys/edb/core/inner/exceptions.py @@ -4,22 +4,22 @@ class ErrorCode(Enum): - """EDB Exception Types.""" + """Provides EDB exception types.""" UNKNOWN = "Unknown exception: {}." - UNAVAILABLE = "EDB Server is not accessible. Please make sure an instance is listening on the specified port." - - NO_SESSIONS = "No active session detected." - + UNAVAILABLE = ( + "EDB server is not accessible. Make sure an instance is listening on the specified port.." + ) + NO_SESSIONS = "No active session is detected." STARTUP_UNEXPECTED = "An unexpected error occurred when starting the local server: {}." STARTUP_TIMEOUT = "Could not start local server: Time out" STARTUP_MULTI_SESSIONS = "There can be only one session active at a time." STARTUP_NO_EXECUTABLE = ( - "Could not find necessary executables. Make sure Ansys EM root directory is correct." + "Could not find necessary executables. Make sure the Ansys EM root directory is correct." ) - STARTUP_FAILURE_LICENSE = "Could not start local server: No valid license detected." - STARTUP_FAILURE_EDB = "Could not start local server: Failed to initialize EDB." - STARTUP_FAILURE = "Could not start local server due to unknown reason." + STARTUP_FAILURE_LICENSE = "Could not start the local server: No valid license detected." + STARTUP_FAILURE_EDB = "Could not start the local server: Failed to initialize EDB." + STARTUP_FAILURE = "Could not start the local server due to unknown reason." INVALID_ARGUMENT = "{}" @@ -30,7 +30,7 @@ def _message(code, *args): class EDBSessionException(Exception): - """Base class for exceptions related to EDB sessions.""" + """Provides the base class for exceptions related to EDB sessions.""" def __init__(self, code, *args): """Initialize EDBSessionException.""" @@ -39,7 +39,7 @@ def __init__(self, code, *args): class InvalidArgumentException(EDBSessionException): - """Exception when a request fails due to invalid argument.""" + """Provides the exception that occurs when a request fails due to an invalid argument.""" def __init__(self, response): """Initialize InvalidArgumentException.""" diff --git a/src/ansys/edb/core/inner/factory.py b/src/ansys/edb/core/inner/factory.py index 3fbe560447..6cbd46b4fc 100644 --- a/src/ansys/edb/core/inner/factory.py +++ b/src/ansys/edb/core/inner/factory.py @@ -9,7 +9,7 @@ def create_conn_obj(msg): - """Create a ConnObj of its derived type based on its layout obj type. + """Create a connection object of its derived type based on its layout object type. Parameters ---------- @@ -36,4 +36,4 @@ def create_conn_obj(msg): return PinGroup(msg) elif type == LayoutObjType.VOLTAGE_REGULATOR: return layout.VoltageRegulator(msg) - raise TypeError("Encountered an unknown layout obj type") + raise TypeError("Encountered an unknown layout object type.") diff --git a/src/ansys/edb/core/inner/interceptors.py b/src/ansys/edb/core/inner/interceptors.py index 58e5ceaf6f..15d97b2c60 100644 --- a/src/ansys/edb/core/inner/interceptors.py +++ b/src/ansys/edb/core/inner/interceptors.py @@ -1,4 +1,4 @@ -"""Defines client side GRPC interceptors.""" +"""Client-side gRPC interceptors.""" import abc import logging @@ -9,7 +9,7 @@ class Interceptor(UnaryUnaryClientInterceptor, metaclass=abc.ABCMeta): - """Base interceptor class.""" + """Provides the base interceptor class.""" def __init__(self, logger): """Initialize a base interceptor with a logger.""" @@ -21,7 +21,7 @@ def _post_process(self, response): pass def intercept_unary_unary(self, continuation, client_call_details, request): - """Intercept a GRPC call.""" + """Intercept a gRPC call.""" response = continuation(client_call_details, request) self._post_process(response) @@ -30,7 +30,7 @@ def intercept_unary_unary(self, continuation, client_call_details, request): class LoggingInterceptor(Interceptor): - """Log EDB errors on each request.""" + """Logs EDB errors on each request.""" _LOG_LEVELS = { "log-fatal": logging.CRITICAL, @@ -61,7 +61,7 @@ def _post_process(self, response): class ExceptionInterceptor(Interceptor): - """Handle general GRPC errors on each request.""" + """Handles general gRPC errors on each request.""" def _post_process(self, response): code = response.code() diff --git a/src/ansys/edb/core/inner/layout_obj.py b/src/ansys/edb/core/inner/layout_obj.py index dfe0fb3968..c4633cb08c 100644 --- a/src/ansys/edb/core/inner/layout_obj.py +++ b/src/ansys/edb/core/inner/layout_obj.py @@ -1,4 +1,4 @@ -"""Layout Object.""" +"""Layout object.""" import ansys.api.edb.v1.layout_obj_pb2 as layout_obj_pb2 @@ -37,7 +37,7 @@ def get_product_property_ids_type_msg(obj, prod_id, layout_type): class LayoutObj(ObjBase): - """Layout Object class.""" + """Represents a layout object.""" __stub: LayoutObjServiceStub = StubAccessor(StubType.layout_obj) layout_obj_type = LayoutObjType.INVALID_LAYOUT_OBJ @@ -46,15 +46,15 @@ class LayoutObj(ObjBase): def obj_type(self): """:class:`LayoutObjType `: Layout object type. - Read-Only. + This property is read-only. """ return self.layout_obj_type @property def layout(self): - """:class:`Layout `: Owning layout of the object. + """:class:`Layout `: Layout owning the object. - Read-Only. + This property is read-only. """ return layout.Layout( self.__stub.GetLayout(_QueryBuilder.layout_obj_target_msg(self, self.layout_obj_type)) @@ -65,19 +65,19 @@ def delete(self): self.__stub.Delete(_QueryBuilder.layout_obj_target_msg(self, self.layout_obj_type)) def get_product_property(self, prod_id, attr_id): - """Get the product property of the layout object with the given product and attribute ids. + """Get the product property of the layout object for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` ID representing a product that supports the EDB. attr_id : int - A user-defined id that identifies the string value stored in the property + User-defined ID that identifies the string value stored in the property. Returns ------- str - The string stored in this property. + String stored in the product property. """ return self.__stub.GetProductProperty( _QueryBuilder.get_product_property_type_msg( @@ -86,16 +86,16 @@ def get_product_property(self, prod_id, attr_id): ).value def set_product_property(self, prod_id, attr_id, prop_value): - """Set the product property of the layout object associated with the given product and attribute ids. + """Set the product property of the layout object for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` ID representing a product that supports the EDB. attr_id : int - A user-defined id that identifies the string value stored in the property + User-defined ID that identifies the string value stored in the property. prop_value : str - The string stored in this property. + String stored in the property. """ self.__stub.SetProductProperty( _QueryBuilder.set_product_property_type_msg( @@ -104,7 +104,7 @@ def set_product_property(self, prod_id, attr_id, prop_value): ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to the provided product id for the layout object. + """Get a list of attribute IDs given a product ID for the layout object. Parameters ---------- @@ -114,7 +114,7 @@ def get_product_property_ids(self, prod_id): Returns ------- list[int] - List of the user-defined attribute IDs for properties stored in this object + All user-defined attribute IDs for properties stored in the object """ attr_ids = self.__stub.GetProductPropertyIds( _QueryBuilder.get_product_property_ids_type_msg(self, prod_id, self.layout_obj_type) diff --git a/src/ansys/edb/core/inner/messages.py b/src/ansys/edb/core/inner/messages.py index 9efb80c5a4..c1ba847ded 100644 --- a/src/ansys/edb/core/inner/messages.py +++ b/src/ansys/edb/core/inner/messages.py @@ -1,4 +1,4 @@ -"""Protobuf interface for message creation.""" +"""Protobuf interface for message creatia.""" from ansys.api.edb.v1 import arc_data_pb2 from ansys.api.edb.v1.cell_instance_pb2 import ( @@ -151,60 +151,60 @@ def str_message(s: str): - """Convert to StringValue.""" + """Convert to a ``StringValue`` message.""" return StringValue(value=s) if s is not None else None def bool_message(b: bool): - """Convert to BoolValue.""" + """Convert to a ``BoolValue`` message.""" return BoolValue(value=b) if b is not None else None def int64_message(i: int): - """Convert to Int64Value.""" + """Convert to an ``Int64Value`` message.""" return Int64Value(value=i) if i is not None else None def float_message(v: float): - """Convert to FloatValue.""" + """Convert to a ``FloatValue`` message.""" return FloatValue(value=v) def double_message(v: float): - """Convert to DoubleValue.""" + """Convert to a ``DoubleValue`` message.""" return DoubleValue(value=v) def empty_message(): - """Get Empty message.""" + """Get an empty message.""" return Empty() def str_pair_message(pair): - """Convert to StringPairMessage.""" + """Convert to a ``StringPairMessage`` object.""" return StringPairMessage(first=pair[0], second=pair[1]) def point_message(point): - """Convert to PointMessage.""" + """Convert to a ``PointMessage`` object.""" point = conversions.to_point(point) return PointMessage(x=value_message(point.x), y=value_message(point.y)) def point_property_message(target, point): - """Convert to PointPropertyMessage.""" + """Convert to a ``PointPropertyMessage`` object.""" return PointPropertyMessage(target=target.msg, point=point_message(point)) def point_data_rotate_message(point, center, angle): - """Convert to PointRotateMessage.""" + """Convert to a ``PointRotateMessage`` object.""" return PointDataRotateMessage( point=point_message(point), rotation_center=point_message(center), angle=angle ) def point_data_with_line_message(point, line_start, line_end): - """Convert to PointDataWithLineMessage.""" + """Convert to a ``PointDataWithLineMessage`` object.""" return PointDataWithLineMessage( point=point_message(point), line_start=point_message(line_start), @@ -213,17 +213,17 @@ def point_data_with_line_message(point, line_start, line_end): def box_message(ll, ur): - """Convert to BoxMessage.""" + """Convert to a ``BoxMessage`` object.""" return BoxMessage(lower_left=point_message(ll), upper_right=point_message(ur)) def circle_message(center, radius): - """Convert to CircleMessage.""" + """Convert to a ``CircleMessage`` object.""" return CircleMessage(center=point_message(center), radius=value_message(radius)) def polygon_data_message(pd): - """Convert to PolygonDataMessage.""" + """Convert to a ``PolygonDataMessage`` object.""" return PolygonDataMessage( points=[point_message(pt) for pt in pd.points], closed=pd.is_closed, @@ -233,37 +233,37 @@ def polygon_data_message(pd): def polygon_data_list_message(pds): - """Convert to PolygonDataListMessage.""" + """Convert to a ``PolygonDataListMessage`` object.""" pds = _as_array(pds) return PolygonDataListMessage(polygons=[polygon_data_message(pd) for pd in pds]) def polygon_data_with_tol_message(pd, tol): - """Convert to PolygonDataWithToleranceMessage.""" + """Convert to a ``PolygonDataWithToleranceMessage`` object.""" return PolygonDataWithToleranceMessage(polygon=polygon_data_message(pd), tol=tol) def polygon_data_pair_message(pds1, pds2): - """Convert to PolygonDataPairMessage.""" + """Convert to a ``PolygonDataPairMessage`` object.""" return PolygonDataPairMessage( first=polygon_data_list_message(pds1), second=polygon_data_list_message(pds2) ) def polygon_data_pair_with_tolerance_message(pd1, pd2, tol): - """Convert to PolygonDataPairWithToleranceMessage.""" + """Convert to a ``PolygonDataPairWithToleranceMessage`` object.""" return PolygonDataPairWithToleranceMessage( first=polygon_data_message(pd1), second=polygon_data_message(pd2), tol=tol ) def _polygon_data_transform_message_point_value(point, value): - """Convert to PolygonDataTransformMessage.""" + """Convert to a ``PolygonDataTransformMessage`` object.""" return PolygonDataTransformMessage.PointValueMessage(point=point_message(point), value=value) def polygon_data_transform_message(op, pd, *args): - """Convert to PolygonDataTransformMessage.""" + """Convert to a ``PolygonDataTransformMessage`` object.""" payload = {} if op == "move": payload["move"] = point_message(args[0]) @@ -278,7 +278,7 @@ def polygon_data_transform_message(op, pd, *args): def polygon_data_remove_arc_message(pd, max_chord_error, max_arc_angle, max_points): - """Convert to PolygonDataRemoveArcMessage.""" + """Convert to a ``PolygonDataRemoveArcMessage`` object.""" return PolygonDataRemoveArcMessage( polygon=polygon_data_message(pd), max_chord_error=max_chord_error, @@ -288,19 +288,19 @@ def polygon_data_remove_arc_message(pd, max_chord_error, max_arc_angle, max_poin def polygon_data_with_circle_message(pd, center, radius): - """Convert to PolygonDataWithCircleMessage.""" + """Convert to a ``PolygonDataWithCircleMessage`` object.""" return PolygonDataWithCircleMessage( polygon=polygon_data_message(pd), circle=circle_message(center, radius) ) def polygon_data_with_point_message(pd, point): - """Convert to PolygonDataWithPointMessage.""" + """Convert to a ``PolygonDataWithPointMessage`` object.""" return PolygonDataWithPointMessage(polygon=polygon_data_message(pd), point=point_message(point)) def polygon_data_with_points_message(pd, point=None, polygon=None): - """Convert to PolygonDataWithPointsMessage.""" + """Convert to a ``PolygonDataWithPointsMessage`` object.""" payload = {} if point is not None: payload["point"] = point_message(point) @@ -311,7 +311,7 @@ def polygon_data_with_points_message(pd, point=None, polygon=None): def polygon_data_expand_message(pd, offset, tol, round_corner, max_corner_expansion): - """Convert to PolygonDataExpandMessage.""" + """Convert to a ``PolygonDataExpandMessage`` object.""" return PolygonDataExpandMessage( polygon=polygon_data_message(pd), offset=offset, @@ -322,7 +322,7 @@ def polygon_data_expand_message(pd, offset, tol, round_corner, max_corner_expans def polygon_data_get_alpha_shape_message(pd, alpha): - """Convert to PolygonDataGetAlphaShapeMessage.""" + """Convert to a ``PolygonDataGetAlphaShapeMessage`` object.""" return PolygonDataGetAlphaShapeMessage(polygon=polygon_data_message(pd), alpha=alpha) @@ -336,7 +336,7 @@ def _arc_rotation_dir(dir): def arc_message(arc): - """Convert to ArcMessage.""" + """Convert to an ``ArcMessage`` object.""" message = arc_data_pb2.ArcMessage(start=point_message(arc.start), end=point_message(arc.end)) h, opts = arc._height, arc._height_options # noqa if h is not None: @@ -352,7 +352,7 @@ def arc_message(arc): message.thru.CopyFrom(point_message(opts["thru"])) else: raise TypeError( - "ArcData was not initialized with correct parameters to compute height." + "`ArcData` instance was not initialized with correct parameters to compute height." f"Received '{opts}'" ) @@ -360,57 +360,57 @@ def arc_message(arc): def arc_data_two_points(arc1, arc2): - """Convert to ArcDataTwoArcsMessage.""" + """Convert to an ``ArcDataTwoArcsMessage`` object.""" return arc_data_pb2.ArcDataTwoArcsMessage(arc1=arc_message(arc1), arc2=arc_message(arc2)) def int_property_message(target, value): - """Convert to IntPropertyMessage.""" + """Convert to an ``IntPropertyMessage`` object.""" return IntPropertyMessage(target=target.msg, value=value) def bool_property_message(target, value): - """Convert to BoolPropertyMessage.""" + """Convert to a ``BoolPropertyMessage`` object.""" return BoolPropertyMessage(target=target.msg, value=value) def string_property_message(target, value): - """Convert to StringPropertyMessage.""" + """Convert to a ``StringPropertyMessage`` object.""" return StringPropertyMessage(target=target.msg, value=value) def string_pair_property_message(target, pair): - """Convert to StringPairPropertyMessage.""" + """Convert to a ``StringPairPropertyMessage`` object.""" return StringPairPropertyMessage(target=target.msg, values=str_pair_message(pair)) def value_property_message(target, value): - """Convert to ValuePropertyMessage.""" + """Convert to a ``ValuePropertyMessage`` object.""" return ValuePropertyMessage(target=edb_obj_message(target), value=value_message(value)) def pointer_property_message(target, value): - """Convert to PointerPropertyMessage.""" + """Convert to a ``PointerPropertyMessage`` object.""" return PointerPropertyMessage(target=target.msg, value=value.msg) def edb_obj_name_message(obj, name): - """Convert to EDBObjNameMessage.""" + """Convert to an ``EDBObjNameMessage`` object.""" return EDBObjNameMessage(target=edb_obj_message(obj), name=name) def object_name_in_layout_message(layout, name): - """Convert to ObjectNameInLayoutMessage.""" + """Convert to an ``ObjectNameInLayoutMessage`` object.""" return ObjectNameInLayoutMessage(layout=layout.msg, name=name) def group_modify_member_message(target, member): - """Convert to GroupModifyMemberMessage.""" + """Convert to a ``GroupModifyMemberMessage`` object.""" return GroupModifyMemberMessage(target=target.msg, member=member.msg) def via_group_create_with_primitives_message(layout, primitives, is_persistent): - """Convert to ViaGroupCreateWithPrimitivesMessage.""" + """Convert to a ``ViaGroupCreateWithPrimitivesMessage`` object.""" return ViaGroupCreateWithPrimitivesMessage( layout=layout.msg, primitives=edb_obj_collection_message(primitives), @@ -419,7 +419,7 @@ def via_group_create_with_primitives_message(layout, primitives, is_persistent): def via_group_create_with_outline_message(layout, outline, conductivity_ratio, layer, net=None): - """Convert to ViaGroupCreateWithOutlineMessage.""" + """Convert to a ``ViaGroupCreateWithOutlineMessage`` object.""" return ViaGroupCreateWithOutlineMessage( layout=layout.msg, points=polygon_data_message(outline), @@ -430,14 +430,14 @@ def via_group_create_with_outline_message(layout, outline, conductivity_ratio, l def cell_instance_creation_message(layout, name, ref): - """Convert to CellInstanceCreationMessage.""" + """Convert to a ``CellInstanceCreationMessage`` object.""" return CellInstanceCreationMessage( target=object_name_in_layout_message(layout, name), ref=edb_obj_message(ref) ) def cell_instance_parameter_override_message(target, param_name, param_value): - """Convert to CellInstanceParameterOverrideMessage.""" + """Convert to a ``CellInstanceParameterOverrideMessage`` object.""" return CellInstanceParameterOverride( target=edb_obj_message(target), pname=param_name, @@ -446,7 +446,7 @@ def cell_instance_parameter_override_message(target, param_name, param_value): def inst_array_creation_message(layout, name, ref, orig, xaxis, yaxis, xcount, ycount): - """Convert to InstArrayCreationMessage.""" + """Convert to an ``InstArrayCreationMessage`` object.""" return InstArrayCreationMessage( layout=string_property_message(layout, name), ref=edb_obj_message(ref), @@ -459,12 +459,12 @@ def inst_array_creation_message(layout, name, ref, orig, xaxis, yaxis, xcount, y def component_def_creation_message(db, comp_name, fp): - """Convert to ComponentDefCreateMessage.""" + """Convert to a ``ComponentDefCreateMessage`` object.""" return ComponentDefCreateMessage(db=db.msg, comp_name=comp_name, fp=fp.msg) def transform_message(transform): - """Convert to TransformMessage.""" + """Convert to a ``TransformMessage`` object.""" if transform is None: return None else: @@ -478,12 +478,12 @@ def transform_message(transform): def transform_property_message(target, transform): - """Convert to TransformPropertyMessage.""" + """Convert to a ``TransformPropertyMessage`` object.""" return TransformPropertyMessage(target=target.msg, transf=transform_message(transform)) def point3d_message(point3d): - """Convert to Point3DMessage.""" + """Convert to a ``Point3DMessage`` object.""" if point3d is None: return None else: @@ -492,19 +492,19 @@ def point3d_message(point3d): def point_3d_property_message(target, value): - """Convert to Point3DPropertyMessage.""" + """Convert to a ``Point3DPropertyMessage`` object.""" return Point3DPropertyMessage(target=edb_obj_message(target), origin=point3d_message(value)) def layout_get_items_message(layout, item_type): - """Convert to LayoutGetItemsMessage.""" + """Convert to a ``LayoutGetItemsMessage`` object.""" return LayoutGetItemsMessage(layout=layout.msg, obj_type=item_type.value) def layout_expanded_extent_message( layout, nets, extent, exp, exp_unitless, use_round_corner, num_increments ): - """Convert to LayoutExpandedExtentMessage.""" + """Convert to a ``LayoutExpandedExtentMessage`` object.""" return LayoutExpandedExtentMessage( layout=layout.msg, nets=edb_obj_collection_message(nets), @@ -517,14 +517,14 @@ def layout_expanded_extent_message( def layout_convert_p2v_message(layout, primitives, is_pins): - """Convert to LayoutConvertP2VMessage.""" + """Convert to a ``LayoutConvertP2VMessage`` message.""" return LayoutConvertP2VMessage( layout=layout.msg, primitives=edb_obj_collection_message(primitives), is_pins=is_pins ) def temperature_settings_message(settings): - """Convert to TemperatureSettingsMessage.""" + """Convert to a ``TemperatureSettingsMessage`` object.""" return TemperatureSettingsMessage( temperature=value_message(settings.temperature), include_temp_dependence=settings.include_temp_dependence, @@ -533,7 +533,7 @@ def temperature_settings_message(settings): def hfss_extent_message(val): - """Convert to ExtentMessage.""" + """Convert to an ``ExtentMessage`` object.""" if type(val) == float or type(val) == int: value = val absolute = False @@ -543,7 +543,7 @@ def hfss_extent_message(val): def hfss_extent_info_message(hfss_info): - """Convert to HfssExtentInfoMessage.""" + """Convert to an ``HfssExtentInfoMessage`` object.""" return HfssExtentInfoMessage( use_open_region=hfss_info.use_open_region, extent_type=hfss_info.extent_type.value, @@ -566,22 +566,22 @@ def hfss_extent_info_message(hfss_info): def design_mode_property_message(target, mode): - """Convert to DesignModePropertyMessage.""" + """Convert to a ``DesignModePropertyMessage`` object.""" return DesignModePropertyMessage(target=target, mode=mode.value) def cell_find_message(database, cell_type, cell_name=None, cell_id=None): - """Convert to CellFindMessage.""" + """Convert to a ``CellFindMessage`` object.""" if cell_name is not None: return CellFindMessage(database=database.msg, type=cell_type.value, name=cell_name) elif cell_id is not None: return CellFindMessage(database=database.msg, type=cell_type.value, id=cell_id) else: - assert False, "either name or id must be provided to find a cell." + assert False, "Either name or ID must be provided to find a cell." def cell_cutout_message(cell, included_nets, clipped_nets, clipping_polygon, clean_clipping): - """Convert to CellCutOutMessage.""" + """Convert to a ``CellCutOutMessage`` object.""" return CellCutOutMessage( cell=cell.msg, included_nets=edb_obj_collection_message(included_nets), @@ -592,24 +592,24 @@ def cell_cutout_message(cell, included_nets, clipped_nets, clipping_polygon, cle def cell_set_temperature_settings_message(cell, temp_settings): - """Convert to CellSetTemperatureSettingsMessage.""" + """Convert to a ``CellSetTemperatureSettingsMessage`` object.""" return CellSetTemperatureSettingsMessage( cell=cell.msg, temp_settings=temperature_settings_message(temp_settings) ) def point_term_params_message(layer, point): - """Convert to PointTermParamMessage.""" + """Convert to a ``PointTermParamMessage`` object.""" return PointTermParamsMessage(point=point_message(point), layer=layer_ref_message(layer)) def point_term_set_params_message(term, layer, point): - """Convert to PointTermSetParamsMessage.""" + """Convert to a ``PointTermSetParamsMessage`` object.""" return PointTermSetParamsMessage(term=term.msg, params=point_term_params_message(layer, point)) def point_term_creation_message(layout, net, layer, name, point): - """Convert to PointTermCreationMessage.""" + """Convert to a ``PointTermCreationMessage`` object.""" return PointTermCreationMessage( layout=layout.msg, net=net_ref_message(net), @@ -619,14 +619,14 @@ def point_term_creation_message(layout, net, layer, name, point): def padstack_inst_term_params_message(padstack_instance, layer): - """Convert to PadstackInstTermParamsMessage.""" + """Convert to a ``PadstackInstTermParamsMessage`` object.""" return PadstackInstTermParamsMessage( padstack_instance=padstack_instance.msg, layer=layer_ref_message(layer) ) def padstack_inst_term_creation_message(layout, name, padstack_instance, layer, net, is_ref): - """Convert to PadstackInstTermCreationMessage.""" + """Convert to a ``PadstackInstTermCreationMessage`` object.""" return PadstackInstTermCreationsMessage( layout=layout.msg, name=name, @@ -637,38 +637,38 @@ def padstack_inst_term_creation_message(layout, name, padstack_instance, layer, def padstack_inst_term_set_params_message(term, padstack_instance, layer): - """Convert to PadstackInstTermSetParamsMessage.""" + """Convert to a ``PadstackInstTermSetParamsMessage`` object.""" return PadstackInstTermSetParamsMessage( term=term.msg, params=padstack_inst_term_params_message(padstack_instance, layer) ) def pin_group_creation_message(layout, name, padstack_instances): - """Convert to PinGroupCreationMessage.""" + """Convert to a ``PinGroupCreationMessage`` object.""" return PinGroupCreationMessage( layout=layout.msg, name=name, pins=[pi.msg for pi in padstack_instances] ) def pin_group_lookup_message(layout, name): - """Convert to PinGroupLookupMessage.""" + """Convert to a ``PinGroupLookupMessage`` object.""" return PinGroupLookupMessage(layout=layout.msg, name=name) def pin_group_get_unique_name_message(layout, prefix): - """Convert to PinGroupGetUniqueNameMessage.""" + """Convert to a ``PinGroupGetUniqueNameMessage`` object.""" return PinGroupGetUniqueNameMessage(layout=layout.msg, prefix=prefix) def pin_group_pins_modify_message(pin_group, padstack_instances): - """Convert to PinGroupPinsModifyMessage.""" + """Convert to a ``PinGroupPinsModifyMessage`` object.""" return PinGroupPinsModifyMessage( pin_group=pin_group.msg, pins=[pi.msg for pi in padstack_instances] ) def pin_group_term_creation_message(layout, net_ref, name, pin_group, is_ref): - """Convert to PinGroupTermCreationMessage.""" + """Convert to a ``PinGroupTermCreationMessage`` object.""" return PinGroupTermCreationMessage( layout=layout.msg, net=net_ref_message(net_ref), @@ -679,22 +679,22 @@ def pin_group_term_creation_message(layout, net_ref, name, pin_group, is_ref): def pin_group_term_set_pin_group_message(term, pin_group): - """Convert to PinGroupTermSetPinGroupMessage.""" + """Convert to a ``PinGroupTermSetPinGroupMessage`` object.""" return PinGroupTermSetPinGroupMessage(term=term.msg, pin_group=pin_group.msg) def pin_group_term_set_layer_message(term, layer_ref): - """Convert to PinGroupTermSetLayerMessage.""" + """Convert to a ``PinGroupTermSetLayerMessage`` object.""" return PinGroupTermSetLayerMessage(term=term.msg, layer=layer_ref_message(layer_ref)) def edge_creation_message(edge_type, **params): - """Convert to EdgeCreationMessage.""" + """Convert to an ``EdgeCreationMessage`` object.""" return EdgeCreationMessage(edge_type=edge_type, params=edge_params_message(edge_type, **params)) def edge_params_message(edge_type, **params): - """Convert to EdgeParamsMessage.""" + """Convert to an ``EdgeParamsMessage`` object.""" if edge_type == EdgeType.PRIMITIVE_EDGE: return EdgeParamsMessage(primitve_params=primitive_edge_params_message(**params)) elif edge_type == EdgeType.PAD_EDGE: @@ -704,12 +704,12 @@ def edge_params_message(edge_type, **params): def primitive_edge_params_message(primitive, point): - """Convert to PrimitiveEdgeParamsMessage.""" + """Convert to a ``PrimitiveEdgeParamsMessage`` object.""" return PrimitiveEdgeParamsMessage(primitive=primitive.msg, point=point_message(point)) def pad_edge_params_message(padstack_instance, layer, arc): - """Convert to PadEdgeParamsMessage.""" + """Convert to a ``PadEdgeParamsMessage`` object.""" return PadEdgeParamsMessage( padstack_instance=padstack_instance.msg, layer=layer_ref_message(layer), @@ -718,7 +718,7 @@ def pad_edge_params_message(padstack_instance, layer, arc): def edge_term_creation_message(layout, net, name, edges, is_ref): - """Convert to EdgeTermCreationMessage.""" + """Convert to an ``EdgeTermCreationMessage`` object.""" return EdgeTermCreationMessage( layout=layout.msg, net=net_ref_message(net), @@ -729,12 +729,12 @@ def edge_term_creation_message(layout, net, name, edges, is_ref): def edge_term_set_edges_message(terminal, edges): - """Convert to EdgeTermSetEdgesMessage.""" + """Convert to an ``EdgeTermSetEdgesMessage`` object.""" return EdgeTermSetEdgesMessage(term=terminal.msg, edges=[edge.msg for edge in edges]) def term_set_params_message(term, **params): - """Convert to TermSetParamsMessage.""" + """Convert to a ``TermSetParamsMessage`` object.""" payload = {"term": term.msg} if "boundary_type" in params: @@ -777,9 +777,9 @@ def term_set_params_message(term, **params): def term_set_ref_message(term_params, layer_params): - """Convert to TermSetRefMessage.""" + """Convert to a ``TermSetRefMessage`` object.""" if len(term_params) and len(layer_params): - raise RuntimeError("can only reference either a terminal or a layer.") + raise RuntimeError("Can only reference either a terminal or a layer.") if len(term_params) == 1: return TermSetRefMessage(ref_term=edb_obj_message(*term_params)) if len(layer_params): @@ -787,7 +787,7 @@ def term_set_ref_message(term_params, layer_params): def term_set_layer_message(layer_ref, contexts=None): - """Convert to TermSetLayerMessage.""" + """Convert to a ``TermSetLayerMessage`` object.""" contexts = [] if contexts is None else contexts return TermSetLayerMessage( layer=layer_ref_message(layer_ref), contexts=[str_message(ctx) for ctx in contexts] @@ -795,24 +795,24 @@ def term_set_layer_message(layer_ref, contexts=None): def term_find_by_name_message(layout, name): - """Convert to TermFindByNameMessage.""" + """Convert to a ``TermFindByNameMessage`` object.""" return TermFindByNameMessage(layout=layout.msg, name=name) def term_get_product_solver_message(term, product_id): - """Convert to TermGetProductSolversMessage.""" + """Convert to a ``TermGetProductSolversMessage`` object.""" return TermGetProductSolversMessage(term=term.msg, product_id=product_id) def term_set_solver_option_message(term, product_id, name, option): - """Convert to TermSetSolverOptionMessage.""" + """Convert to a ``TermSetSolverOptionMessage`` object.""" return TermSetSolverOptionMessage( term=term.msg, product_id=product_id, name=name, option=option ) def term_inst_creation_message(layout, net_ref, cell_inst, name): - """Convert to TermInstCreationMessage.""" + """Convert to a ``TermInstCreationMessage`` object.""" return TermInstCreationMessage( layout=layout.msg, net=net_ref_message(net_ref), @@ -822,7 +822,7 @@ def term_inst_creation_message(layout, net_ref, cell_inst, name): def term_inst_term_creation_message(layout, net_ref, name, term_inst, is_ref): - """Convert to TermInstTermCreationMessage.""" + """Convert to a ``TermInstTermCreationMessage`` object.""" return TermInstTermCreationMessage( layout=layout.msg, net=net_ref_message(net_ref), @@ -833,12 +833,12 @@ def term_inst_term_creation_message(layout, net_ref, name, term_inst, is_ref): def term_inst_term_set_instance_message(term, term_inst): - """Convert to TermInstTermSetInstanceMessage.""" + """Convert to a ``TermInstTermSetInstanceMessage`` object.""" return TermInstTermSetInstanceMessage(term=term.msg, term_inst=term_inst.msg) def edb_obj_message(obj): - """Convert to EDBObjMessage.""" + """Convert to an ``EDBObjMessage`` object.""" if obj is None: return None elif isinstance(obj, EDBObjMessage): @@ -850,12 +850,12 @@ def edb_obj_message(obj): def edb_obj_collection_message(objs): - """Convert to EDBObjCollectionMessage.""" + """Convert to an ``EDBObjCollectionMessage``object.""" return EDBObjCollectionMessage(items=[edb_obj_message(obj) for obj in objs]) def rlc_message(rlc): - """Convert to RlcMessage.""" + """Convert to an ``RlcMessage`` object.""" return RlcMessage( r=value_message(rlc.r), l=value_message(rlc.l), @@ -868,7 +868,7 @@ def rlc_message(rlc): def port_post_processing_prop_message(prop): - """Convert to PortPostProcessingPropMessage.""" + """Convert to a ``PortPostProcessingPropMessage`` object.""" return PortPostProcessingPropMessage( voltage_magnitude=value_message(prop.voltage_magnitude), voltage_phase=value_message(prop.voltage_phase), @@ -881,7 +881,7 @@ def port_post_processing_prop_message(prop): def material_properties_message(**kwargs): - """Convert to MaterialDefPropertiesMessage.""" + """Convert to a ``MaterialDefPropertiesMessage`` object.""" params = { key: value_message(value) for key, value in kwargs.items() @@ -904,7 +904,7 @@ def material_properties_message(**kwargs): def layer_ref_message(layer): - """Convert to LayerRefMessage.""" + """Convert to a ``LayerRefMessage`` object.""" if layer is None: return None elif type(layer) == str: @@ -914,7 +914,7 @@ def layer_ref_message(layer): def net_ref_message(net): - """Convert to NetRefMessage.""" + """Convert to a ``NetRefMessage`` object.""" if type(net) == str: return NetRefMessage(name=str_message(net)) else: @@ -922,7 +922,7 @@ def net_ref_message(net): def adaptive_frequency_message(frequency: str, max_delta_s: float, max_passes: int): - """Convert to AdaptiveFrequencyDataMessage.""" + """Convert to an ``AdaptiveFrequencyDataMessage`` object.""" return AdaptiveFrequencyDataMessage( adaptive_frequency=frequency, max_delta=str(max_delta_s), max_passes=max_passes ) @@ -948,7 +948,7 @@ def _mesh_op_skin_depth_message(mesh_op): def mesh_operation_message(mesh_op): - """Convert to MeshOperationMessage.""" + """Convert to a ``MeshOperationMessage`` object.""" mesh_op_msg = MeshOperationMessage( name=mesh_op.name, enabled=mesh_op.enabled, @@ -968,7 +968,7 @@ def _mesh_op_net_layer_message(net, layer, is_sheet): def value_message(val): - """Convert data into a ValueMessage. + """Convert data into a ``ValueMessage`` object. Parameters ---------- @@ -999,12 +999,12 @@ def value_message(val): def product_property_id_message(prod_id, att_id): - """Convert to ProductPropertyIdMessage.""" + """Convert to a ``ProductPropertyIdMessage`` object.""" return ProductPropertyIdMessage(product_id=prod_id.value, attribute_id=att_id) def set_product_property_message(obj, prod_id, att_id, value): - """Convert to SetProductPropertyMessage.""" + """Convert to a ``SetProductPropertyMessage`` object.""" return SetProductPropertyMessage( edb_obj=obj.msg, product_prop_id=product_property_id_message(prod_id, att_id), @@ -1013,75 +1013,75 @@ def set_product_property_message(obj, prod_id, att_id, value): def get_product_property_message(obj, prod_id, att_id): - """Convert to GetProductPropertyMessage.""" + """Convert to a ``GetProductPropertyMessage`` object.""" return GetProductPropertyMessage( edb_obj=obj.msg, product_prop_id=product_property_id_message(prod_id, att_id) ) def get_product_property_ids_message(obj, prod_id): - """Convert to GetProductPropertyIdsMessage.""" + """Convert to a ``GetProductPropertyIdsMessage`` object.""" return GetProductPropertyIdsMessage(edb_obj=obj.msg, product_id=prod_id.value) def edb_internal_id_message(id): - """Convert to EDBInternalIdMessage.""" + """Convert to an ``EDBInternalIdMessage`` object.""" return EDBInternalIdMessage(id=id) def component_group_create_message(layout, name, comp_name): - """Convert to ComponentGroupCreateMessage.""" + """Convert to a ``ComponentGroupCreateMessage`` object.""" return ComponentGroupCreateMessage( target=object_name_in_layout_message(layout, name), comp=comp_name ) def set_component_group_type_message(obj, comp_type): - """Convert to SetComponentGroupTypeMessage.""" + """Convert to a ``SetComponentGroupTypeMessage`` object.""" return SetComponentGroupTypeMessage( target=obj.msg, comp_type=ComponentTypeMessage(comp_type=comp_type.value) ) def set_closure_message(obj, closure_type): - """Convert to SetClosureMessage.""" + """Convert to a ``SetClosureMessage`` object.""" return SetClosureMessage( target=obj.msg, closure_type=ClosureMessage(closure_type=closure_type.value) ) def strings_message(strings): - """Convert to StringsMessage.""" + """Convert to a ``StringsMessage`` object.""" return StringsMessage(strings=strings) def strings_property_message(target, value): - """Convert to StringPropertyMessage.""" + """Convert to a ``StringPropertyMessage`` object.""" return StringsPropertyMessage(edb_obj=target.msg, strings=value) def edb_obj_pair_message(edb_obj_0, edb_obj_1): - """Convert to EDBObjPairMessage.""" + """Convert to an ``EDBObjPairMessage`` object.""" return EDBObjPairMessage(edb_obj_0=edb_obj_0.msg, edb_obj_1=edb_obj_1.msg) def layer_ref_property_message(edb_obj, layer_ref): - """Convert to LayerRefPropertyMessage.""" + """Convert to a ``LayerRefPropertyMessage`` object.""" return LayerRefPropertyMessage(edb_obj=edb_obj.msg, layer_ref=layer_ref_message(layer_ref)) def double_property_message(edb_obj, double): - """Convert to DoublePropertyMessage.""" + """Convert to a ``DoublePropertyMessage`` object.""" return DoublePropertyMessage(target=edb_obj.msg, value=double) def net_get_layout_obj_message(obj, layout_obj_type): - """Convert to NetGetLayoutObjMessage.""" + """Convert to a ``NetGetLayoutObjMessage`` object.""" return NetGetLayoutObjMessage(net=edb_obj_message(obj), obj_type=layout_obj_type.value) def differential_pair_creation_message(layout, name, pos_net, neg_net): - """Convert to DifferentialPairCreationMessage.""" + """Convert to a ``DifferentialPairCreationMessage`` object.""" return DifferentialPairCreationMessage( layout=edb_obj_message(layout), name=name, @@ -1091,14 +1091,14 @@ def differential_pair_creation_message(layout, name, pos_net, neg_net): def differential_pair_net_refs_message(dp, pos_net, neg_net): - """Convert to DifferentialPairNetRefsMessage.""" + """Convert to a ``DifferentialPairNetRefsMessage`` object.""" return DifferentialPairNetRefsMessage( dp=edb_obj_message(dp), pos_net=net_ref_message(pos_net), neg_net=net_ref_message(neg_net) ) def mcad_model_creation_message(connectable, layout, filename): - """Convert to McadModelCreationMessage.""" + """Convert to an ``McadModelCreationMessage`` object.""" if connectable is not None: param = McadModelCreationMessage.WithConnObj(obj=edb_obj_message(connectable)) return McadModelCreationMessage(conn_obj=param) @@ -1106,11 +1106,11 @@ def mcad_model_creation_message(connectable, layout, filename): param = McadModelCreationMessage.WithLayout(obj=edb_obj_message(layout), file_name=filename) return McadModelCreationMessage(layout=param) else: - raise TypeError("either a connectable object or layout+filename must be provided.") + raise TypeError("Either a connectable object or layout and filename must be provided.") def mcad_model_hfss_creation_message(connectable, layout, filename, design): - """Convert to McadModelHfssCreationMessage.""" + """Convert to an ``McadModelHfssCreationMessage`` object.""" if connectable is not None: param = McadModelHfssCreationMessage.WithConnObj(obj=edb_obj_message(connectable)) return McadModelCreationMessage(conn_obj=param) @@ -1120,18 +1120,20 @@ def mcad_model_hfss_creation_message(connectable, layout, filename, design): ) return McadModelCreationMessage(layout=param) else: - raise TypeError("either a connectable object or layout+filename+design must be provided.") + raise TypeError( + "Either a connectable object or layout, filename, and design must be provided." + ) def mcad_model_rotation_message(axis_from, axis_to, angle): - """Convert to McadModelRotationMessage.""" + """Convert to an ``McadModelRotationMessage`` object.""" return McadModelRotationMessage( axis_from=point3d_message(axis_from), axis_to=point3d_message(axis_to), angle=angle ) def mcad_model_set_rotation_message(mcad_model, axis_from, axis_to, angle): - """Convert to McadModelSetRotationMessage.""" + """Convert to an ``McadModelSetRotationMessage`` object.""" return McadModelSetRotationMessage( model=edb_obj_message(mcad_model), rotation=mcad_model_rotation_message(axis_from, axis_to, angle), @@ -1139,58 +1141,58 @@ def mcad_model_set_rotation_message(mcad_model, axis_from, axis_to, angle): def mcad_model_bool_message(mcad_model, index, value): - """Convert to McadModelBoolMessage.""" + """Convert to an ``McadModelBoolMessage`` object.""" return McadModelBoolMessage(model=edb_obj_message(mcad_model), index=index, value=value) def mcad_model_string_message(mcad_model, index, value): - """Convert to McadModelStringMessage.""" + """Convert to an ``McadModelStringMessage`` object.""" return McadModelStringMessage(model=edb_obj_message(mcad_model), index=index, value=value) def set_die_type_message(obj, die_type): - """Convert to DieTypePropertyMessage.""" + """Convert to a ``DieTypePropertyMessage`` object.""" return DieTypePropertyMessage(target=obj.msg, die_type=DieTypeMessage(die_type=die_type.value)) def set_die_orientation_message(obj, die_orientation): - """Convert to DieOrientationPropertyMessage.""" + """Convert to a ``DieOrientationPropertyMessage`` object.""" return DieOrientationPropertyMessage( target=obj.msg, die_orientation=DieOrientationMessage(die_orientation=die_orientation.value) ) def value_pair_message(val1, val2): - """Convert to ValuePairMessage.""" + """Convert to a ``ValuePairMessage`` object.""" return ValuePairMessage(val1=value_message(val1), val2=value_message(val2)) def value_pair_property_message(target, val1, val2): - """Convert to ValuePairPropertyMessage.""" + """Convert to a ``ValuePairPropertyMessage`` object.""" return ValuePairPropertyMessage( target=edb_obj_message(target), values=value_pair_message(val1, val2) ) def points_message(points): - """Convert to PointsMessage.""" + """Convert to a ``PointsMessage`` object.""" return PointsMessage(points=[point_message(point) for point in points]) def points_property_message(target, points): - """Convert to PointsPropertyMessage.""" + """Convert to a ``PointsPropertyMessage`` object.""" return PointsPropertyMessage( target=edb_obj_message(target), points=[point_message(point) for point in points] ) def polygon_data_property_message(obj, polygon): - """Convert to PolygonDataPropertyMessage.""" + """Convert to a ``PolygonDataPropertyMessage`` object.""" return PolygonDataPropertyMessage(target=obj.msg, value=polygon_data_message(polygon)) def heat_sink_message(heat_sink): - """Convert to HeatSinkMessage.""" + """Convert to a ``HeatSinkMessage`` object.""" return HeatSinkMessage( thickness=value_message(heat_sink.fin_thickness), spacing=value_message(heat_sink.fin_spacing), @@ -1201,31 +1203,31 @@ def heat_sink_message(heat_sink): def set_heat_sink_message(target, heat_sink): - """Convert to SetHeatSinkMessage.""" + """Convert to a ``SetHeatSinkMessage`` object.""" return SetHeatSinkMessage(target=edb_obj_message(target), value=heat_sink_message(heat_sink)) def pin_pair_model_rlc_message(model, pin_pair, rlc): - """Convert to PinPairModelRlcPropertyMessage.""" + """Convert to a ``PinPairModelRlcPropertyMessage`` object.""" return PinPairModelRlcPropertyMessage( model=edb_obj_message(model), pins=str_pair_message(pin_pair), rlc=rlc_message(rlc) ) def point_pair_message(point_pair): - """Convert to PointPairMessage.""" + """Convert to a ``PointPairMessage`` object.""" return PointPairMessage( point_0=point_message(point_pair[0]), point_1=point_message(point_pair[1]) ) def sparameter_model_message(name, ref_net): - """Convert to SParameterModelMessage.""" + """Convert to a ``SParameterModelMessage`` object.""" return SParameterModelMessage(name=name, ref_net=ref_net) def power_module_message(power_module): - """Convert to PowerModuleMessage.""" + """Convert to a ``PowerModuleMessage`` object.""" return PowerModuleMessage( comp_group_name=power_module.comp_group_name, pos_output_terminal=power_module.pos_output_terminal, @@ -1237,36 +1239,36 @@ def power_module_message(power_module): def point_pair_property_message(target, point_pair): - """Convert to PointPairPropertyMessage.""" + """Convert to a ``PointPairPropertyMessage`` object.""" return PointPairPropertyMessage( target=edb_obj_message(target), point_pair=point_pair_message(point_pair) ) def spice_model_message(name, path, sub_circuit): - """Convert to SpiceModelMessage.""" + """Convert to a ``SpiceModelMessage`` object.""" return SpiceModelMessage(name=name, path=path, sub_ckt=sub_circuit) def spice_model_net_terminal_pin_message(model, terminal, pin): - """Convert to SpiceModelNewTerminalPinMessage.""" + """Convert to a ``SpiceModelNewTerminalPinMessage`` object.""" return SpiceModelNewTerminalPinMessage( target=edb_obj_message(model), terminal=terminal, pin=pin ) def doubles_message(doubles): - """Convert to DoublesMessage.""" + """Convert to a ``DoublesMessage`` object.""" return DoublesMessage(doubles=doubles) def doubles_property_message(edb_obj, doubles): - """Convert to DoublesPropertyMessage.""" + """Convert to a ``DoublesPropertyMessage`` object.""" return DoublesPropertyMessage(edb_obj=edb_obj_message(edb_obj), doubles=doubles) def cpos_3d_message(point3d): - """Convert to CPos3DMessage.""" + """Convert to a ``CPos3DMessage`` object.""" if point3d is None: return None else: @@ -1276,27 +1278,27 @@ def cpos_3d_message(point3d): def cpos_3d_property_message(target, value): - """Convert to CPos3DPropertyMessage.""" + """Convert to a ``CPos3DPropertyMessage`` object.""" return CPos3DPropertyMessage(target=edb_obj_message(target), value=cpos_3d_message(value)) def cpos_3d_pair_message(x, y): - """Convert to CPos3DPairMessage.""" + """Convert to a ``CPos3DPairMessage`` object.""" return CPos3DPairMessage(x=cpos_3d_message(x), y=cpos_3d_message(y)) def cpos_3d_triple_message(x, y, z): - """Convert to CPos3DTripleMessage.""" + """Convert to a ``CPos3DTripleMessage`` object.""" return CPos3DTripleMessage(x=cpos_3d_message(x), y=cpos_3d_message(y), z=cpos_3d_message(z)) def cpos_3d_double_message(pos, value): - """Convert to CPos3DDoubleMessage.""" + """Convert to a ``CPos3DDoubleMessage`` object.""" return CPos3DDoubleMessage(pos=cpos_3d_message(pos), value=value) def mx_convergence_data_msg(mx_data): - """Convert to MatrixConvergenceDataMessage.""" + """Convert to a ``MatrixConvergenceDataMessage`` object.""" mx_entry_msgs = [] for mx_entry in mx_data.entry_list: mx_entry_msgs.append( @@ -1318,12 +1320,12 @@ def mx_convergence_data_msg(mx_data): def base_adaptive_frequency_solution_msg(adaptive_frequency, max_delta): - """Convert to AdaptiveFrequencyDataMessage.""" + """Convert to an ``AdaptiveFrequencyDataMessage`` object.""" return AdaptiveFrequencyDataMessage(adaptive_frequency=adaptive_frequency, max_delta=max_delta) def single_frequency_adaptive_solution_msg(single_freq_adapt_sol): - """Convert to SingleFrequencyAdaptiveSolutionMessage.""" + """Convert to a ``SingleFrequencyAdaptiveSolutionMessage`` object.""" return SingleFrequencyAdaptiveSolutionMessage( adaptive_frequency=base_adaptive_frequency_solution_msg( single_freq_adapt_sol.adaptive_frequency, single_freq_adapt_sol.max_delta @@ -1335,7 +1337,7 @@ def single_frequency_adaptive_solution_msg(single_freq_adapt_sol): def multi_adaptive_freq_to_msg(multi_adaptive_freq): - """Convert to AdaptiveMultiFrequencyDataMessage.""" + """Convert to an ``AdaptiveMultiFrequencyDataMessage`` object.""" return AdaptiveMultiFrequencyDataMessage( adaptive_frequency=base_adaptive_frequency_solution_msg( multi_adaptive_freq.adaptive_frequency, multi_adaptive_freq.max_delta @@ -1345,7 +1347,7 @@ def multi_adaptive_freq_to_msg(multi_adaptive_freq): def multi_frequency_adaptive_solution_msg(multi_freq_adapt_sol): - """Convert to MultiFrequencyAdaptiveSolutionMessage.""" + """Convert to a ``MultiFrequencyAdaptiveSolutionMessage`` object.""" return MultiFrequencyAdaptiveSolutionMessage( adaptive_frequencies=[ multi_adaptive_freq_to_msg(multi_adaptive_freq) @@ -1356,7 +1358,7 @@ def multi_frequency_adaptive_solution_msg(multi_freq_adapt_sol): def broadband_solution_msg(broadband_adapt_sol): - """Convert to BroadbandFrequencyAdaptiveSolutionMessage.""" + """Convert to a ``BroadbandFrequencyAdaptiveSolutionMessage`` object.""" return BroadbandFrequencyAdaptiveSolutionMessage( max_delta=broadband_adapt_sol.max_delta, max_passes=broadband_adapt_sol.max_num_passes, diff --git a/src/ansys/edb/core/inner/parser.py b/src/ansys/edb/core/inner/parser.py index 7552f18bdd..16432c0a0a 100644 --- a/src/ansys/edb/core/inner/parser.py +++ b/src/ansys/edb/core/inner/parser.py @@ -1,4 +1,4 @@ -"""This module parses message back to client data types.""" +"""This module parses messages back to client data types.""" import functools @@ -6,82 +6,82 @@ def to_point_data(fn): - """Decorate a function that returns a message to return as PointData.""" + """Decorate a function that returns a message to return it as a ``PointData`` object.""" return _wraps(fn, _to_point_data) def to_point_data_list(fn): - """Decorate a function that returns a message to return as list[PointData].""" + """Decorate a function that returns a message to return it as a list of ``PointData`` objects.""" return _wraps(fn, _to_point_data_list) def to_point3d_data(fn): - """Decorate a function that returns a message to return as Point3DData.""" + """Decorate a function that returns a message to return it as a ``Point3DData`` object.""" return _wraps(fn, _to_point3d_data) def to_point_data_pair(fn): - """Decorate a function that returns a message to return as tuple[PointData, PointData].""" + """Decorate a function that returns a message to return it as a ``[PointData, PointData]`` tuple.""" return _wraps(fn, _to_point_data_pair) def to_3_point3d_data(fn): - """Decorate a function that returns a message to return as List of Point3DData.""" + """Decorate a function that returns a message to return it as a list of ``Point3DData`` objects.""" return _wraps(fn, _to_3_point3d_data) def to_polygon_data(fn): - """Decorate a function that returns a message to return as PolygonData.""" + """Decorate a function that returns a message to return it as a ``PolygonData`` object.""" return _wraps(fn, _to_polygon_data) def to_polygon_data_list(fn): - """Decorate a function that returns a message to return as list[PolygonData].""" + """Decorate a function that returns a message to return it as a list of ``PolygonData`` objects.""" return _wraps(fn, _to_polygon_data_list) def to_rlc(fn): - """Decorate a function that returns a message to return as RLC.""" + """Decorate a function that returns a message to return it as an RLC.""" return _wraps(fn, _to_rlc) def to_box(fn): - """Decorate a function that returns a message to return as (lower_left, upper_right).""" + """Decorate a function that returns a message to return it as ``(lower_left, upper_right)``.""" return _wraps(fn, _to_box) def to_circle(fn): - """Decorate a function that returns a message to return as (center, radius).""" + """Decorate a function that returns a message to return it as ``(center, radius)``.""" return _wraps(fn, _to_circle) def to_base_adaptive_frequency_solution(fn): - """Decorate a function that returns a message to return as tuple[`str`, `str`].""" + """Decorate a function that returns a message to return it as a ``[`str`, `str`]`` tuple.""" return _wraps(fn, _to_base_adaptive_frequency_solution) def to_single_frequency_adaptive_solution(fn): - """Decorate a function that returns a message to return as SingleFrequencyAdaptiveSolution.""" + """Decorate a function that returns a message to return it as a ``SingleFrequencyAdaptiveSolution`` object.""" return _wraps(fn, _to_single_frequency_adaptive_solution) def to_multi_adaptive_freq(fn): - """Decorate a function that returns a message to return as AdaptiveFrequency.""" + """Decorate a function that returns a message to return it as an ``AdaptiveFrequency`` object.""" return _wraps(fn, _to_multi_adaptive_freq) def to_multi_frequency_adaptive_solution(fn): - """Decorate a function that returns a message to return as MultiFrequencyAdaptiveSolution.""" + """Decorate a function that returns a message to return it as a ``MultiFrequencyAdaptiveSolution`` object.""" return _wraps(fn, _to_multi_frequency_adaptive_solution) def to_broadband_adaptive_solution(fn): - """Decorate a function that returns a message to return as BroadbandAdaptiveSolution.""" + """Decorate a function that returns a message to return it as a ``BroadbandAdaptiveSolution`` object.""" return _wraps(fn, _to_broadband_adaptive_solution) def to_mesh_op(fn): - """Decorate a function that returns a message to return as MeshOperation.""" + """Decorate a function that returns a message to return it as a ``MeshOperation`` object.""" return _wraps(fn, _to_mesh_op) @@ -98,7 +98,7 @@ def wrapper(*args, **kwargs): def _to_point_data(message): - """Convert PointMessage to PointData. + """Convert a ``PointMessage`` object to a ``PointData`` object. Parameters ---------- @@ -112,7 +112,7 @@ def _to_point_data(message): def _to_point_data_pair(message): - """Convert PointPairMessage to tuple[PointData, PointData]. + """Convert a ``PointPairMessage`` object to a ``[PointData, PointData]`` tuple. Parameters ---------- @@ -126,7 +126,7 @@ def _to_point_data_pair(message): def _to_point_data_list(message): - """Convert a message to list of PointData. + """Convert a message to list of ``PointData`` objects. Parameters ---------- @@ -140,7 +140,7 @@ def _to_point_data_list(message): def _to_3_point3d_data(message): - """Convert Point3DMessage to PointData. + """Convert a ``Point3DMessage`` object to a ``PointData`` object. Parameters ---------- @@ -154,7 +154,7 @@ def _to_3_point3d_data(message): def _to_point3d_data(message): - """Convert Point3DMessage to PointData. + """Convert a ``Point3DMessage`` object to a ``PointData`` object. Parameters ---------- @@ -170,7 +170,7 @@ def _to_point3d_data(message): def _to_polygon_data(message): - """Convert arbitrary message to PolygonData if possible. + """Convert an arbitrary message to a ``PolygonData`` object if possible. Parameters ---------- @@ -195,7 +195,7 @@ def _to_polygon_data(message): def _to_polygon_data_list(message): - """Convert arbitrary messages to list of PolygonData if possible. + """Convert arbitrary messages to list of ``PolygonData`` objects if possible. Returns ------- @@ -210,7 +210,7 @@ def _to_polygon_data_list(message): def _to_box(message): - """Convert message to box. + """Convert a message to box. Parameters ---------- @@ -225,7 +225,7 @@ def _to_box(message): def _to_circle(message): - """Convert message to circle containing center point and radius. + """Convert a message to a circle containing a center point and radius. Parameters ---------- @@ -240,7 +240,7 @@ def _to_circle(message): def _to_rlc(message): - """Convert message to rlc containing values related to resistance inductance capacitance. + """Convert a message to an RLC containing values related to resistance inductance capacitance. Parameters ---------- @@ -262,7 +262,7 @@ def _to_rlc(message): def _to_mx_convergence_data(message): - """Convert message to matrix convergence data. + """Convert a message to matrix convergence data. Parameters ---------- @@ -328,7 +328,7 @@ def add_port_name_entry(port_name): def _to_base_adaptive_frequency_solution(message): - """Convert message to adaptive frequency solution data. + """Convert a message to adaptive frequency solution data. Parameters ---------- @@ -342,7 +342,7 @@ def _to_base_adaptive_frequency_solution(message): def _to_single_frequency_adaptive_solution(message): - """Convert message to single frequency adaptive solution data. + """Convert a message to single frequency adaptive solution data. Parameters ---------- @@ -363,7 +363,7 @@ def _to_single_frequency_adaptive_solution(message): def _to_multi_adaptive_freq(message): - """Convert message to a multi-frequency adaptive solution adaptive frequency entry. + """Convert a message to a multi-frequency adaptive solution adaptive frequency entry. Parameters ---------- @@ -382,7 +382,7 @@ def _to_multi_adaptive_freq(message): def _to_multi_frequency_adaptive_solution(message): - """Convert message to a multi-frequency adaptive solution data. + """Convert a message to a multi-frequency adaptive solution data. Parameters ---------- @@ -399,7 +399,7 @@ def _to_multi_frequency_adaptive_solution(message): def _to_broadband_adaptive_solution(message): - """Convert message to broadband adaptive solution data. + """Convert a message to broadband adaptive solution data. Parameters ---------- @@ -415,7 +415,7 @@ def _to_broadband_adaptive_solution(message): def _length_mesh_op(message): - """Convert message to a length mesh op. + """Convert a message to a length mesh operation. Parameters ---------- @@ -434,7 +434,7 @@ def _length_mesh_op(message): def _to_skin_depth_mesh_op(message): - """Convert message to a skin depth mesh op. + """Convert a message to a skin depth mesh operation. Parameters ---------- @@ -454,7 +454,7 @@ def _to_skin_depth_mesh_op(message): def _to_mesh_op(message): - """Convert message to a mesh op. + """Convert a message to a mesh operation. Parameters ---------- diff --git a/src/ansys/edb/core/inner/utils.py b/src/ansys/edb/core/inner/utils.py index 96bb040f00..47fa307d13 100644 --- a/src/ansys/edb/core/inner/utils.py +++ b/src/ansys/edb/core/inner/utils.py @@ -2,7 +2,13 @@ def map_list(iterable_to_operate_on, operator=None): - """Apply the given operator to each member of an iterable and returns the modified list.""" + """Apply the given operator to each member of an iterable and return the modified list. + + Parameters + --------- + iterable_to_operate on + operator + """ return list( iterable_to_operate_on if operator is None else map(operator, iterable_to_operate_on) ) diff --git a/src/ansys/edb/core/inner/variable_server.py b/src/ansys/edb/core/inner/variable_server.py index c7994c98a7..5de4f0cc79 100644 --- a/src/ansys/edb/core/inner/variable_server.py +++ b/src/ansys/edb/core/inner/variable_server.py @@ -1,4 +1,4 @@ -"""VariableServer Class.""" +"""Variable server class.""" from ansys.api.edb.v1.edb_messages_pb2 import EDBObjMessage import ansys.api.edb.v1.variable_server_pb2 as variable_server_msgs @@ -9,47 +9,48 @@ class VariableServer: - """Class that owns variables. + """Provides a class that owns variables. - It can be either a Database, Cell, or ComponentDef object. + A variables can be either a database, cell, or component definition object. """ def __init__(self, variable_owner): - """Initialize VariableServer object. + """Initialize the variable server object. Parameters ---------- variable_owner : EdbObjMessage - ID of either a Database, Cell, or ComponentDef. + ID of either a database, cell, or component definition. """ - assert variable_owner.id > 0, "Invalid variable owner id" + assert variable_owner.id > 0, "Invalid variable owner ID," self.variable_owner = EDBObjMessage(id=variable_owner.id) def add_variable(self, name, value, is_param=False): - """Add new variable. + """Add a variable. Parameters ---------- name : str - Variable name + Variable name. value : str, int, float, complex, :class:`Value ` - value can be any type that can be converted to a :class:`Value ` - is_param : bool, optional - True means the new variable is a parameter, False means it is a local variable + 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. Notes ----- - Variables can be added to the following EDB objects + 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 corresponding :class:`Cell ` + * :class:`Database ` (Variable names must begin with a '$'.) + * :class:`ComponentDef ` + * :class:`Cell ` + * :class:`Layout ` (Adds variable to the corresponding + :class:`Cell ` instance.) Examples -------- - Adding variables to a Cell and creating a Value that references those variables + Add variables to a cell and create a value that references these variables. >>> param = Value(33.1) >>> cell.add_variable("blue1", param) @@ -67,18 +68,19 @@ def add_variable(self, name, value, is_param=False): get_variable_server_stub().AddVariable(temp) def add_menu_variable(self, name, values, is_param=False, index=0): - """Add new menu variable. + """Add a menu variable. Parameters ---------- name : str - Variable name + Variable name. values : list[str, int, float, complex, :class:`Value `] - each element can be any type that can be converted to a :class:`Value ` - is_param : bool, optional - True means the new variable is a parameter, False means it is a local variable - index : int, optional - The index of the value that is initially selected + 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. + index : int, default: 0 + Index of the value that is initially selected. """ list_of_vms = [] for value in values: @@ -94,12 +96,12 @@ def add_menu_variable(self, name, values, is_param=False, index=0): get_variable_server_stub().AddMenuVariable(temp) def delete_variable(self, name): - """Delete an existing variable. + """Delete a variable. Parameters ---------- name : str - Variable name + Variable name. """ temp = variable_server_msgs.VariableNameMessage( variable_owner=self.variable_owner, name=name @@ -107,13 +109,14 @@ def delete_variable(self, name): get_variable_server_stub().DeleteVariable(temp) def set_variable_value(self, name, new_value): - """Set variable to have a new value. + """Set a variable to a new value. Parameters ---------- name : str - Variable name + Variable name. new_value : str, int, float, complex, :class:`Value ` + New value. """ temp = variable_server_msgs.SetVariableMessage( variable_owner=self.variable_owner, name=name, value=value_message(new_value) @@ -121,16 +124,17 @@ def set_variable_value(self, name, new_value): get_variable_server_stub().SetVariableValue(temp) def get_variable_value(self, name): - """Get the value from an existing variable. + """Get the value for a given variable. Parameters ---------- name : str - Variable name + Variable name. Returns ------- :class:`Value ` + Variable value. """ temp = variable_server_msgs.VariableNameMessage( variable_owner=self.variable_owner, name=name @@ -138,17 +142,17 @@ def get_variable_value(self, name): return Value(get_variable_server_stub().GetVariableValue(temp)) def is_parameter(self, name): - """Return the type of the variable. + """Determine if the variable is a parameter. Parameters ---------- name : str - Variable name + Variable name. Returns ------- bool - True if the variable is a parameter, otherwise False + ``True`` if the variable is a parameter, ``False`` otherwise. """ temp = variable_server_msgs.VariableNameMessage( variable_owner=self.variable_owner, name=name @@ -156,12 +160,12 @@ def is_parameter(self, name): return get_variable_server_stub().IsParameter(temp).value def get_all_variable_names(self): - """Return names of all variables that were added. + """Get all variable names. Returns ------- list[str] - Names of each variable + Names of all variables. """ return get_variable_server_stub().GetAllVariableNames(self.variable_owner).names @@ -171,12 +175,12 @@ def get_variable_desc(self, name): Parameters ---------- name : str - Variable name + Variable name. Returns ------- str - Description of the variable + Description of the variable. """ temp = variable_server_msgs.VariableNameMessage( variable_owner=self.variable_owner, name=name @@ -184,14 +188,14 @@ def get_variable_desc(self, name): return get_variable_server_stub().GetVariableDesc(temp).value def set_variable_desc(self, name, desc): - """Set variable to have a new description. + """Set a variable to have a new description. Parameters ---------- name : str - Variable name + Variable name. desc : str - New variable description + New variable description. """ temp = variable_server_msgs.SetDescriptionMessage( variable_owner=self.variable_owner, name=name, desc=desc @@ -199,12 +203,15 @@ def set_variable_desc(self, name, desc): get_variable_server_stub().SetVariableDesc(temp) def create_value(self, val): - """Create a :class:`Value ` that can reference variables in this VariableServer. + """Create a value instance. + + This value instance can reference variables on the variable server. Parameters ---------- val : str, int, float, complex - val 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 @@ -213,15 +220,16 @@ def create_value(self, val): Notes ----- - Creating a value from a :class:`Database ` can reference variables in the - :class:`Database `. + Creating a value from a :class:`Database ` instance can reference variables + in the :class:`Database ` instance. - Creating a value from a :class:`Cell ` can reference variables in both the - :class:`Database ` and the :class:`Cell `. + 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 ` can reference variables - in both the :class:`Database ` and - the :class:`ComponentDef `. + 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/layer.py b/src/ansys/edb/core/layer/layer.py index b7d279c490..b0fff2e16f 100644 --- a/src/ansys/edb/core/layer/layer.py +++ b/src/ansys/edb/core/layer/layer.py @@ -17,12 +17,12 @@ # Message creation helper method def _is_in_zone_message(lyr, zone): - """Convert to IsInZoneMessage.""" + """Convert to an ``IsInZoneMessage`` object.""" return layer_pb2.ZoneMessage(layer=lyr.msg, zone=zone) class LayerType(Enum): - """Enum representing types of layers. + """Provides an enum representing the types of layers. - SIGNAL_LAYER - DIELECTRIC_LAYER @@ -68,7 +68,7 @@ class LayerType(Enum): class TopBottomAssociation(Enum): - """Enum representing the top-bottom association of layers. + """Provides an enum representing the top-bottom association of layers. - TOP_ASSOCIATED - NO_TOP_BOTTOM_ASSOCIATED @@ -85,7 +85,7 @@ class TopBottomAssociation(Enum): class DrawOverride(Enum): - """Enum representing draw override options for layers. + """Provides an enum representing draw override options for layers. - NO_OVERRIDE - FILL @@ -98,7 +98,7 @@ class DrawOverride(Enum): class LayerVisibility(Enum): - """Enum representing visibility options for layers. + """Provides an enum representing visibility options for layers. - PRIMITIVE_VISIBLE - PATH_VISIBLE @@ -117,13 +117,13 @@ class LayerVisibility(Enum): class Layer(ObjBase): - """Base class representing a layer.""" + """Provides the base class representing a layer.""" layout_obj_type = LayoutObjType.LAYER __stub: LayerServiceStub = StubAccessor(StubType.layer) def cast(self): - """Cast the layer object to correct concrete type. + """Cast the layer object to the correct concrete type. Returns ------- @@ -147,7 +147,9 @@ def create(name, lyr_type): Parameters ---------- name : string + Layer name. lyr_type : :class:`LayerType` + Layer type. Returns ------- @@ -159,7 +161,7 @@ def create(name, lyr_type): @property def type(self): - """:class:`LayerType`: Layer type of the layer.""" + """:class:`LayerType`: Type of the layer.""" return LayerType(self.__stub.GetLayerType(self.msg).type) @type.setter @@ -168,9 +170,9 @@ def type(self, lyr_type): @property def is_stackup_layer(self): - """:obj:`bool`: Flag indicating if the layer is a :class:`StackupLayer`. + """:obj:`bool`: Flag indicating if the layer is a :class:`StackupLayer` instance. - Read-Only. + This property is read-only. """ layer_type = self.type return ( @@ -181,9 +183,9 @@ def is_stackup_layer(self): @property def is_via_layer(self): - """:obj:`bool`: Flag indicating if the layer is a :class:`ViaLayer`. + """:obj:`bool`: Flag indicating if the layer is a :class:`ViaLayer` instance. - Read-Only. + This property is read-only. """ return self.__stub.IsViaLayer(self.msg).value @@ -202,16 +204,18 @@ def clone(self, copy_id=True): Parameters ---------- copy_id : bool + ID of the layer to clone. Returns ------- Layer + Layer cloned. """ return Layer(self.__stub.Clone(layer_pb2.CloneMessage(layer=self.msg, copy_id=copy_id))) @property def layer_id(self): - """:obj:`int`: Layer id of the layer.""" + """:obj:`int`: Layer ID.""" return self.__stub.GetLayerId(self.msg).value @property @@ -231,9 +235,9 @@ def top_bottom_association(self, top_bottom_association): @property def color(self): - r""":obj:`tuple`\[:obj:`int`, :obj:`int`, :obj:`int`\]: Color of the layer. + r""":obj:`tuple`\[:obj:`int`, :obj:`int`, :obj:`int`\]: Color of the layer in (R,G,B) format. - Tuple contains the color RGB values in the format (R,G,B) + Tuple contains the color values in (R,G,B) format. """ color_int = self.__stub.GetColor(self.msg).value r = color_int & 0x000000FF @@ -252,13 +256,12 @@ def color(self, rgb): def visibility_mask(self): """:obj:`int`: Visibility mask of the layer. - Setter can take either an :obj:`int` or :class:`LayerVisibility`. + The setter can take either an :obj:`int` object or a :class:`LayerVisibility` instance. """ return self.__stub.GetVisibilityMask(self.msg).value @visibility_mask.setter def visibility_mask(self, visibility_mask): - """Set the visibility mask of the layer.""" vis_mask_int = ( visibility_mask.value if isinstance(visibility_mask, LayerVisibility) @@ -281,8 +284,8 @@ def locked(self, locked): def transparency(self): """:obj:`int`: Transparency value of the layer. - Transparency value falls between 0 and 100 where 0 indicates a completely opaque layer and 100 indicates a \ - completely transparent layer. + The transparency value is between 0 and 100, where 0 indicates a completely + opaque layer and 100 indicates a completely transparent layer. """ return self.__stub.GetTransparency(self.msg).value @@ -304,44 +307,52 @@ def draw_override(self, draw_override): ) def get_product_property(self, prod_id, attr_it): - """Get the product property of the layer associated with the given product and attribute ids. + """Get the product property of the layer for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. attr_it : int + Attribute ID. Returns ------- str + Product property. """ return self.__stub.GetProductProperty( get_product_property_message(self, prod_id, attr_it) ).value def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property of the layer associated with the given product and attribute ids. + """Set the product property of the layer for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. attr_it : int + Attribute ID. prop_value : str + New product property value. """ self.__stub.SetProductProperty( set_product_property_message(self, prod_id, attr_it, prop_value) ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to the provided product id for the layer. + """Get a list of attribute IDs for a given product ID for the layer. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. Returns ------- list[int] + List of attribute IDs. """ attr_ids = self.__stub.GetProductPropertyIds( get_product_property_ids_message(self, prod_id) @@ -349,7 +360,7 @@ def get_product_property_ids(self, prod_id): return [attr_id for attr_id in attr_ids] def is_in_zone(self, zone): - """Check if the layer exists in the provided zone. + """Determine if the layer exists in the given zone. Parameters ---------- @@ -358,16 +369,19 @@ def is_in_zone(self, zone): Returns ------- bool + ``True`` when the layer exists in the given zone, ``False`` otherwise. """ return self.__stub.IsInZone(_is_in_zone_message(self, zone)).value def set_is_in_zone(self, zone, in_zone=True): - """Set whether the layer exists in the specified zone. + """Set whether the layer exists in a given zone. Parameters ---------- zone : int - in_zone : bool, optional + Zone. + in_zone : bool, default: True + Whether the layer exists in this zone. """ return self.__stub.SetIsInZone( layer_pb2.SetIsInZoneMessage(zone_msg=_is_in_zone_message(self, zone), in_zone=in_zone) @@ -375,18 +389,19 @@ def set_is_in_zone(self, zone, in_zone=True): @property def zones(self): - r""":obj:`list`\[:obj:`int`\]: Zone ids of all zones containing the layer. + r""":obj:`list`\[:obj:`int`\]: IDs of all zones containing the layer. - Read-Only. + This property is read-only. """ return [zone for zone in self.__stub.GetZones(self.msg).zones] @property def zone(self): - """:obj:`int`: Zone index associated with owning layer collection. + """:obj:`int`: Zone index associated with the owning layer collection. - If owner is invalid the index is 0. If owner is multizone the index is -1. + If the owner is invalid, the index is ``0``. If the owner is multizone, + the index is ``-1``. - Read-Only. + This property is read-only. """ return self.__stub.GetZone(self.msg).value diff --git a/src/ansys/edb/core/layer/layer_collection.py b/src/ansys/edb/core/layer/layer_collection.py index 8f9600c3dc..74ec9f7256 100644 --- a/src/ansys/edb/core/layer/layer_collection.py +++ b/src/ansys/edb/core/layer/layer_collection.py @@ -1,4 +1,4 @@ -"""Layer Collection.""" +"""Layer collection.""" from enum import Enum @@ -16,7 +16,7 @@ class LayerCollectionMode(Enum): - """Enum representing possible modes of layer collection. + """Provides an enum representing possible modes of the layer collection. - LAMINATE - OVERLAPPING @@ -29,7 +29,7 @@ class LayerCollectionMode(Enum): class LayerTypeSet(Enum): - """Enum representing layer type sets used for filtering layers. + """Provides an enum representing layer type sets used for filtering layers. - STACKUP_LAYER_SET - SIGNAL_LAYER_SET @@ -46,7 +46,7 @@ class LayerTypeSet(Enum): class DielectricMergingMethod(Enum): - """Enum representing dielectric merging method options. + """Provides an enum representing dielectric merging method options. - WEIGHTED_AVERAGE - KRASZEWSKI @@ -59,14 +59,14 @@ class DielectricMergingMethod(Enum): def _layer_collection_zone_message(layer_collection, zone): - """Convert to LayerCollectionZoneMessage.""" + """Convert to a ``LayerCollectionZoneMessage`` object.""" return layer_collection_pb2.LayerCollectionZoneMessage( layer_collection=layer_collection.msg, zone=zone ) class LayerCollection(ObjBase): - """Layer Collection.""" + """Represents a layer collection.""" @staticmethod def create(mode=LayerCollectionMode.LAMINATE): @@ -74,11 +74,13 @@ def create(mode=LayerCollectionMode.LAMINATE): Parameters ---------- - mode : LayerCollectionMode + mode : LayerCollectionMode, default: LAMINATE + Mode of the layer collection. Returns ------- LayerCollection + Layer collection created. """ return LayerCollection( get_layer_collection_stub().Create( @@ -92,17 +94,13 @@ def clone(self): Returns ------- LayerCollection + Layer collection cloned. """ return LayerCollection(get_layer_collection_stub().Clone(self.msg)) @property def mode(self): - """:class:`LayerCollectionMode`: Get the mode the layer collection. - - Returns - ------- - LayerCollectionMode - """ + """:class:`LayerCollectionMode`: Mode of the layer collection.""" return LayerCollectionMode(get_layer_collection_stub().GetMode(self.msg).mode) @mode.setter @@ -114,11 +112,12 @@ def mode(self, mode): ) def add_layers(self, layers): - """Add layers to a layer collection. + """Add a list of layers to the layer collection. Parameters ---------- layers : list[Layer] + List of layers. """ layer_msgs = [lyr.msg for lyr in layers] get_layer_collection_stub().AddLayers( @@ -126,12 +125,14 @@ def add_layers(self, layers): ) def import_from_control_file(self, control_file_path, schema_file_path=None): - """Import layers from the provided control file and optional XML schema. + """Import layers from a control file and optional XML schema file. Parameters ---------- control_file_path : str - schema_file_path : str, optional + Full path to the control file. + schema_file_path : str, default: None + Full path to the XML schema file. """ import_msg = layer_collection_pb2.ImportFromControlFileMessage( layer_collection=self.msg, control_file_path=control_file_path @@ -141,7 +142,7 @@ def import_from_control_file(self, control_file_path, schema_file_path=None): get_layer_collection_stub().ImportFromControlFile(import_msg) def _add_layer(self, layer, above_below=None, add_top=None): - """Pack layer addition arguments into AddLayersMessage and send to server.""" + """Pack layer addition arguments into the ``AddLayersMessage`` object and send to the server.""" add_layer_msg = layer_collection_pb2.AddLayerMessage( layer_collection=self.msg, layer=layer.msg ) @@ -161,12 +162,14 @@ def _add_layer_relative(self, layer, relative_layer_name, add_above): def add_layer_above(self, layer_to_add, layer_to_add_above_name): """Add a new layer above the specified layer. - Adjusts existing layers as needed to maintain stackup consistency. + This method adjusts existing layers as needed to maintain stackup consistency. Parameters ---------- layer_to_add : Layer + Name of the layer to add. layer_to_add_above_name : str + Name of the layer above which to add the new layer. Returns ------- @@ -177,12 +180,14 @@ def add_layer_above(self, layer_to_add, layer_to_add_above_name): def add_layer_below(self, layer_to_add, layer_to_add_below_name): """Add a new layer below the specified layer. - Adjusts existing layers as needed to maintain stackup consistency. + This method adjusts existing layers as needed to maintain stackup consistency. Parameters ---------- layer_to_add : Layer + Name of the layer to add. layer_to_add_below_name : str + Name of the layer below which to add the new layer. Returns ------- @@ -191,13 +196,14 @@ def add_layer_below(self, layer_to_add, layer_to_add_below_name): return self._add_layer_relative(layer_to_add, layer_to_add_below_name, False) def add_layer_top(self, layer_to_add): - """Add a new layer to the top of the LayerCollection. + """Add a new layer to the top of the layer collection. - Adjusts existing layers as needed to maintain stackup consistency. + This method adjusts existing layers as needed to maintain stackup consistency. Parameters ---------- layer_to_add : Layer + Name of the layer to add. Returns ------- @@ -206,13 +212,14 @@ def add_layer_top(self, layer_to_add): return self._add_layer(layer_to_add, add_top=True) def add_layer_bottom(self, layer_to_add): - """Add a new layer to the bottom of the LayerCollection. + """Add a new layer to the bottom of the layer collection. - Adjusts existing layers as needed to maintain stackup consistency. + This method adjusts existing layers as needed to maintain stackup consistency. Parameters ---------- layer_to_add : Layer + Name of the layer to add. Returns ------- @@ -221,9 +228,9 @@ def add_layer_bottom(self, layer_to_add): return self._add_layer(layer_to_add, add_top=False) def add_stackup_layer_at_elevation(self, stackup_layer_to_add): - """Add a :class:`StackupLayer` at user specified elevation. + """Add a stackup layer at a user-specified elevation. - Doesn't change other stackup layer's elevation. + This method doe not change the elevenation of other stackup layers. Parameters ---------- @@ -236,7 +243,7 @@ def add_stackup_layer_at_elevation(self, stackup_layer_to_add): return self._add_layer(stackup_layer_to_add) def add_via_layer(self, via_layer_to_add): - """Add a :class:`ViaLayer` to the layer collection. + """Add a via layer to the layer collection. Parameters ---------- @@ -249,14 +256,16 @@ def add_via_layer(self, via_layer_to_add): return self._add_layer(via_layer_to_add) def is_valid(self): - """Check if the layer collection is in a valid state. + """Determine if the layer collection is in a valid state. - Check whether there is layer overlapping or gap for laminate stackup. - Check whether there is dielectric layer overlapping or gap for overlapping stackup. + For a laminate stackup, this method checks whether there is layer overlapping or a gap. + For an overlapping stackup, this method checks whether there is a dielectric layer + overlapping or a gap. Returns ------- bool + ``True`` if the layer collection is in a valid state, ``False`` otherwise. """ return get_layer_collection_stub().IsValid(self.msg).value @@ -266,6 +275,7 @@ def find_by_name(self, layer_name): Parameters ---------- layer_name : str + Layer name. Returns ------- @@ -312,17 +322,17 @@ def _get_layer_type_list(): return LayerCollection._get_layer_filter(_get_layer_type_list()) def get_top_bottom_stackup_layers(self, layer_type_set): - """Get the top and bottom :class:`StackupLayers ` of specific type and their elevations. + """Get the top and bottom stackup layers of a specific type and their elevations. Parameters ---------- layer_type_set : LayerTypeSet - LayerTypeSet indicating which layer types to retrieve + Layer type set indicating the layer types to retrieve. Returns ------- tuple[Layer, float, Layer, float] - Returns a tuple of the following format: + Returns a tuple in this format: (upper_layer, upper_layer_top_elevation, lower_layer, lower_layer_lower_elevation) """ request = layer_collection_pb2.GetTopBottomStackupLayersMessage( @@ -338,15 +348,17 @@ def get_top_bottom_stackup_layers(self, layer_type_set): ) def get_layers(self, layer_filter=LayerTypeSet.ALL_LAYER_SET): - """Retrieve a list of :class:`Layers ` in the layer collection filtered by the given layer filter. + """Get a list of layers in the layer collection using a layer filter. Parameters ---------- - layer_filter : LayerTypeSet or LayerType or list[LayerType], optional + layer_filter : LayerTypeSet or LayerType or list[LayerType], default: ALL_LAYER_SET + Layer filter. Returns ------- list[Layer] + List of layers based on the filter used. """ layer_filter_int = ( LayerCollection._get_layer_filter_from_layer_type_set(layer_filter) @@ -363,16 +375,19 @@ def get_layers(self, layer_filter=LayerTypeSet.ALL_LAYER_SET): return [Layer(msg).cast() for msg in response.items] def get_product_property(self, prod_id, attr_it): - """Get the product property of the layer collection associated with the given product and attribute ids. + """Get the product property of the layer collection for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. attr_it : int + Attribute ID. Returns ------- str + Product property. """ return ( get_layer_collection_stub() @@ -381,28 +396,33 @@ def get_product_property(self, prod_id, attr_it): ) def set_product_property(self, prod_id, attr_it, prop_value): - """Set the product property of the layer collection associated with the given product and attribute ids. + """Set the product property of the layer collection for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. attr_it : int + Attribute ID. prop_value : str + New property value. """ get_layer_collection_stub().SetProductProperty( set_product_property_message(self, prod_id, attr_it, prop_value) ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to the provided product id for the layer collection. + """Get a list of attribute IDs for a given product ID for the layer collection. Parameters ---------- prod_id : :class:`ProductIdType ` + Product ID. Returns ------- list[int] + List of attribute IDs for the given product ID. """ attr_ids = ( get_layer_collection_stub() @@ -451,20 +471,22 @@ def merge_dielectrics( @property def zone_ids(self): - r""":obj:`list`\[:obj:`int`\]: Get a list of all zones in the layer collection.""" + r""":obj:`list`\[:obj:`int`\]: List of all zones in the layer collection.""" zones = get_layer_collection_stub().GetZoneIds(self.msg).zones return [zone for zone in zones] def get_zone_name(self, zone): - """Get the name corresponding to the specified zone. + """Get the name for a given zone. Parameters ---------- zone : int + Zone ID. Returns ------- str + Name of the zone. """ return ( get_layer_collection_stub() @@ -473,12 +495,14 @@ def get_zone_name(self, zone): ) def set_zone_name(self, zone, name): - """Set the name corresponding to the specified zone. + """Set the name for a given zone. Parameters ---------- zone : int + Zone ID. name : str + New name to give the zone. """ request = layer_collection_pb2.SetZoneNameMessage( layer_collection=self.msg, zone=zone, zone_name=name @@ -486,18 +510,19 @@ def set_zone_name(self, zone, name): get_layer_collection_stub().SetZoneName(request) def insert_zone(self, copy_zone=-1): - """Insert a new zone. + """Insert a zone. Parameters ---------- - copy_zone : int, optional - If valid the new zone is inserted as a copy of the specified - zone, otherwise the new zone is empty + copy_zone : int, default: -1 + Zone to copy from when inserting a new zone. + If valid, the new zone is inserted as a copy of the given zone. + Otherwise, the new zone is empty. Returns ------- int - If successful, the id of the newly added zone is returned + ID of the zone inserted if successful. """ request = layer_collection_pb2.InsertZoneMessage( layer_collection=self.msg, copy_zone=copy_zone @@ -505,11 +530,12 @@ def insert_zone(self, copy_zone=-1): return get_layer_collection_stub().InsertZone(request).value def remove_zone(self, zone): - """Remove the specified zone. + """Remove a zone. Parameters ---------- zone : int + ID of the zone. """ get_layer_collection_stub().RemoveZone(_layer_collection_zone_message(self, zone)) @@ -524,13 +550,15 @@ def simplify_dielectrics_for_phi( Parameters ---------- database : :class:`Database ` - layer_thickness_thresh : float - merging_method : DielectricMergingMethod + layer_thickness_thresh : float, default: -1 + Thickness threshold for the layer. + merging_method : DielectricMergingMethod, default: WEIGHTED_CAPACITANCE + Method for merging. Returns ------- list[StackupLayer] - returns a list of dielectric layers created during the dielectric simplification process + List of dielectric layers created during the dielectric simplification process. """ simplified_lyrs = ( get_layer_collection_stub() diff --git a/src/ansys/edb/core/layer/stackup_layer.py b/src/ansys/edb/core/layer/stackup_layer.py index cdabb858b7..61167140fc 100644 --- a/src/ansys/edb/core/layer/stackup_layer.py +++ b/src/ansys/edb/core/layer/stackup_layer.py @@ -1,4 +1,4 @@ -"""Stackup Layer.""" +"""Stackup layer.""" from enum import Enum @@ -11,7 +11,7 @@ class DCThicknessType(Enum): - """Enum representing DC thickness types of StackupLayers. + """Provides an enum representing DC thickness types of stackup layers. - EFFECTIVE - LAYER @@ -24,7 +24,7 @@ class DCThicknessType(Enum): class RoughnessRegion(Enum): - """Enum representing regions for roughness models of StackupLayers. + """Provides an enum representing regions for roughness models of stackup layers. - TOP - BOTTOM @@ -37,31 +37,31 @@ class RoughnessRegion(Enum): def _set_layer_material_name_message(layer, mat_name): - """Convert to SetLayerMaterialNameMessage.""" + """Convert to a ``SetLayerMaterialNameMessage`` object.""" return stackup_layer_pb2.SetLayerMaterialMessage(layer=layer.msg, material=mat_name) def _get_layer_material_name_message(layer, evaluated): - """Convert to GetLayerMaterialNameMessage.""" + """Convert to a ``GetLayerMaterialNameMessage`` object.""" return stackup_layer_pb2.GetLayerMaterialMessage(layer=layer.msg, evaluated=evaluated) def _stackup_layer_value_message(layer, value): - """Convert to StackupLayerValueMessage.""" + """Convert to a ``StackupLayerValueMessage`` object.""" return stackup_layer_pb2.StackupLayerValueMessage( layer=layer.msg, value=messages.value_message(value) ) def _layer_roughness_region_message(layer, region): - """Convert to LayerRoughnessRegionMessage.""" + """Convert to a ``LayerRoughnessRegionMessage`` object.""" return stackup_layer_pb2.LayerRoughnessRegionMessage( layer=layer.msg, roughness_region=region.value ) class StackupLayer(Layer): - """Stackup layer.""" + """Represents a stackup layer.""" @staticmethod def create(name, layer_type, thickness, elevation, material): @@ -70,14 +70,20 @@ def create(name, layer_type, thickness, elevation, material): Parameters ---------- name : str + Name of the stackup layer. layer_type : LayerType + Type of the stackup layer. thickness : :term:`ValueLike` + Thickness of the stackup layer. elevation : :term:`ValueLike` + Elevation of the stackup layer. material : str + Material of the stackup layer. Returns ------- StackupLayer + Stackup layer created. """ params = { "name": name, @@ -107,7 +113,7 @@ def negative(self, is_negative): def thickness(self): """:class:`Value `: Thickness value of the layer. - Setter accepts a :term:`ValueLike` + The setter accepts a :term:`ValueLike` term. """ return Value(get_stackup_layer_stub().GetThickness(self.msg)) @@ -119,7 +125,7 @@ def thickness(self, thickness): def lower_elevation(self): """:class:`Value `: Lower elevation value of the layer. - Setter accepts a :term:`ValueLike` + The setter accepts a :term:`ValueLike` term. """ return Value(get_stackup_layer_stub().GetLowerElevation(self.msg)) @@ -133,7 +139,7 @@ def lower_elevation(self, lower_elevation): def upper_elevation(self): """:class:`Value `: Upper elevation value of the layer. - Read-Only. + This property is read-only. """ return Value(get_stackup_layer_stub().GetUpperElevation(self.msg)) @@ -142,11 +148,13 @@ def get_material(self, evaluated=True): Parameters ---------- - evaluated : bool, optional + evaluated : bool, default: True + Whether to evaluate the material if it is parameterized. Returns ------- str + Material name. """ return ( get_stackup_layer_stub() @@ -160,6 +168,7 @@ def set_material(self, material_name): Parameters ---------- material_name : str + New name of the material. """ get_stackup_layer_stub().SetMaterial(_set_layer_material_name_message(self, material_name)) @@ -168,12 +177,13 @@ def get_fill_material(self, evaluated=True): Parameters ---------- - evaluated : bool, optional - If true and the material name is parameterized, the material name will be evaluated. + evaluated : bool, default: True + Whether to evaluate the material if it is parameterized. Returns ------- str + Name of the fill material. """ return ( get_stackup_layer_stub() @@ -187,6 +197,7 @@ def set_fill_material(self, fill_material_name): Parameters ---------- fill_material_name : str + New name of the fill material. """ get_stackup_layer_stub().SetFillMaterial( _set_layer_material_name_message(self, fill_material_name) @@ -246,7 +257,7 @@ def set_roughness_model(self, roughness_model, region): @property def etch_factor_enabled(self): - """:obj:`bool`: Flag indicating if etch factor is used by the layer.""" + """:obj:`bool`: Flag indicating if an etch factor is used by the layer.""" return get_stackup_layer_stub().IsEtchFactorEnabled(self.msg).value @etch_factor_enabled.setter @@ -259,7 +270,7 @@ def etch_factor_enabled(self, enable_etch_factor): def etch_factor(self): """:class:`Value `: Etch factor of the layer. - Setter accepts a :term:`ValueLike` + The setter accepts a :term:`ValueLike` term. """ return Value(get_stackup_layer_stub().GetEtchFactor(self.msg)) @@ -282,7 +293,7 @@ def use_solver_properties(self, use_solver_properties): @property def hfss_solver_properties(self): - """:term:`HFSSSolverProperties`: The HFSS solver properties of the layer.""" + """:term:`HFSSSolverProperties`: HFSS solver properties of the layer.""" response = get_stackup_layer_stub().GetHFSSSolverProperties(self.msg) return ( DCThicknessType(response.dc_thickness_type), @@ -305,9 +316,9 @@ def hfss_solver_properties(self, hfss_solver_props): @property def referencing_via_layer_ids(self): - r""":obj:`list`\[:obj:`int`\]: Retrieve the layer ids of all via layers referencing the layer. + r""":obj:`list`\[:obj:`int`\]: Layer IDs for all via layers referencing the layer. - Read-Only. + This property is read-only. """ return [ via_lyr_id diff --git a/src/ansys/edb/core/layer/via_layer.py b/src/ansys/edb/core/layer/via_layer.py index c0276b8e9b..ca5b00480f 100644 --- a/src/ansys/edb/core/layer/via_layer.py +++ b/src/ansys/edb/core/layer/via_layer.py @@ -1,4 +1,4 @@ -"""Via Layer.""" +"""Via layer.""" import ansys.api.edb.v1.via_layer_pb2 as via_layer_pb2 @@ -7,12 +7,12 @@ def _via_lyr_ref_lyr_id_msg(lyr, is_upper_ref): - """Convert to ViaLayerRefLayerIdMessage.""" + """Convert to a ``ViaLayerRefLayerIdMessage`` object.""" return via_layer_pb2.ViaLayerRefLayerIdMessage(via_layer=lyr.msg, is_upper_ref=is_upper_ref) class ViaLayer(StackupLayer): - """Via layer.""" + """Represents a via layer.""" @staticmethod def create(name, lr_layer, ur_layer, material): @@ -21,6 +21,7 @@ def create(name, lr_layer, ur_layer, material): Parameters ---------- name : str + Name of the via layer. lr_layer : str ur_layer : str material : str @@ -28,6 +29,7 @@ def create(name, lr_layer, ur_layer, material): Returns ------- ViaLayer + Via layer created. """ params = { "via_layer_name": name, @@ -46,11 +48,12 @@ def get_ref_layer_name(self, upper_ref): Parameters ---------- upper_ref : bool - Flag indicating whether to retrieve the name of the upper or lower reference layer. + Whether to get the name of the upper or lower reference layer. Returns ------- str + Name of the reference layer. """ return get_via_layer_stub().GetRefLayerName(_via_lyr_ref_lyr_id_msg(self, upper_ref)).value @@ -60,9 +63,9 @@ def set_ref_layer(self, ref_layer, upper_ref): Parameters ---------- ref_layer : StackupLayer - Layer that will be set as the new reference layer of the via layer. + Layer to set as the new reference layer of the via layer. upper_ref : bool - Flag indicating whether to set the new reference layer as the + Whether to set the new reference layer as the upper or lower reference layer. """ get_via_layer_stub().SetRefLayer( diff --git a/src/ansys/edb/core/layout/cell.py b/src/ansys/edb/core/layout/cell.py index 41973f47c1..f8aea818a3 100644 --- a/src/ansys/edb/core/layout/cell.py +++ b/src/ansys/edb/core/layout/cell.py @@ -17,7 +17,7 @@ class CellType(Enum): - """Enum representing possible types of cells. + """Provides an enum representing the types of cells. - CIRCUIT_CELL - FOOTPRINT_CELL @@ -28,7 +28,7 @@ class CellType(Enum): class DesignMode(Enum): - """Enum representing possible modes. + """Provides an enum representing design modes. - GENERAL - IC @@ -66,17 +66,17 @@ def _return_value(value): def _translate_hfss_extent(hfss_extent_msg): - """Convert HfssExtentMessage to tuple of expected values.""" + """Convert an ``HfssExtentMessage`` object to a tuple of expected values.""" return hfss_extent_msg.value, hfss_extent_msg.absolute def _translate_hfss_extents_enums(msg): - """Convert HfssExtent enums to get it's values.""" + """Convert ``HfssExtent`` enums to get their values.""" return msg.value def primitive_helper(msg): - """Convert message to primitive.""" + """Convert a message to a primitive.""" return Primitive(msg).cast() @@ -120,7 +120,7 @@ def sanitize_args(args): def parse_args(msg): - """Extract extent options values from Hfss Extent message and add them into a dictionary.""" + """Extract extent option values from an HFFSS extent message and add them into a dictionary.""" res = {} for attribute in HFSS_EXTENT_ARGS.keys(): value = getattr(msg, attribute) @@ -142,7 +142,7 @@ def set_hfss_extents(cell, extents): class Cell(ObjBase, variable_server.VariableServer): - """Cell.""" + """Represents a cell object.""" __stub: CellServiceStub = StubAccessor(StubType.cell) layout_obj_type = LayoutObjType.CELL @@ -173,7 +173,7 @@ def create(cls, db, cell_type, cell_name): Returns ------- Cell - Newly created cell. + Cell created. """ return Cell(cls.__stub.Create(_QueryBuilder.create(db, cell_type, cell_name))) @@ -181,7 +181,7 @@ def create(cls, db, cell_type, cell_name): def layout(self): """:class:`Layout `: Layout of the cell. - Read-Only. + This property is read-only. """ return layout.Layout(self.__stub.GetLayout(self.msg)) @@ -189,42 +189,44 @@ def layout(self): def flattened_layout(self): """:class:`Layout `: Flattened layout of the cell. - Read-Only. + This property is read-only. """ return layout.Layout(self.__stub.GetFlattenedLayout(self.msg)) @classmethod def find(cls, database, cell_type, name=None, cell_id=None): - """Find a cell in a database by either name or id. + """Find a cell in a database by either name or ID. Parameters ---------- database : :class:`Database ` - Database to search for the cell in. + Database to search for the cell. cell_type : CellType - Type of the cell to create. + Type of the cell. name : str, optional - Name of the cell. + Name of the cell. The default is ``None``, in which case a name + is automatically assigned. cell_id : int, optional - ID of the cell. + ID of the cell. The default is ``None``, in which case an ID + is automatically assigned. Returns ------- Cell - Cell that was found, None otherwise. + Cell that was found, ``None`` otherwise. """ cell = Cell(cls.__stub.Find(messages.cell_find_message(database, cell_type, name, cell_id))) return None if cell.is_null else cell def delete(self): - """Delete a cell.""" + """Delete the cell.""" self.__stub.Delete(self.msg) @property def database(self): - """:class:`Database `: Owning database of cell. + """:class:`Database `: Owning database of the cell. - Read-Only. + This property is read-only. """ from ansys.edb.core.database import Database @@ -232,15 +234,15 @@ def database(self): @property def is_footprint(self): - """:obj:`bool` : Flag to indicate if the cell is a footprint. + """:obj:`bool`: Flag indicating if the cell is a footprint. - Read-Only. + This property is read-only. """ return self.__stub.IsFootprint(self.msg).value @property def is_blackbox(self): - """:obj:`bool` : Flag to indicate if the cell is a blackbox.""" + """:obj:`bool`: Flag indicating if the cell is a blackbox.""" return self.__stub.IsBlackBox(self.msg).value @is_blackbox.setter @@ -249,9 +251,10 @@ def is_blackbox(self, value): @property def anti_pads_always_on(self): - """:obj:`bool` : Determine whether antipads are always enabled. + """:obj:`bool`: Flag indicating whether antipads are always enabled. - True if enabled, false otherwise. If not enabled, they are triggered only when the via center point falls \ + ``True`` if antipads are always enabled, ``False`` otherwise. If antipads + are not always enabled, they are triggered only when the via center point falls \ within fill from another net. """ return self.__stub.GetAntiPadsAlwaysOn(self.msg).value @@ -262,11 +265,11 @@ def anti_pads_always_on(self, value): @property def anti_pads_option(self): - """:obj:`int` : Mode for activating antipads. + """:obj:`int`: Mode for activating antipads. - | 0 for Center-point Intersection - | 1 for Always On - | 2 for Pad Intersection. + - ``0`` for center-point intersection + - ``1`` for always on + - ``2`` for pad intersection """ return self.__stub.GetAntiPadsOption(self.msg) @@ -276,15 +279,15 @@ def anti_pads_option(self, value): @property def is_symbolic_footprint(self): - """:obj:`bool` : Flag to indicate if the cell is a symbolic footprint. + """:obj:`bool`: Flag indicating if the cell is a symbolic footprint. - Read-Only. + This property is read-only. """ return self.__stub.IsSymbolicFootprint(self.msg).value @property def name(self): - """:obj:`str` : Name of the cell.""" + """:obj:`str`: Name of the cell.""" return self.__stub.GetName(self.msg).value @name.setter @@ -293,7 +296,7 @@ def name(self, value): @property def design_mode(self): - """:obj:`DesignMode` : Design mode of the cell.""" + """:obj:`DesignMode`: Design mode of the cell.""" return DesignMode(self.__stub.GetDesignMode(self.msg).mode) @design_mode.setter @@ -302,12 +305,12 @@ 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)) def set_hfss_extent_info(self, extents): - """Set HFSS Extents of this cell. + """Set the HFSS extents of this cell. Parameters ---------- @@ -317,7 +320,7 @@ def set_hfss_extent_info(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) @@ -330,23 +333,23 @@ def temperature_settings(self, value): ) def cutout(self, included_nets, clipped_nets, clipping_polygon, clean_clipping=True): - """Cutout an existing cell into a new cell. + """Cut out an existing cell into a new cell. Parameters ---------- included_nets : list[:class:`Net `] - Nets to be kept after cutout. + Nets to keep after cutout. clipped_nets : list[:class:`Net `] - Nets to be kept and clipped at the boundary after cutout. + Nets to kept and clip at the boundary after cutout. clipping_polygon : :class:`PolygonData ` Clipping polygon. clean_clipping : bool, optional - Whether to perform clean clipping. + Whether to perform clean clipping. The default is ``True``. Returns ------- Cell - The newly created cell. + Cell created. """ return Cell( self.__stub.CutOut( @@ -357,7 +360,7 @@ def cutout(self, included_nets, clipped_nets, clipping_polygon, clean_clipping=T ) def get_product_property_ids(self, prod_id): - """Get a list of attribute ids corresponding to the provided product id for the cell. + """Get a list of attribute IDS for a given product ID for the cell. Parameters ---------- @@ -367,7 +370,7 @@ def get_product_property_ids(self, prod_id): Returns ------- list[int] - List of the user-defined attribute IDs for properties stored in this object + List of user-defined attribute IDs for properties stored in this object. """ ids = self.__stub.GetProductPropertyIds( messages.get_product_property_ids_message(self, prod_id) @@ -375,35 +378,35 @@ def get_product_property_ids(self, prod_id): return [prop_id for prop_id in ids] def get_product_property(self, prod_id, attr_id): - """Get the product specific property of the cell. + """Get the product-specific property of the cell. Parameters ---------- prod_id : :class:`ProductIdType ` ID representing a product that supports the EDB. attr_id : int - A user-defined id that identifies the string value stored in the property. + User-defined ID that identifies the string value stored in the property. Returns ------- str - The string stored in this property. + String stored in the product-specific property. """ return self.__stub.GetProductProperty( messages.get_product_property_message(self, prod_id, attr_id) ) def set_product_property(self, prod_id, attr_id, prop_value): - """Set the product property of the cell associated with the given product and attribute ids. + """Set the product property of the cell for a given product ID and attribute ID. Parameters ---------- prod_id : :class:`ProductIdType ` ID representing a product that supports the EDB. attr_id : int - A user-defined id that identifies the string value stored in the property. + User-defined ID that identifies the string value stored in the property. prop_value : str - The string stored in this property. + New string to store in this property. """ self.__stub.SetProductProperty( messages.set_product_property_message(self, prod_id, attr_id, prop_value) @@ -415,19 +418,16 @@ def delete_simulation_setup(self, name): Parameters ---------- name : str - Name of the setup to delete. + Name of the setup. """ self.__stub.DeleteSimulationSetup(messages.string_property_message(self, name)) @property def simulation_setups(self): - """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` - - Returns - ------- - list[:class:`SimulationSetup `] """ return [ SimulationSetup(msg).cast() for msg in self.__stub.GetSimulationSetups(self.msg).items @@ -436,23 +436,23 @@ def simulation_setups(self): def generate_auto_hfss_regions(self): """Generate auto HFSS regions. - Automatically identifies areas for use as HFSS regions in SIwave simulations. + This method automatically identifies areas for use as HFSS regions in SIwave simulations. """ self.__stub.GenerateAutoHFSSRegions(self.msg) def generate_via_smart_box(self, net_name): - """Generate via smart box. + """Generate a via smart box. - Automatically identifies the locations of vias and significant geometry around them. + This method automatically identifies the locations of vias and significant geometry around them. Parameters ---------- net_name : str - Name of the :class:`Net ` to be crawled in the search for vias. + Name of the net to crawl in the search for vias. Returns ------- list[:class:`PolygonData `] - A list of boxes; one around each via discovered. + 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 795fc9e5f9..4228ca4524 100644 --- a/src/ansys/edb/core/layout/layout.py +++ b/src/ansys/edb/core/layout/layout.py @@ -17,7 +17,7 @@ class Layout(ObjBase, variable_server.VariableServer): - """Layout.""" + """Represents a layout.""" __stub: LayoutServiceStub = StubAccessor(StubType.layout) @@ -33,9 +33,9 @@ def __init__(self, msg): @property def cell(self): - """:class:`Cell `: Owning cell for this layout. + """:class:`Cell `: Owning cell for the layout. - Read-Only. + This property is read-only. """ from ansys.edb.core.layout.cell import Cell @@ -43,12 +43,11 @@ def cell(self): @property def layer_collection(self): - """:class:`LayerCollection ` : Layer collection of this layout.""" + """:class:`LayerCollection `: Layer collection of the layout.""" return LayerCollection(self.__stub.GetLayerCollection(self.msg)) @layer_collection.setter def layer_collection(self, layer_collection): - """Set layer collection.""" self.__stub.SetLayerCollection( layout_pb2.SetLayerCollectionMessage( layout=self.msg, layer_collection=layer_collection.msg @@ -56,7 +55,7 @@ def layer_collection(self, layer_collection): ) def _get_items(self, obj_type, lyt_obj_type_enum, do_cast=False): - """Get list of layout objects.""" + """Get a list of layout objects.""" items = utils.map_list( self.__stub.GetItems(messages.layout_get_items_message(self, lyt_obj_type_enum)).items, obj_type, @@ -65,97 +64,100 @@ 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 the primitives in this \ - layout. + """:obj:`list` of :class:`Primitive `: List of all \ + primitives in the layout. - Read-Only. + This property is read-only. """ return self._get_items(Primitive, LayoutObjType.PRIMITIVE, True) @property def padstack_instances(self): - """:obj:`list` of :class:`PadstackInstance ` : List of all padstack \ - instances in this layout. + """:obj:`list` of :class:`PadstackInstance `: List of \ + all padstack instances in the layout. - Read-Only. + This property is read-only. """ return self._get_items(PadstackInstance, LayoutObjType.PADSTACK_INSTANCE) @property def terminals(self): - """:obj:`list` of :class:`Terminal ` : \ - List of all the terminals in this layout. + """:obj:`list` of :class:`Terminal `: \ + List of all terminals in the layout. - Read-Only. + This property is read-only. """ return self._get_items(Terminal, LayoutObjType.TERMINAL, True) @property def cell_instances(self): - """:obj:`list` of :class:`CellInstance ` : \ - List of the cell instances in this layout. + """:obj:`list` of :class:`CellInstance `: \ + List of all cell instances in the layout. - Read-Only. + This property is read-only. """ return self._get_items(CellInstance, LayoutObjType.CELL_INSTANCE) @property def nets(self): - """:obj:`list` of :class:`Net ` : List of all the nets in this layout. + """:obj:`list` of :class:`Net `: List of all nets \ + in the layout. - Read-Only. + This property is read-only. """ return self._get_items(Net, LayoutObjType.NET) @property def groups(self): - """:obj:`list` of :class:`Group ` : List of all the groups in this layout. + """:obj:`list` of :class:`Group `: List of all groups \ + in the layout. - Read-Only. + This property is read-only. """ return self._get_items(Group, LayoutObjType.GROUP, True) @property def net_classes(self): - """:obj:`list` of :class:`NetClass ` : List of all the netclassses in this layout. + """:obj:`list` of :class:`NetClass `: List of all \ + net classes in the layout. - Read-Only. + This property is read-only. """ return self._get_items(NetClass, LayoutObjType.NET_CLASS) @property def differential_pairs(self): - """:obj:`list` of :class:`DifferentialPair ` : \ - List of all the differential pairs in this layout. + """:obj:`list` of :class:`DifferentialPair `: \ + List of all differential pairs in the layout. - Read-Only. + This property is read-only. """ return self._get_items(DifferentialPair, LayoutObjType.DIFFERENTIAL_PAIR) @property def pin_groups(self): - """:obj:`list` of :class:`PinGroup ` : List of all the pin groups in this \ - layout. + """:obj:`list` of :class:`PinGroup ` : List of all \ + pin groups in the layout. - Read-Only. + This property is read-only. """ return self._get_items(PinGroup, LayoutObjType.PIN_GROUP) @property def voltage_regulators(self): - """:obj:`list` of :class:`VoltageRegulator ` : \ - List of all the voltage regulators in this layout. + """:obj:`list` of :class:`VoltageRegulator `: \ + List of all voltage regulators in the layout. - Read-Only. + This property is read-only. """ return self._get_items(layout.VoltageRegulator, LayoutObjType.VOLTAGE_REGULATOR) @property def extended_nets(self): - """:obj:`list` of :class:`ExtendedNet ` : \ - List of all the extended nets in this layout. + """:obj:`list` of :class:`ExtendedNet `: \ + List of all extended nets in the layout. - Read-Only. + This property is read-only. """ return self._get_items(ExtendedNet, LayoutObjType.EXTENDED_NET) @@ -163,23 +165,25 @@ def extended_nets(self): def expanded_extent( self, nets, extent, expansion_factor, expansion_unitless, use_round_corner, num_increments ): - """Get an expanded polygon for the Nets collection. + """Get an expanded polygon for a list of nets. Parameters ---------- nets : list[:class:`Net `] - A list of nets. + List of nets. extent : :class:`ExtentType ` Geometry extent type for expansion. expansion_factor : float - Expansion factor for the polygon union. No expansion occurs if the `expansion_factor` is less than or \ - equal to 0. + Expansion factor for the polygon union. No expansion occurs if the value + for this parameter is less than or equal to 0. expansion_unitless : bool - When unitless, the distance by which the extent expands is the factor multiplied by the longer dimension\ - (X or Y distance) of the expanded object/net. + When unitless, the distance by which the extent expands is the factor + multiplied by the longer dimension (X or Y distance) of the expanded + object/net. use_round_corner : bool - Whether to use round or sharp corners. - For round corners, this returns a bounding box if its area is within 10% of the rounded expansion's area. + Whether to use round corners or sharp corners. For round corners, this + returns a bounding box if its area is within 10% of the rounded expansion's + area. num_increments : int Number of iterations desired to reach the full expansion. @@ -189,7 +193,8 @@ def expanded_extent( Notes ----- - Method returns the expansion of the contour, so any voids within expanded objects are ignored. + This method returns the expansion of the contour, so any voids within expanded + objects are ignored. """ return self.__stub.GetExpandedExtentFromNets( messages.layout_expanded_extent_message( @@ -209,9 +214,10 @@ def convert_primitives_to_vias(self, primitives, is_pins=False): Parameters ---------- primitives : list[:class:`Primitive `] - List of primitives to convert. - is_pins : bool, optional - True for pins, false for vias (default). + List of primitives. + is_pins : bool, default: False + Whether the list consists of pins. The default is ``False``, in which + case the list consists of vias. """ self.__stub.ConvertPrimitivesToVias( messages.layout_convert_p2v_message(self, primitives, is_pins) @@ -219,25 +225,27 @@ def convert_primitives_to_vias(self, primitives, is_pins=False): @property def port_reference_terminals_connected(self): - """:obj:`bool`: Determine if port reference terminals are connected, applies to lumped ports and circuit ports. + """:obj:`bool`: Flag indicating if port reference terminals are connected. - True if they are connected, False otherwise. - Read-Only. + This property applies to lumped ports and circuit ports. It is ``True`` if + port terminals are connected, ``False`` otherwise. + + This property is read-only. """ return self.__stub.ArePortReferenceTerminalsConnected(self.msg).is_connected @property def zone_primitives(self): - """:obj:`list` of :class:`Primitive ` : List of all the primitives in \ - :term:`zones `. + """:obj:`list` of :class:`Primitive `: List of \ + all primitives in the :term:`zones `. - Read-Only. + This property is read-only. """ return [Primitive(msg) for msg in self.__stub.GetZonePrimitives(self.msg)] @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() @@ -247,65 +255,68 @@ def fixed_zone_primitive(self, value): @property def board_bend_defs(self): - """:obj:`list` of :class:`BoardBendDef ` : List of all the board bend \ - definitions in this layout. + """:obj:`list` of :class:`BoardBendDef `: List of all \ + board bend definitions in the layout. - Read-Only. + This property is read-only. """ return [BoardBendDef(msg) for msg in self.__stub.GetBoardBendDefs(self.msg)] def synchronize_bend_manager(self): - """Synchronize bend manager.""" + """Synchronize the bend manager.""" self.__stub.SynchronizeBendManager(self.msg) @property def layout_instance(self): - """:class:`LayoutInstance ` : Layout instance of this layout. + """:class:`LayoutInstance `: Instance of the layout. - Read-Only. + This property is read-only. """ return LayoutInstance(self.__stub.GetLayoutInstance(self.msg)) def create_stride(self, filename): - """Create a stride model from a Mcad file. + """Create a Stride model from an MCAD file. Parameters ---------- filename : str - absolute path of Mcad file. + Absolute path of the MCAD file. Returns ------- McadModel + Stride model created. """ return McadModel.create_stride(layout=self, filename=filename) def create_hfss(self, filename, design): - """Create a HFSS model from a Mcad file. + """Create an HFSS model from an MCAD file. Parameters ---------- filename : str - absolute path of Mcad file. + Absolute path of the MCAD file. design : str - design name. + Design name. Returns ------- McadModel + HFSS model created. """ return McadModel.create_hfss(connectable=self, filename=filename, design=design) def create_3d_comp(self, filename): - """Create a 3dComp model from a Mcad file. + """Create a 3D composite model from an MCAD file. Parameters ---------- filename : str - absolute path of Mcad file. + Absolute path of the MCAD file. Returns ------- McadModel + 3D composite model created. """ return McadModel.create_3d_comp(layout=self, filename=filename) diff --git a/src/ansys/edb/core/layout/mcad_model.py b/src/ansys/edb/core/layout/mcad_model.py index 3940072040..37c79c3211 100644 --- a/src/ansys/edb/core/layout/mcad_model.py +++ b/src/ansys/edb/core/layout/mcad_model.py @@ -1,4 +1,4 @@ -"""Mcad Model.""" +"""MCAD model.""" from ansys.edb.core import hierarchy from ansys.edb.core.inner import ObjBase, messages, parser @@ -6,7 +6,7 @@ class McadModel(ObjBase): - """Class representing a Mcad Model.""" + """Class representing an MCAD mdel.""" __stub: McadModelServiceStub = StubAccessor(StubType.mcad_model) @@ -14,7 +14,8 @@ class McadModel(ObjBase): def create_stride(cls, connectable=None, layout=None, filename=None): """Create a Stride model. - call directly on :term:`Connectable` or :func:`Layout`. + This method makes a call directly on a :term:`Connectable` or + :func:`Layout`. """ return cls( cls.__stub.CreateStride( @@ -24,9 +25,10 @@ def create_stride(cls, connectable=None, layout=None, filename=None): @classmethod def create_hfss(cls, connectable=None, layout=None, filename=None, design=None): - """Create a HFSS model. + """Create an HFSS model. - call directly on :term:`Connectable` or :func:`Layout`. + This method makes a call directly on a :term:`Connectable` or + :func:`Layout`. """ return cls( cls.__stub.CreateHfss( @@ -36,9 +38,10 @@ def create_hfss(cls, connectable=None, layout=None, filename=None, design=None): @classmethod def create_3d_comp(cls, connectable=None, layout=None, filename=None): - """Create a 3D Component model. + """Create a 3D component model. - call directly on :term:`Connectable` or :func:`Layout`. + This method makes a call directly on a :term:`Connectable` or + :func:`Layout`. """ return cls( cls.__stub.Create3dComp( @@ -48,63 +51,64 @@ def create_3d_comp(cls, connectable=None, layout=None, filename=None): @classmethod def is_mcad(cls, connectable): - """Get if a connectable object is Mcad model. + """Determine if a connectable object is an MCAD model. - call directly on :term:`Connectable`. + This method makes a call directly on a :term:`Connectable`. """ return cls.__stub.IsMcad(messages.edb_obj_message(connectable)) @classmethod def is_mcad_stride(cls, connectable): - """Get if a connectable object is Stride model. + """Determine if a connectable object is a Stride model. - call directly on :term:`Connectable`. + This method makes a call directly on a :term:`Connectable`. """ return cls.__stub.IsMcadStride(messages.edb_obj_message(connectable)) @classmethod def is_mcad_hfss(cls, connectable): - """Get if a connectable object is HFSS model. + """Determine if a connectable object is an HFSS model. - call directly on :term:`Connectable`. + This method makes a call directly on a :term:`Connectable`. """ return cls.__stub.IsMcadHfss(messages.edb_obj_message(connectable)) @classmethod def is_mcad_3d_comp(cls, connectable): - """Get if a connectable object is 3D Component model. + """Determine if a connectable object is a 3D component model. - call directly on :term:`Connectable`. + This method makes a call directly on a :term:`Connectable`. """ return cls.__stub.IsMcad3dComp(messages.edb_obj_message(connectable)) @property def cell_instance(self): - """:class:`CellInstance ` Cell instance of a Mcad model. + """:class:`CellInstance `: Cell instance \ + of the MCAD model. - Read-Only. + This property is read-only. """ return hierarchy.CellInstance(self.__stub.GetCellInst(messages.edb_obj_message(self))) @property def model_name(self): - """:obj:`str` Model name of a Mcad model. + """:obj:`str`: Name of the MCAD model. - Read-Only. + This property is read-only. """ return self.__stub.GetModelName(messages.edb_obj_message(self)).value @property def design_name(self): - """:obj:`str` Design name of a Mcad model. + """:obj:`str`: Design name of the MCAD model. - Read-Only. + This property is read-only. """ return self.__stub.GetDesignName(messages.edb_obj_message(self)).value @property def origin(self): - """:class:`Point3DData ` Origin 3D point of a Mcad model.""" + """:class:`Point3DData `: Origin 3D point of the MCAD model.""" return self.__stub.GetOrigin(messages.edb_obj_message(self)) @origin.setter @@ -113,7 +117,7 @@ def origin(self, pnt): @property def rotation(self): - r""":obj:`tuple`\[:class:`Point3DData `, :class:`Point3DData `, :obj:`float`\] Rotation from/to axis and 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), @@ -126,13 +130,14 @@ def rotation(self, value): self.set_rotation(*value) def set_rotation(self, axis_from, axis_to, angle): - """Set rotation from/to axis and angle in radians. + """Set rotation from/to the axis and the angle in radians. Parameters ---------- axis_from : :class:`Point3DData ` axis_to : :class:`Point3DData ` angle : float + Angle in radians. """ self.__stub.SetRotation( messages.mcad_model_set_rotation_message(self, axis_from, axis_to, angle) @@ -140,7 +145,7 @@ def set_rotation(self, axis_from, axis_to, angle): @property def scale(self): - """:obj:`float` The scale of a Mcad model.""" + """:obj:`float`: Scale of the MCAD model.""" return self.__stub.GetScale(messages.edb_obj_message(self)).value @scale.setter @@ -148,34 +153,39 @@ def scale(self, scale): self.__stub.SetScale(messages.double_property_message(self, scale)) def material(self, index): - """Get material name of a Mcad model part at index. + """Get the material name of the MCAD model part at a given index. Parameters ---------- index : int + Index of the MCAD model part. Returns ------- str + Material name. """ return self.__stub.GetMaterial(messages.int_property_message(self, index)).value def set_material(self, index, material): - """Set material name of a Mcad model part at index. + """Set material name of a MCAD model part at a given index. Parameters ---------- index : int + Index of the MCAD model part. material : str + New material name. """ self.__stub.SetMaterial(messages.mcad_model_string_message(self, index, material)) def visible(self, index): - """Get visibility of a Mcad model part at index. + """Get visibility of a MCAD model part at a given index. Parameters ---------- index : int + Index of the MCAD model part. Returns ------- @@ -184,69 +194,79 @@ def visible(self, index): return self.__stub.GetVisible(messages.int_property_message(self, index)).value def set_visible(self, index, visible): - """Set visibility of a Mcad model part at index. + """Set visibility of an MCAD model part at a given index. Parameters ---------- index : int + Index of the MCAD model part. visible : bool """ self.__stub.SetVisible(messages.mcad_model_bool_message(self, index, visible)) def modeled(self, index): - """Get if a Mcad model part at index is included in analysis. + """Determine if an MCAD model part at a given index is included in the analysis. Parameters ---------- index : int + Index of the MCAD model part. Returns ------- bool + ``True`` if the MCAD model part is included in the analysis, ``False`` otherwise. """ return self.__stub.GetModeled(messages.int_property_message(self, index)).value def set_modeled(self, index, modeled): - """Set if a Mcad model part at index is modeled. + """Set if an MCAD model part at a given index is to be modeled. Parameters ---------- index : int + Index of the MCAD model part. modeled : bool + Whether to model the MCAD model part. """ self.__stub.SetModeled(messages.mcad_model_bool_message(self, index, modeled)) def part_count(self): - """Mcad model part count. + """Get the MCAD model part count. Returns ------- int + MCAD model part count. """ return self.__stub.GetPartCount(messages.edb_obj_message(self)).value def part_index(self, name): - """Index of a Mcad model part with the specified name. + """Get the index of an MCAD model part with a given name. Parameters ---------- name : str + Name of the MCAD model part. Returns ------- int + Index of the MCAD model part. """ return self.__stub.GetPartIndex(messages.string_property_message(self, name)).value def part_name(self, index): - """Name of a Mcad model part at the specified index. + """Get the name of an MCAD model part at a given index. Parameters ---------- index : int + Index of the MCAD model part. Returns ------- str + Name of the MCAD model part. """ return self.__stub.GetPartName(messages.int_property_message(self, index)).value diff --git a/src/ansys/edb/core/layout/voltage_regulator.py b/src/ansys/edb/core/layout/voltage_regulator.py index 1ca7c8bbb3..b9a587c417 100644 --- a/src/ansys/edb/core/layout/voltage_regulator.py +++ b/src/ansys/edb/core/layout/voltage_regulator.py @@ -9,20 +9,20 @@ class PowerModule: - """Class representing a Power Module. + """Represents a power module. Attributes ---------- comp_group_name : str - Component Group Name. + Component group name. pos_output_terminal : str - Name of the Positive Output Terminal. + Name of the positive output terminal. neg_output_terminal : str - Name of the Negative Output Terminal + Name of the negative output terminal relative_strength : :class:`Value ` - Relative strength in % + Relative strength as a percentage value. active : bool - True if active + Whether the power module is active. """ def __init__( @@ -33,7 +33,7 @@ def __init__( relative_strength=Value(100), active=True, ): - """Construct a Power Module.""" + """Construct a power module.""" self._comp_group_name = comp_group_name self._pos_output_terminal = pos_output_terminal self._neg_output_terminal = neg_output_terminal @@ -43,7 +43,7 @@ def __init__( @property def comp_group_name(self): - """:obj:`str`: Component Group Name of this Power Module.""" + """:obj:`str`: Component group name of the power module.""" return self._comp_group_name @comp_group_name.setter @@ -52,7 +52,7 @@ def comp_group_name(self, comp_group_name): @property def pos_output_terminal(self): - """:obj:`str`: Positive Output Terminal name for this Power Module.""" + """:obj:`str`: Positive output terminal name for the power module.""" return self._pos_output_terminal @pos_output_terminal.setter @@ -61,7 +61,7 @@ def pos_output_terminal(self, pos_output_terminal): @property def neg_output_terminal(self): - """:obj:`str`: Negative Output Terminal name for this Power Module.""" + """:obj:`str`: Negative output terminal name for the power module.""" return self._neg_output_terminal @neg_output_terminal.setter @@ -70,9 +70,9 @@ def neg_output_terminal(self, neg_output_terminal): @property def relative_strength(self): - """:class:`Value ` : Relative Strength for this Power Module in percent. + """:class:`Value `: Relative strength for the power module as a percentage. - Property can be set with :term:`ValueLike` + This property can be set with :term:`ValueLike`. """ return self._relative_strength @@ -82,7 +82,7 @@ def relative_strength(self, relative_strength): @property def active(self): - """:obj:`bool`: True if this Power Module is active.""" + """:obj:`bool`: Flag indicating if the power module is active.""" return self._active @active.setter @@ -91,9 +91,9 @@ def active(self, active): @property def needs_sync(self): - """:obj:`bool`: True if this Power Module needs to be synchronized. + """:obj:`bool`: Flag indicating if the power module needs to be synchronized. - Read-Only + This property is read-only. """ return self._needs_sync @@ -117,7 +117,7 @@ def create_power_module(msg): class VoltageRegulator(conn_obj.ConnObj): - """Voltage regulator.""" + """Represents a voltage regulator.""" __stub = StubAccessor(StubType.voltage_regulator) layout_obj_type = LayoutObjType.VOLTAGE_REGULATOR @@ -130,22 +130,22 @@ def create(cls, layout, name, active, voltage, lrc, lrp): Parameters ---------- layout : :class:`Layout ` - Layout the voltage regulator will be in. + Layout to create the voltage regulator in. name : str - The name of the voltage regulator. + Name of the voltage regulator. active : bool - The voltage regulators active state. + Active state of the voltage regulator. voltage : :term:`ValueLike` - The voltage of the VoltageRegulator + Voltage of the voltage regulator. lrc : :term:`ValueLike` - The load regulation current + Load regulation current. lrp : :term:`ValueLike` - The load regulation percent. + Load regulation percentage. Returns ------- VoltageRegulator - Newly created voltage regulator. + Voltage regulator created. """ return VoltageRegulator( cls.__stub.Create( @@ -171,7 +171,7 @@ def name(self, newname): @property def active(self): - """:obj:`bool`: Active status of the Voltage Regulator.""" + """:obj:`bool`: Flag indicating if the voltage regular is active.""" return self.__stub.IsActive(self.msg).value @active.setter @@ -180,9 +180,9 @@ def active(self, newactive): @property def voltage(self): - """:class:`Value `: Voltage of the Voltage Regulator. + """:class:`Value `: Voltage of the voltage regulator. - Property can be set with :term:`ValueLike` + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetVoltage(self.msg)) @@ -194,9 +194,9 @@ 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. - Property can be set with :term:`ValueLike` + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetLoadRegulationCurrent(self.msg)) @@ -208,9 +208,9 @@ 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. - Property can be set with :term:`ValueLike` + This property can be set with :term:`ValueLike`. """ return Value(self.__stub.GetLoadRegulationPercent(self.msg)) @@ -223,7 +223,7 @@ def lrp(self, newlrp): @property def pos_remote_sense_pin(self): """:class:`PadstackInstance `: Positive remote sense pin of the \ - Voltage Regulator. + voltage regulator. .. seealso:: :obj:`neg_remote_sense_pin` """ @@ -236,7 +236,7 @@ def pos_remote_sense_pin(self, newpin): @property def neg_remote_sense_pin(self): """:class:`PadstackInstance `: Negative remote sense pin of the \ - Voltage Regulator. + voltage regulator. .. seealso:: :obj:`pos_remote_sense_pin` """ @@ -248,7 +248,7 @@ def neg_remote_sense_pin(self, newpin): @property def num_power_modules(self): - """:obj: `int` : Number of power modules. + """:obj: `int`: Number of power modules. Read-Only """ @@ -256,19 +256,19 @@ def num_power_modules(self): @property def num_active_power_modules(self): - """:obj: `int` : Number of active power modules. + """:obj: `int`: Number of active power modules. - Read-Only + This attribute is read-only """ return self.__stub.GetNActivePowerModules(self.msg).value def get_power_module(self, comp_group_name): - """Get power module corresponding to the component group name. + """Get the power module for a given component group name. Parameters ---------- comp_group_name : str - Component group name of the power module + Component group name of the power module. Returns ------- @@ -279,23 +279,24 @@ def get_power_module(self, comp_group_name): ) def get_all_power_modules(self): - """Get all power modules in this voltage regulator. + """Get all power modules in the voltage regulator. Returns ------- list[PowerModule] + List of all power modules. """ all_pms = self.__stub.GetAllPowerModules(self.msg) return [_QueryBuilder.create_power_module(msg=msg) for msg in all_pms.data] def add_power_module(self, power_module): - """Add a Power Module to this Voltage Regulator. + """Add a power module to the voltage regulator. Parameters ---------- power_module : PowerModule - PowerModule to be added + Power module. """ self.__stub.AddPowerModule( vr_pb2.PowerModulePropertyMessage( @@ -304,36 +305,36 @@ def add_power_module(self, power_module): ) def remove_power_module(self, name): - """Remove a Power Module from this Voltage Regulator. + """Remove a power module from the voltage regulator. Parameters ---------- name : str - Component Group Name of the Power Module to be removed. + Component group name of the power module. """ self.__stub.RemovePowerModule(messages.string_property_message(target=self, value=name)) def add_power_modules(self, power_modules): - """Add multiple Power Modules to this Voltage Regulator. + """Add multiple power modules to the voltage regulator. Parameters ---------- power_modules : list[PowerModule] - Power Modules to be added + List of power modules to add. """ self.__stub.AddPowerModules([messages.power_module_message(pm) for pm in power_modules]) def remove_power_modules(self, names): - """Remove multiple Power Modules. + """Remove multiple power modules from the voltage regulator. Parameters ---------- names : list[str] - Component Group Names of each Power Module to remove. + List of component group names of each power module to remove. """ self.__stub.RemovePowerModules(messages.strings_property_message(target=self, value=names)) def remove_all_power_modules(self): - """Remove all Power Modules in this Voltage Regulator.""" + """Remove all power modules in the voltage regulator.""" self.__stub.RemoveAllPowerModules(self.msg) diff --git a/src/ansys/edb/core/layout_instance/layout_instance.py b/src/ansys/edb/core/layout_instance/layout_instance.py index 8de05cfb16..610fc8c154 100644 --- a/src/ansys/edb/core/layout_instance/layout_instance.py +++ b/src/ansys/edb/core/layout_instance/layout_instance.py @@ -1,4 +1,4 @@ -"""Layout Instance.""" +"""Layout instance.""" import ansys.api.edb.v1.layout_instance_pb2 as layout_instance_pb2 from ansys.edb.core.geometry import PointData @@ -15,33 +15,33 @@ class LayoutInstance(ObjBase): - """Class representing layout instance object.""" + """Represents a layout instance object.""" __stub: LayoutInstanceServiceStub = StubAccessor(StubType.layout_instance) def refresh(self): - """Refresh the layout instance so it contains up to date geometry.""" + """Refresh the layout instance so it contains an up-to-date geometry.""" self.__stub.Refresh(self.msg) def query_layout_obj_instances(self, layer_filter=None, net_filter=None, spatial_filter=None): - """Query :class:`layout object instances ` using the provided filters. + """Query layout object instances using the provided filters. Parameters ---------- - layer_filter : list[:class:`Layer ` or str or None], optional - Specifies which layers to query. If :obj:`None`, all layers will be queried. - net_filter : list[:class:`Net ` or str or None], optional - Specifies which nets to query. If :obj:`None`, all nets will be queried. - spatial_filter : :class:`PolygonData ` or \ - :class:`PointData ` or None, optional - Specifies which area of the design to query. If :obj:`None`, the entire spatial domain of the design will \ - be queried. + 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 + 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 + 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]] - If a polygonal spatial filter is specified, a tuple of lists of hits is returned of the - format [, ]. + 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. """ @@ -78,16 +78,15 @@ def to_msg_filter_list(client_filter, ref_msg_type): return utils.map_list(hits.hits.items, LayoutObjInstance) def get_layout_obj_instance_in_context(self, layout_obj, context): - """Get the :class:`layout object instance ` of the given :term:`Connectable ` \ - in the provided context. + """Get the layout object instance of the given :term:`connectable ` in the provided context. Parameters ---------- layout_obj : :term:`Connectable ` - Layout object whose instances will be searched for. + Layout object with the instances to search. context : list[str] - list of strings specifying the :class:`context ` that the instance of \ - layout_obj will be retrieved from. + List of strings specifying the :class:`context ` that the / + layout object instance is retrieved from. .. seealso:: :func:`LayoutObjInstance.context` @@ -106,23 +105,22 @@ def get_layout_obj_instance_in_context(self, layout_obj, context): ) def get_connected_objects(self, origin_layout_obj_inst, touching_only): - """Get the :class:`layout object instances ` connected to the origin \ - layout object instance. + """Get the layout object instance connected to the origin layout object instance. Parameters ---------- origin_layout_obj_inst : LayoutObjInstance - :class:`layout object instance ` that will act as the origin to get connected objects \ - from. + Layout object instance that is to act as the origin to get connected objects from. touching_only : bool - If touching_only is true, only :class:`layout object instances ` touching \ - origin_layout_obj_inst on the placement :class:`layer ` of \ - origin_layout_obj_inst will be returned. Otherwise, all layout object instances across all layers that \ - are electrically connected to origin_layout_obj_inst will be returned. + 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 + instances across all layers that are electrically connected to the origin layout object + instance are returned. Returns ------- list[LayoutObjInstance] + List of layout object instances connected to the origin layout object instance. """ hits = self.__stub.GetConnectedObjects( layout_instance_pb2.GetConnectedObjectsMessage( 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 8560c51819..053ee18443 100644 --- a/src/ansys/edb/core/layout_instance/layout_instance_context.py +++ b/src/ansys/edb/core/layout_instance/layout_instance_context.py @@ -1,4 +1,4 @@ -"""Layout Instance Context.""" +"""Layout instance context.""" from ansys.edb.core.inner import ObjBase, parser from ansys.edb.core.inner.messages import bool_property_message @@ -7,7 +7,7 @@ class LayoutInstanceContext(ObjBase): - """Class representing layout instance context object.""" + """Represents the layout instance context object.""" __stub: LayoutInstanceContextServiceStub = StubAccessor(StubType.layout_instance_context) @@ -15,7 +15,7 @@ class LayoutInstanceContext(ObjBase): def layout(self): """:class:`Layout `: Layout of the context. - Read-Only. + This property is read-only. """ return layout.Layout(self.__stub.GetLayout(self.msg)) @@ -26,12 +26,13 @@ def get_bbox(self, local): Parameters ---------- local : bool - If true, return the bounding-box in the local :class:`context `. Otherwise, \ - return the bounding-box in the global context. + Whether to return the bounding box in the local :class:`context `. + If ``False``, the bounding-box in the global context is returned. Returns ------- :class:`PolygonData ` + Bounding box of the context. """ return self.__stub.GetBBox(bool_property_message(self, local)) @@ -39,27 +40,28 @@ def get_bbox(self, local): def is_top_or_black_box(self): """:obj:`bool`: Flag indicating if this is a top-level or blackbox context. - Read-Only. + This property is read-only. """ return self.__stub.IsTopOrBlackBox(self.msg).value @property def top_or_black_box(self): - """:class:`LayoutInstanceContext`: The top-level or blackbox :class:`context `. + """:class:`LayoutInstanceContext`: Top-level or blackbox :class:`context ` instance. - Read-Only. + This property is read-only. """ return LayoutInstanceContext(self.__stub.GetTopOrBlackBox(self.msg)) @property def placement_elevation(self): - """:obj:`float`: The placement elevation of the context. + """:obj:`float`: Placement elevation of the context. - Only applies if the context doesn't have 3D placement. \ - If the context has 3D placement is enabled, :obj:`None` is returned because the placement of the context is \ - dictated by the underlying 3d transformation. Otherwise, the placement elevation of the context is returned. + This parameter only applies if the context does not have 3D placement enabled. + If the context has 3D placement enabled, ``None`` is returned because the + placement of the context is dictated by the underlying 3D transformation. + Otherwise, the placement elevation of the context is returned. - Read-Only. + This property is read-only. """ return ( self.__stub.GetPlacementElevation(self.msg).value @@ -68,16 +70,18 @@ def placement_elevation(self): ) def get_is_3d_placement(self, local): - """Check if the context has 3d placement enabled. + """Determine if the context has 3D placement enabled. Parameters ---------- local : bool - If true, check the local :class:`context ` only. If false, check for a 3D \ - Placement anywhere up the hierarchy. + Whether 3D placement is enabled only in the local :class:`context `. + If ``False``, a check is run to see if 3D placement is enabled anywhere higher in the + hierarchy. Returns ------- bool + ``True`` if 3D placement is enabled in the local context. """ return self.__stub.Is3DPlacement(bool_property_message(self, local)).value 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 aae0941ea9..0c06659a6b 100644 --- a/src/ansys/edb/core/layout_instance/layout_obj_instance.py +++ b/src/ansys/edb/core/layout_instance/layout_obj_instance.py @@ -1,4 +1,4 @@ -"""Layout Obj Instance.""" +"""Layout object instance.""" from ansys.edb.core.inner import ObjBase, parser, utils from ansys.edb.core.inner.factory import create_conn_obj @@ -16,7 +16,7 @@ def _parse_layout_obj_instance_geometry_message(lyt_obj_inst_geom_msg): if lyt_obj_inst_geom_msg.type == -1: - raise TypeError("Encountered an unknown layout obj instance geometry type") + raise TypeError("Encountered an unknown geometry type for the layout object instance.") geom_type = ( LayoutObjInstance2DGeometry if lyt_obj_inst_geom_msg.type == 0 @@ -27,29 +27,25 @@ def _parse_layout_obj_instance_geometry_message(lyt_obj_inst_geom_msg): class LayoutObjInstance(ObjBase): - """Class representing layout object instance.""" + """Represents a layout object instance.""" __stub: LayoutObjInstanceServiceStub = StubAccessor(StubType.layout_obj_instance) @property def layers(self): - """Return a list of Layer instances. + """:obj:`list` of :class:`ansys.edb.core.layer.Layer`: All layer instances. - This list contains the :class:`Layer ` instances that this layout - object instance has geometry on. - - Returns - ------- - list[ansys.edb.core.layer.Layer] + This list contains the layer` instances that the layout object instance has geometry on. """ return [Layer(msg).cast() for msg in self.__stub.GetLayers(self.msg).items] def get_geometries(self, layer): - """Get the geometry that exists on the specified layer. + """Get the geometry that exists on a given layer. Parameters ---------- layer : :class:`Layer ` or str + Layer. Returns ------- @@ -60,31 +56,31 @@ def get_geometries(self, layer): @property def context(self): - r""":obj:`list`\[:obj:`str`\]: List of strings representing the context of the layout object instance. + r""":obj:`list`\[:obj:`str`\]: All strings representing the context of the layout object instance. - The list of strings is a list of :class:`cell instance ` names \ - representing the hierarchy level this layout obj instance's :class:`context ` \ - resides on. The the first entry in the list represents the top level context and the last entry \ - represents the context the layout obj instance exists in. + This list of strings is a list of :class:`cell instance ` names + representing the hierarchy level this layout obj instance's :class:`context ` + resides on. The first entry represents the top-level context and the last entry represents + the context that the layout object instance exists in. - Read-Only + This property is read-only. """ return utils.map_list(self.__stub.GetContext(self.msg).strings) @property def layout_instance_context(self): - """:class:`LayoutInstanceContext`: The context this layout object instance exists in. + """:class:`LayoutInstanceContext`: Context that the layout object instance exists in. - Read-Only. + This property is read-only. """ return LayoutInstanceContext(self.__stub.GetLayoutInstanceContext(self.msg)) @property def layout_obj(self): - """:term:`Connectable `: The definition layout object this layout object instance \ - is an instance of. + """:term:`Connectable `: Definition layout object that the layout object \ + instance is an instance of. - Read-Only. + This property is read-only. """ return create_conn_obj(self.__stub.GetLayoutObj(self.msg)) @@ -95,11 +91,12 @@ def get_bbox(self, local=False): Parameters ---------- local : bool - If true, return the bounding-box in the local :class:`context `. Otherwise, \ - return the bounding-box in the global context. + Whether to return the bounding box in the local :class:`context `. + If ``False``, the bounding box is returned in the global context. Returns ------- :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 afc29ca218..fec89d83a9 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 @@ -1,4 +1,4 @@ -"""Layout Obj Instance 2D Geometry.""" +"""Layout object instance 2D geometry.""" from ansys.api.edb.v1.layout_obj_instance_2d_geometry_pb2 import GetPolygonDataMessage @@ -8,7 +8,7 @@ class LayoutObjInstance2DGeometry(LayoutObjInstanceGeometry): - """Class representing layout object instance 2D geometry.""" + """Represents a layout object instance 2D geometry.""" __stub: LayoutObjInstance2DGeometryServiceStub = StubAccessor( StubType.layout_obj_instance_2d_geometry @@ -18,7 +18,7 @@ class LayoutObjInstance2DGeometry(LayoutObjInstanceGeometry): def is_negative(self): """:obj:`bool`: Flag indicating if the geometry is negative. - Read-Only. + This property is read-only. """ return self.__stub.IsNegative(self.msg).value 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 1082a658f1..0943ecea07 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,4 +1,4 @@ -"""Layout Obj Instance 3D Geometry.""" +"""Layout object instance 3D geometry.""" from ansys.edb.core.geometry import Triangle3DData from ansys.edb.core.inner import utils @@ -8,7 +8,7 @@ class LayoutObjInstance3DGeometry(LayoutObjInstanceGeometry): - """Class representing layout object instance 3D geometry.""" + """Represents a layout object instance 3D geometry.""" __stub: LayoutObjInstance3DGeometryServiceStub = StubAccessor( StubType.layout_obj_instance_3d_geometry @@ -16,14 +16,10 @@ class LayoutObjInstance3DGeometry(LayoutObjInstanceGeometry): @property def tesselation_data(self): - """Return a list of Triangle3DData instances. + """:obj:`list` of :class:`ansys.edb.core.geometry.Triangle3DData`: All triangle 3D data instances. - This list contains :class:`Triangle3DData ` instances - that correspond to the underlying tessellation data of the geometry. - - Returns - ------- - list[ansys.edb.core.geometry.Triangle3DData] + This list contains triangle 3D data instances that correspond to the + underlying tessellation data of the geometry. """ tesselation_data = self.__stub.GetTesselationData(self.msg) diff --git a/src/ansys/edb/core/layout_instance/layout_obj_instance_geometry.py b/src/ansys/edb/core/layout_instance/layout_obj_instance_geometry.py index 3d9d86b970..3c9ce356b2 100644 --- a/src/ansys/edb/core/layout_instance/layout_obj_instance_geometry.py +++ b/src/ansys/edb/core/layout_instance/layout_obj_instance_geometry.py @@ -1,4 +1,4 @@ -"""Layout Obj Instance Geometry.""" +"""Layout object instance geometry.""" from ansys.api.edb.v1.layout_obj_instance_geometry_pb2 import LayoutObjInstanceGeometryMessage @@ -8,14 +8,14 @@ class LayoutObjInstanceGeometry(ObjBase): - """Class representing layout object instance geometry.""" + """Represents layout object instance geometry.""" __stub: LayoutObjInstanceGeometryServiceStub = StubAccessor( StubType.layout_obj_instance_geometry ) def __init__(self, geometry, owning_drawing, placement_lyr): - """Initialize layout obj instance geometry object. + """Initialize the layout object instance geometry object. Parameters ---------- @@ -29,7 +29,7 @@ def __init__(self, geometry, owning_drawing, placement_lyr): @ObjBase.msg.getter def msg(self): - """Return protobuf message that represents this object's ID. + """Protobuf message that represents this object's ID. Returns ------- @@ -43,16 +43,16 @@ def msg(self): @property def material(self): - """:obj:`str`: The material of the geometry. + """:obj:`str`: Material of the geometry. - Read-Only. + This property is read-only. """ return self.__stub.GetMaterial(self.msg).value @property def color(self): - """:obj:`int`: The color of the geometry. + """:obj:`int`: Color of the geometry. - Read-Only. + This property is read-only. """ return self.__stub.GetColor(self.msg).value diff --git a/src/ansys/edb/core/net/differential_pair.py b/src/ansys/edb/core/net/differential_pair.py index 0d882c3cd9..dd76ed4cc0 100644 --- a/src/ansys/edb/core/net/differential_pair.py +++ b/src/ansys/edb/core/net/differential_pair.py @@ -8,7 +8,7 @@ class DifferentialPair(NetClass): - """Differential pair class.""" + """Represents a differential pair.""" __stub: DifferentialPairServiceStub = StubAccessor(StubType.differential_pair) layout_obj_type = LayoutObjType.DIFFERENTIAL_PAIR @@ -17,23 +17,23 @@ class DifferentialPair(NetClass): def create(cls, layout, name, pos_net=None, neg_net=None): """Create a differential pair. - User must either provide both nets or omit both nets + You must either provide both nets or omit both nets. Parameters ---------- layout : :class:`Layout` - Layout on which new differential pair is placed. + Layout to create the differential pair in. name : str - Name of new differential pair. - pos_net : Net or str, optional - Positive net or name of positive net. - neg_net : Net or str, optional - Negative net or name of negative net. + Name of the new differential pair. + pos_net : Net or str, default: None + Positive net or name of the positive net. + neg_net : Net or str, default: None + Negative net or the name of negative net. Returns ------- DifferentialPair - Newly created differential pair. + Differential pair created. """ return cls( cls.__stub.Create( @@ -43,26 +43,26 @@ def create(cls, layout, name, pos_net=None, neg_net=None): @classmethod def find_by_name(cls, layout, name): - """Find a differential pair in a layout by name. + """Find a differential pair by name in a given layout. Parameters ---------- layout : :class:`Layout` - Layout being searched for differential pair + Layout to search for the differential pair. name : str - Name of the differential pair to find + Name of the differential pair. Returns ------- DifferentialPair - The differential pair that was found. Check the returned differential pair's \ - :obj:`is_null ` property to see if it exists. + Differential pair that was found. Check the :obj:`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`\): The 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 +74,7 @@ def differential_pair(self, value): @property def positive_net(self): - """:class:`Net`: The positive net of a differential pair.""" + """:class:`Net`: Positive net in the differential pair.""" return self.differential_pair[0] @positive_net.setter @@ -85,7 +85,7 @@ def positive_net(self, value): @property def negative_net(self): - """:class:`Net`: The negative net of a differential pair.""" + """:class:`Net`: Negative net in the differential pair.""" return self.differential_pair[1] @negative_net.setter @@ -96,23 +96,30 @@ def negative_net(self, value): @property def is_power_ground(self): - """Invalid for differential pair.""" + """Flag indicating if the new is power/ground. + + This property is invalid for a differential pair. + """ return False def add_net(self, net): - """Invalid for differential pair. + """Add a net. - Use :obj:`ansys.edb.core.net.DifferentialPair.differential_pair` = (pos_net, neg_net) instead. + This method is invalid for a differential pair. Use + :obj:`ansys.edb.core.net.DifferentialPair.differential_pair` = (pos_net, neg_net) instead. """ - raise TypeError("net cannot be added to differential pair.") + raise TypeError("Net cannot be added to a differential pair.") def remove_net(self, net): - """Invalid for differential pair.""" - raise TypeError("net cannot be removed from differential pair.") + """Remove a net. + + This method is invalid for a differential pair. + """ + raise TypeError("Net cannot be removed from a differential pair.") @property def nets(self): - """Invalid for differential pair. + """This property is invalid for a differential pair. Use :obj:`ansys.edb.core.net.DifferentialPair.differential_pair` instead. """ diff --git a/src/ansys/edb/core/net/extended_net.py b/src/ansys/edb/core/net/extended_net.py index fb1ae15f35..c8bc8c0fb4 100644 --- a/src/ansys/edb/core/net/extended_net.py +++ b/src/ansys/edb/core/net/extended_net.py @@ -1,4 +1,4 @@ -"""Extended Net.""" +"""Extended net.""" import ansys.api.edb.v1.extended_net_pb2 as enet_pb2 @@ -22,7 +22,7 @@ def extnet_modify_net_msg(ext_net, net): class ExtendedNet(net_class.NetClass): - """ExtendedNet class.""" + """Represents an extended net.""" __stub = StubAccessor(StubType.extended_net) layout_obj_type = LayoutObjType.EXTENDED_NET @@ -34,14 +34,14 @@ def create(cls, layout, name): Parameters ---------- layout : :class:`Layout ` - Layout containing new extended net. + Layout to create the extended net in. name : str - Name of the new extended net + Name of the extended net. Returns ------- ExtendedNet - Newly created extended net + Extended net created. """ return ExtendedNet( cls.__stub.Create(_ExtendedNetQueryBuilder.extnet_create_msg(layout, name)) @@ -49,45 +49,45 @@ def create(cls, layout, name): @classmethod def find_by_name(cls, layout, name): - """Find an extended net in a layout by name. + """Find an extended net by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout being searched for extended net + Layout to search for the extended net. name : str - Name of the extended net to find + Name of the extended net. Returns ------- ExtendedNet - The extended net that was found. Check the returned extended net's \ - :obj:`is_null ` property to see if it exists. + Extended net that was found. Check the :obj:`is_null ` + property of the extended net to see if it exists. """ return ExtendedNet( cls.__stub.FindByName(_ExtendedNetQueryBuilder.extenet_find_by_name_msg(layout, name)) ) def add_net(self, net): - """Add net to this extended net. + """Add a net to the extended net. Parameters ---------- net : Net - The net to be added. + Net to add. """ self.__stub.AddNet(_ExtendedNetQueryBuilder.extnet_modify_net_msg(self, net)) def remove_net(self, net): - """Remove net from this extended net. + """Remove a net from the extended net. Parameters ---------- net : Net - The net to be removed. + Net to remove. """ self.__stub.RemoveNet(_ExtendedNetQueryBuilder.extnet_modify_net_msg(self, net)) def remove_all_nets(self): - """Remove all nets from this extended net.""" + """Remove all nets from the extended net.""" self.__stub.RemoveAllNets(self.msg) diff --git a/src/ansys/edb/core/net/net.py b/src/ansys/edb/core/net/net.py index e1d68d646f..721e2b3716 100644 --- a/src/ansys/edb/core/net/net.py +++ b/src/ansys/edb/core/net/net.py @@ -10,7 +10,7 @@ class Net(layout_obj.LayoutObj): - """Class representing net.""" + """Represents a net.""" layout_obj_type = LayoutObjType.NET no_net_name = "" @@ -29,39 +29,39 @@ def create(cls, layout, name): Parameters ---------- layout : :class:`Layout ` - Layout containing new net. + Layout to create the net in. name : str - Name of new net + Name of the net. Returns ------- Net - Newly created net. + Net created. """ return Net(cls.__stub.Create(messages.string_property_message(layout, name))) @classmethod def find_by_name(cls, layout, name): - """Find a net in a layout by name. + """Find a net by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout being searched for net + Layout to search for the net. name : str - Name of net being searched for. + Name of net. Returns ------- Net - Net matching the requested name. Check the returned net's \ - :obj:`is_null ` property to see if it exists. + Net found. Check the :obj:`is_null ` property + of the returned net to see if it exists. """ return Net(cls.__stub.FindByName(messages.string_property_message(layout, name))) @property def name(self): - """:class:`str`: Name of this net.""" + """:class:`str`: Name of the net.""" return self.__stub.GetName(self.msg).value @name.setter @@ -70,9 +70,9 @@ def name(self, value): @property def is_power_ground(self): - """:class:`bool`: True if net belongs to Power/Ground :class:`NetClass`. + """:class:`bool`: Flag indicating if the net belongs to a power/ground :class:`NetClass` instance. - Read-Only. + This property is read-only. """ return self.__stub.GetIsPowerGround(self.msg).value @@ -82,66 +82,44 @@ def is_power_ground(self, value): @property def primitives(self): - r""":obj:`list`\[:class:`Primitive `\]: List of all primitives on this net. + r""":obj:`list` of :class:`Primitive `: All primitives on the net. - Read-Only. + This property is read-only. """ return [Primitive(lo).cast() for lo in self._layout_objs(LayoutObjType.PRIMITIVE)] @property def padstack_instances(self): - """Return a list of PadstackInstance instances. - - This list contains the :class:`PadstackInstance ` \ - instances on this net object instance. - - Returns - ------- - list[ansys.edb.core.primitive.PadstackInstance] - """ + """:obj:`list` of :class:`ansys.edb.core.primitive.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): - """Return a list of Terminal instances. - - This list contains the :class:`Terminal ` \ - instances on this net object instance. - - Returns - ------- - list[ansys.edb.core.terminal.Terminal] - """ + """:obj:`list` of :class:`ansys.edb.core.terminal.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): - """Return a list of TerminalInstance instances. - - This list contains the :class:`TerminalInstance ` instances \ - that are on this net object instance. - - Returns - ------- - list[ansys.edb.core.layer.Layer] - """ + """:obj:`list` of :class:`ansys.edb.core.layer.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`\[:class:`NetClass`\]: List of all net classes on this net. + r""":obj:`list` of :class:`NetClass`: All net classes on the net. - Read-Only. + This property is read-only. """ return [NetClass(lo) for lo in self._layout_objs(LayoutObjType.NET_CLASS)] @property def extended_net(self): - """:class:`ExtendedNet` or :class:`None`: The extended net that this net belongs to. + """:class:`ExtendedNet` or :class:`None`: Extended net that the net belongs to. - :class:`None` means the net doesn't belong to an extended net. + :class:`None` means that the net does not belong to an extended net. - Read-Only. + This property is read-only. """ en = ExtendedNet(self._layout_objs(LayoutObjType.NET_CLASS)[0]) return None if en.is_null else en diff --git a/src/ansys/edb/core/net/net_class.py b/src/ansys/edb/core/net/net_class.py index 0553d7dd55..13f062d3db 100644 --- a/src/ansys/edb/core/net/net_class.py +++ b/src/ansys/edb/core/net/net_class.py @@ -14,7 +14,7 @@ def create(layout, name): class NetClass(layout_obj.LayoutObj): - """Net class.""" + """Represents a net class.""" __stub = StubAccessor(StubType.netclass) layout_obj_type = LayoutObjType.NET_CLASS @@ -22,45 +22,45 @@ class NetClass(layout_obj.LayoutObj): @classmethod def create(cls, layout, name): """ - Create net class. + Create a net. Parameters ---------- layout : :class:`Layout ` - Layout containing new net class. + Layout to create the net class in. name : str - Name of the new net class. + Name of the net. Returns ------- NetClass - Newly created net class. + Net class created. """ return NetClass(cls.__stub.Create(_QueryBuilder.create(layout, name))) @classmethod def find_by_name(cls, layout, name): """ - Find net class by name. + Find a net class by name in a given layout. Parameters ---------- layout : :class:`Layout ` - Layout being searched for net class. + Layout to search for the net class. name : str - Name of net class being searched for. + Name of the net class. Returns ------- NetClass - Net class matching the requested name. Check the returned net class's \ - :obj:`is_null ` property to see if it exists. + 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))) @property def name(self): - """:obj:`str`: Name of this object.""" + """:obj:`str`: Name of the net class.""" return self.__stub.GetName(self.msg).value @name.setter @@ -69,7 +69,7 @@ def name(self, newname): @property def description(self): - """:obj:`str` : Description of this object.""" + """:obj:`str` : Description of the net class.""" return self.__stub.GetDescription(self.msg).value @description.setter @@ -78,17 +78,18 @@ def description(self, newdesc): @property def is_power_ground(self): - """:class:`bool`: True if object belongs to Power/Ground :class:`NetClass`. + """:class:`bool`: Flag indicating in the net class belongs to the power/ground \ + :class:`NetClass` class. - Read-Only. + This property is read-only. """ return self.__stub.IsPowerGround(messages.edb_obj_message(self.msg)).value @property def nets(self): - """:obj:`list` of :class:`Net `: List of nets in this object. + """:obj:`list` of :class:`Net `: List of nets in the net class. - Read-Only. + This property is read-only. """ from ansys.edb.core.net.net import Net @@ -97,39 +98,39 @@ def nets(self): def add_net(self, net): """ - Add net to this this object. + Add a net to the net class. Parameters ---------- net : Net - Net to add + Net to add. """ return self.__stub.AddNet(nc_pb2.NetClassEditMessage(netclass=self.msg, net=net.msg)) def remove_net(self, net): """ - Remove net from this object. + Remove a net from the net class. Parameters ---------- net : Net - Net to remove + Net to remove. """ self.__stub.RemoveNet(nc_pb2.NetClassEditMessage(netclass=self.msg, net=net.msg)) def contains_net(self, net): """ - Check if net exists in this object. + Determine if a net exists in the net class. Parameters ---------- net : Net - Net to check for. + Net to search for. Returns ------- bool - True if net is in this object + ``True`` if the net is in the net class, ``False`` otherwise. """ return self.__stub.ContainsNet( nc_pb2.NetClassEditMessage(netclass=self.msg, net=net.msg) diff --git a/src/ansys/edb/core/primitive/primitive.py b/src/ansys/edb/core/primitive/primitive.py index becf7b31b9..5f225c0df8 100644 --- a/src/ansys/edb/core/primitive/primitive.py +++ b/src/ansys/edb/core/primitive/primitive.py @@ -1,4 +1,4 @@ -"""Primitive.""" +"""Primitive classes.""" from enum import Enum @@ -58,7 +58,7 @@ def set_layer(p, layer): class PrimitiveType(Enum): - """Enum representing available primitive types. + """Provides an enum representing primitive types. - RECTANGLE - CIRCLE @@ -85,7 +85,7 @@ class PrimitiveType(Enum): class RectangleRepresentationType(Enum): - """Enum representing possible rectangle types. + """Provides an enum representing rectangle types. - INVALID_RECT_TYPE Undefined. @@ -101,7 +101,7 @@ class RectangleRepresentationType(Enum): class PathEndCapType(Enum): - """Enum representing possible end cap types. + """Provides an enum representing end cap types. - ROUND - FLAT @@ -118,7 +118,7 @@ class PathEndCapType(Enum): class PathCornerType(Enum): - """Enum representing possible corner types. + """Provides an enum representing corner types. - ROUND - SHARP @@ -131,7 +131,7 @@ class PathCornerType(Enum): class BondwireType(Enum): - """Enum representing possible bondwire types. + """Provides an enum representing bondwire types. - APD - JEDEC4 @@ -148,7 +148,7 @@ class BondwireType(Enum): class BondwireCrossSectionType(Enum): - """Enum representing possible bondwire cross section types. + """Provides an enum representing bondwire cross section types. - ROUND - RECTANGLE @@ -161,7 +161,7 @@ class BondwireCrossSectionType(Enum): class BackDrillType(Enum): - """Enum representing possible Back Drill types. + """Provides an enum representing back drill types. - NO_DRILL - LAYER_DRILL @@ -174,13 +174,13 @@ class BackDrillType(Enum): class Primitive(conn_obj.ConnObj): - """Base class representing primitive objects.""" + """Represents a primitive object.""" __stub: primitive_pb2_grpc.PrimitiveServiceStub = StubAccessor(StubType.primitive) layout_obj_type = LayoutObjType.PRIMITIVE def cast(self): - """Cast the primitive object to correct concrete type. + """Cast the primitive object to the correct concrete type. Returns ------- @@ -207,19 +207,19 @@ def cast(self): def primitive_type(self): """:class:`PrimitiveType`: Primitive type of the primitive. - Read-Only. + This property is read-only. """ return PrimitiveType( self.__stub.GetPrimitiveType(_PrimitiveQueryBuilder.get_primitive_type(self)).type ) def add_void(self, hole): - """Add a void to primitive. + """Add a void to the primitive. Parameters ---------- hole : Primitive - Void to be added to the primitive. + Void to add. """ self.__stub.AddVoid(_PrimitiveQueryBuilder.add_void(self, hole)) @@ -229,9 +229,9 @@ def set_hfss_prop(self, material, solve_inside): Parameters ---------- material : str - Material property name to be set. + Material property name to set. solve_inside : bool - Whether to do solve inside. + Whether to solve inside. """ self.__stub.SetHfssProp(_PrimitiveQueryBuilder.set_hfss_prop(self, material, solve_inside)) @@ -247,7 +247,7 @@ def layer(self, layer): @property def is_negative(self): - """:obj:`bool`: If the primitive is negative.""" + """:obj:`bool`: Flag indicating if the primitive is negative.""" return self.__stub.GetIsNegative(self.msg).value @is_negative.setter @@ -256,14 +256,14 @@ def is_negative(self, is_negative): @property def is_void(self): - """:obj:`bool`: If a primitive is a void.""" + """:obj:`bool`: Flag indicating if a primitive is a void.""" return self.__stub.IsVoid(self.msg).value @property def has_voids(self): - """:obj:`bool`: If a primitive has voids inside. + """:obj:`bool`: Flag indicating if a primitive has voids inside. - Read-Only. + This property is read-only. """ return self.__stub.HasVoids(self.msg).value @@ -272,7 +272,7 @@ def voids(self): """:obj:`list` of :class:`Primitive `: List of void\ primitive objects inside the primitive. - Read-Only. + This property is read-only. """ return [Primitive(msg).cast() for msg in self.__stub.Voids(self.msg).items] @@ -280,15 +280,15 @@ def voids(self): def owner(self): """:class:`Primitive `: Owner of the primitive object. - Read-Only. + This property is read-only. """ return Primitive(self.__stub.GetOwner(self.msg)).cast() @property def is_parameterized(self): - """:obj:`bool`: Primitive's parametrization. + """:obj:`bool`: Whether the primitive is parametrized. - Read-Only. + This property is read-only. """ return self.__stub.IsParameterized(self.msg).value @@ -299,9 +299,9 @@ def get_hfss_prop(self): Returns ------- material : str - Material property name. + Name of the material property. solve_inside : bool - If solve inside. + Whether to solve inside. """ prop_msg = self.__stub.GetHfssProp(self.msg) return prop_msg.material_name, prop_msg.solve_inside @@ -312,34 +312,33 @@ def remove_hfss_prop(self): @property def is_zone_primitive(self): - """:obj:`bool`: If primitive object is a zone. + """:obj:`bool`: Flag indicating if the primitive object is a zone. - Read-Only. + This property is read-only. """ return self.__stub.IsZonePrimitive(self.msg).value @property def can_be_zone_primitive(self): - """:obj:`bool`: If a primitive can be a zone. + """:obj:`bool`: Flag indicating if the primitive can be a zone. - Read-Only. + This property is read-only. """ return True def make_zone_primitive(self, zone_id): - """Make primitive a zone primitive with a zone specified by the provided id. + """Make the primitive a zone primitive with a zone specified by the provided ID. Parameters ---------- zone_id : int - Id of zone primitive will use. - + ID of the zone primitive to use. """ self.__stub.MakeZonePrimitive(messages.int_property_message(self, zone_id)) class Rectangle(Primitive): - """Class representing a rectangle object.""" + """Represents a rectangle object.""" __stub: rectangle_pb2_grpc.RectangleServiceStub = StubAccessor(StubType.rectangle) @@ -352,21 +351,21 @@ def create( Parameters ---------- layout : :class:`Layout ` - Layout this rectangle will be in. + Layout to create the rectangle in. layer : str or :class:`Layer ` - Layer this rectangle will be on. + Layer the rectangle is to created on. net : str or :class:`Net ` or None - Net this rectangle will have. + Net the rectangle is to have. rep_type : :class:`RectangleRepresentationType` - Type that defines given parameters meaning. + Type that defines the meaning of the given parameters. param1 : :class:`Value ` - X value of lower left point or center point. + X value of the lower-left point or center point. param2 : :class:`Value ` - Y value of lower left point or center point. + Y value of the lower-left point or center point. param3 : :class:`Value ` - X value of upper right point or width. + X value of the upper-right point or width. param4 : :class:`Value ` - Y value of upper right point or height. + Y value of the upper-right point or height. corner_rad : :class:`Value ` Corner radius. rotation : :class:`Value ` @@ -375,7 +374,7 @@ def create( Returns ------- Rectangle - Rectangle that was created. + Rectangle created. """ return Rectangle( cls.__stub.Create( @@ -395,7 +394,7 @@ def create( ) def get_parameters(self): - """Get coordinates parameters. + """Get coordinate parameters. Returns ------- @@ -409,7 +408,7 @@ def get_parameters(self): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(representation_type, parameter1, parameter2, parameter3, parameter4, corner_radius, rotation)** @@ -439,20 +438,20 @@ def get_parameters(self): ) def set_parameters(self, rep_type, param1, param2, param3, param4, corner_rad, rotation): - """Set coordinates parameters. + """Set coordinate parameters. Parameters ---------- rep_type : :class:`RectangleRepresentationType` - Type that defines given parameters meaning. + Type that defines the meaning of the given parameters. param1 : :class:`Value ` - X value of lower left point or center point. + X value of the lower-left point or center point. param2 : :class:`Value ` - Y value of lower left point or center point. + Y value of the lower-left point or center point. param3 : :class:`Value ` - X value of upper right point or width. + X value of the upper-right point or width. param4 : :class:`Value ` - Y value of upper right point or height. + Y value of the upper-right point or height. corner_rad : :class:`Value ` Corner radius. rotation : :class:`Value ` @@ -475,9 +474,9 @@ def set_parameters(self, rep_type, param1, param2, param3, param4, corner_rad, r @property def can_be_zone_primitive(self): - """:obj:`bool`: If a rectangle can be a zone. + """:obj:`bool`: Flag indicating if the rectangle can be a zone. - Read-Only. + This property is read-only. """ return True @@ -485,7 +484,7 @@ def can_be_zone_primitive(self): def polygon_data(self): """:class:`PolygonData `: Polygon data object of the rectangle. - Read-Only. + This property is read-only. """ return Rectangle.render(*self.get_parameters()) @@ -507,21 +506,21 @@ def render( Parameters ---------- rep_type : :class:`RectangleRepresentationType` - Type that defines given parameters meaning. + Type that defines the meaning of the given parameters. x_lower_left_or_center_x : :class:`Value ` - X value of lower left point or center point. + X value of the lower-left point or center point. y_lower_left_or_center_y : :class:`Value ` - Y value of lower left point or center point. + Y value of the lower-left point or center point. x_upper_right_or_width : :class:`Value ` - X value of upper right point or width. + X value of the upper-right point or width. y_upper_right_or_height : :class:`Value ` - Y value of upper right point or height. + Y value of the upper-right point or height. corner_radius : :class:`Value ` Corner radius. rotation : :class:`Value ` Rotation. - is_hole : bool, optional - If rectangle is hole. + is_hole : bool, default: False + Whether the rectangle is hole. Returns ------- @@ -562,7 +561,7 @@ def render( class Circle(Primitive): - """Class representing a circle object.""" + """Represents a circle object.""" __stub: circle_pb2_grpc.CircleServiceStub = StubAccessor(StubType.circle) @@ -573,22 +572,22 @@ def create(cls, layout, layer, net, center_x, center_y, radius): Parameters ---------- layout: :class:`Layout ` - Layout this circle will be in. + Layout to create this circle in. layer: str or :class:`Layer ` - Layer this circle will be on. + Layer to place the circle on. net: str or :class:`Net ` or None - Net this circle will have. + Net of the circle. center_x: :class:`Value ` - X value of center point. + X value of the center point. center_y: :class:`Value ` - Y value of center point. + Y value of the center point. radius: :class:`Value ` Radius value of the circle. Returns ------- Circle - Circle object created. + Circle created. """ return Circle( cls.__stub.Create( @@ -611,18 +610,18 @@ def render(cls, center_x, center_y, radius, is_hole): Parameters ---------- center_x: :class:`Value ` - X value of center point. + X value of the center point. center_y: :class:`Value ` - Y value of center point. + Y value of the center point. radius: :class:`Value ` Radius value of the circle. is_hole: bool - If circle object is a hole. + Whether the circle object is a hole. Returns ------- :class:`PolygonData ` - Polygon data object created. + Circle created. """ return cls.__stub.Render( circle_pb2.CircleRenderMessage( @@ -634,7 +633,7 @@ def render(cls, center_x, center_y, radius, is_hole): ) def get_parameters(self): - """Get parameters of a circle. + """Get parameters of the circle. Returns ------- @@ -644,7 +643,7 @@ def get_parameters(self): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(center_x, center_y, radius)** @@ -662,14 +661,14 @@ def get_parameters(self): ) def set_parameters(self, center_x, center_y, radius): - """Set parameters of a circle. + """Set parameters of the circle. Parameters ---------- center_x: :class:`Value ` - X value of center point. + X value of the center point. center_y: :class:`Value ` - Y value of center point. + Y value of the center point. radius: :class:`Value ` Radius value of the circle. """ @@ -685,16 +684,16 @@ def set_parameters(self, center_x, center_y, radius): ) def get_polygon_data(self): - """:class:`PolygonData `: Polygon data object of the Circle object.""" + """:class:`PolygonData `: Polygon data object of the circle.""" return Circle.render(*self.get_parameters(), self.is_void) def can_be_zone_primitive(self): - """:obj:`bool`: If a circle can be a zone.""" + """:obj:`bool`: Flag indicating if a circle can be a zone.""" return True class Text(Primitive): - """Class representing a text object.""" + """Represents a text object.""" __stub: text_pb2_grpc.TextServiceStub = StubAccessor(StubType.text) @@ -705,20 +704,20 @@ def create(cls, layout, layer, center_x, center_y, text): Parameters ---------- layout: :class:`Layout ` - Layout this text will be in. + Layout to create the text object in. layer: str or Layer - Layer this text will be on. + Layer to place the text object on. center_x: :class:`Value ` - X value of center point. + X value of the center point. center_y: :class:`Value ` - Y value of center point. + Y value of the center point. text: str Text string. Returns ------- Text - The text Object that was created. + Text object created. """ return Text( cls.__stub.Create( @@ -733,7 +732,7 @@ def create(cls, layout, layer, center_x, center_y, text): ) def get_text_data(self): - """Get the text data of a text. + """Get the data for the text object. Returns ------- @@ -742,7 +741,7 @@ def get_text_data(self): :class:`Value `, str ] - Returns a tuple of the following format: + Returns a tuple in this format: **(center_x, center_y, text)** @@ -760,16 +759,16 @@ def get_text_data(self): ) def set_text_data(self, center_x, center_y, text): - """Set the text data of a text. + """Set the data for the text object. Parameters ---------- center_x: :class:`Value ` - X value of center point. + X value of the center point. center_y: :class:`Value ` - Y value of center point. + Y value of the center point. text: str - Text object's String value. + String value for the text object. """ self.__stub.SetTextData( text_pb2.SetTextDataMessage( @@ -795,7 +794,7 @@ def create(layout, layer, net, points): class Polygon(Primitive): - """Class representing a polygon object.""" + """Represents a polygon object.""" __stub: polygon_pb2_grpc.PolygonServiceStub = StubAccessor(StubType.polygon) @@ -806,18 +805,18 @@ def create(cls, layout, layer, net, polygon_data): Parameters ---------- layout : :class:`Layout ` - Layout the polygon will be in. + Layout to create the polygon in. layer : str or :class:`Layer ` - Layer this Polygon will be in. + Layer to place the polygon on. net : str or :class:`Net ` or None - Net of the Polygon object. + Net of the polygon. polygon_data : :class:`PolygonData ` - The outer contour of the Polygon. + Outer contour of the polygon. Returns ------- Polygon - Polygon object created. + Polygon created. """ return Polygon( cls.__stub.Create(_PolygonQueryBuilder.create(layout, layer, net, polygon_data)) @@ -826,7 +825,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 object.""" + """:class:`PolygonData `: Outer contour of the polygon.""" return self.__stub.GetPolygonData(self.msg) @polygon_data.setter @@ -839,9 +838,9 @@ def polygon_data(self, poly): @property def can_be_zone_primitive(self): - """:obj:`bool`: If a polygon can be a zone. + """:obj:`bool`: Flag indicating if a polygon can be a zone. - Read-Only. + This property is read-only. """ return True @@ -862,7 +861,7 @@ def create(layout, layer, net, width, end_cap1, end_cap2, corner, points): class Path(Primitive): - """Class representing a path object.""" + """Represents a path object.""" __stub: path_pb2_grpc.PathServiceStub = StubAccessor(StubType.path) @@ -873,26 +872,26 @@ def create(cls, layout, layer, net, width, end_cap1, end_cap2, corner_style, poi Parameters ---------- layout : :class:`Layout ` - Layout this Path will be in. + Layout to create the path in. layer : str or :class:`Layer ` - Layer this Path will be on. + Layer to place the path on. net : str or :class:`Net ` or None - Net this Path will have. + Net of the path. width: :class:`Value ` Path width. end_cap1: :class:`PathEndCapType` - End cap style of path start end cap. + End cap style for the start of the path. end_cap2: :class:`PathEndCapType` - End cap style of path end end cap. + End cap style for the end of the path. corner_style: :class:`PathCornerType` Corner style. points : :class:`PolygonData ` - Centerline polygonData to set. + Centerline polygon data to set. Returns ------- Path - Path object created. + Path created. """ return Path( cls.__stub.Create( @@ -905,25 +904,25 @@ def create(cls, layout, layer, net, width, end_cap1, end_cap2, corner_style, poi @classmethod @parser.to_polygon_data def render(cls, width, end_cap1, end_cap2, corner_style, path): - """Render a Path object. + """Render a path. Parameters ---------- width: :class:`Value ` Path width. end_cap1: :class:`PathEndCapType` - End cap style of path start end cap. + End cap style for the start of the path. end_cap2: :class:`PathEndCapType` - End cap style of path end end cap. + End cap style for the end of the path. corner_style: :class:`PathCornerType` Corner style. path: :class:`PolygonData ` - PolygonData to set. + Polygon data to set. Returns ------- :class:`PolygonData ` - PolygonData object created. + Path rendered. """ return cls.__stub.Render( path_pb2.PathRenderMessage( @@ -938,7 +937,7 @@ def render(cls, width, end_cap1, end_cap2, corner_style, path): @property @parser.to_polygon_data def center_line(self): - """:class:`PolygonData `: Center line for this Path.""" + """:class:`PolygonData `: Center line for the path.""" return self.__stub.GetCenterLine(self.msg) @center_line.setter @@ -948,7 +947,7 @@ def center_line(self, center_line): ) def get_end_cap_style(self): - """Get path end cap styles. + """Get end cap styles for the path. Returns ------- @@ -957,7 +956,7 @@ def get_end_cap_style(self): :class:`PathEndCapType` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(end_cap1, end_cap2)** @@ -969,14 +968,14 @@ def get_end_cap_style(self): return PathEndCapType(end_cap_msg.end_cap1), PathEndCapType(end_cap_msg.end_cap2) def set_end_cap_style(self, end_cap1, end_cap2): - """Set path end cap styles. + """Set end cap styles for the path. Parameters ---------- end_cap1: :class:`PathEndCapType` - End cap style of path start end cap. + End cap style for the start of the path. end_cap2: :class:`PathEndCapType` - End cap style of path end end cap. + End cap style for the end of the path. """ self.__stub.SetEndCapStyle( path_pb2.SetEndCapStyleMessage( @@ -988,13 +987,13 @@ def set_end_cap_style(self, end_cap1, end_cap2): ) def get_clip_info(self): - """Get data used to clip the path. + """Get the data used to clip the path. Returns ------- tuple[:class:`PolygonData `, bool] - Returns a tuple of the following format: + Returns a tuple in this format: **(clipping_poly, keep_inside)** @@ -1009,14 +1008,14 @@ def get_clip_info(self): ) def set_clip_info(self, clipping_poly, keep_inside=True): - """Set data used to clip the path. + """Set the data used to clip the path. Parameters ---------- clipping_poly: :class:`PolygonData ` - PolygonData used to clip the path. - keep_inside: bool - Indicates whether the part of the path inside the polygon should be preserved. + 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. """ self.__stub.SetClipInfo( path_pb2.SetClipInfoMessage( @@ -1028,7 +1027,7 @@ def set_clip_info(self, clipping_poly, keep_inside=True): @property def corner_style(self): - """:class:`PathCornerType`: Path's corner style.""" + """:class:`PathCornerType`: Corner style of the path.""" return PathCornerType(self.__stub.GetCornerStyle(self.msg).corner_style) @corner_style.setter @@ -1072,9 +1071,9 @@ def miter_ratio(self, miter_ratio): @property def can_be_zone_primitive(self): - """:obj:`bool`: If a path can be a zone. + """:obj:`bool`: Flag indicating if the path can be a zone. - Read-Only. + This property is read-only. """ return True @@ -1181,7 +1180,7 @@ def set_bondwire_traj_message(b, x1, y1, y2, x2): class Bondwire(Primitive): - """Class representing a bondwire object.""" + """Represents a bondwire object.""" __stub: bondwire_pb2_grpc.BondwireServiceStub = StubAccessor(StubType.bondwire) @@ -1204,40 +1203,40 @@ def create( end_y, net, ): - """Create a bondwire object. + """Create a bondwire. Parameters ---------- layout : :class:`Layout ` - Layout this bondwire will be in. + Layout to create the bondwire in. bondwire_type : :class:`BondwireType` - Type of bondwire: kAPDBondWire or kJDECBondWire types. + Type of the bondwire. Options are ``kAPDBondWire`` and ``kJDECBondWire``. definition_name : str Bondwire definition name. placement_layer : str - Layer name this bondwire will be on. + Layer name to create the bondwire on. width : :class:`Value ` Bondwire width. material : str Bondwire material name. start_context : :class:`CellInstance ` - Start context: None means top level. + Start context. ``None`` means top-level,. start_layer_name : str - Name of start layer. + Name of the start layer. start_x : :class:`Value ` - X value of start point. + X value of the start point. start_y : :class:`Value ` - Y value of start point. + Y value of the start point. end_context : :class:`CellInstance ` - End context: None means top level. + End context: End content. ``None`` means top-level. end_layer_name : str - Name of end layer. + Name of the end layer. end_x : :class:`Value ` - X value of end point. + X value of the end point. end_y : :class:`Value ` - Y value of end point. + Y value of the end point. net : str or :class:`Net ` or None - Net of the Bondwire. + Net of the bondwire. Returns ------- @@ -1267,12 +1266,12 @@ def create( ) def get_material(self, evaluated=True): - """Get material of the bondwire. + """Get the material of the bondwire. Parameters ---------- - evaluated : bool, optional - True if an evaluated material name is wanted. + evaluated : bool, default: True + Whether an evaluated (in variable namespace) material name is wanted. Returns ------- @@ -1282,7 +1281,7 @@ def get_material(self, evaluated=True): return self.__stub.GetMaterial(_BondwireQueryBuilder.bondwire_bool_message(self, evaluated)) def set_material(self, material): - """Set the material of a bondwire. + """Set the material of the bondwire. Parameters ---------- @@ -1293,7 +1292,7 @@ def set_material(self, material): @property def type(self): - """:class:`BondwireType`: Bondwire-type of a bondwire object.""" + """:class:`BondwireType`: Type of the bondwire.""" btype_msg = self.__stub.GetType(self.msg) return BondwireType(btype_msg.type) @@ -1303,7 +1302,7 @@ def type(self, bondwire_type): @property def cross_section_type(self): - """:class:`BondwireCrossSectionType`: Bondwire-cross-section-type of a bondwire object.""" + """:class:`BondwireCrossSectionType`:Cross-section type of the bondwire.""" return BondwireCrossSectionType(self.__stub.GetCrossSectionType(self.msg).type) @cross_section_type.setter @@ -1314,7 +1313,7 @@ def cross_section_type(self, bondwire_type): @property def cross_section_height(self): - """:class:`Value `: Bondwire-cross-section height of a bondwire object.""" + """:class:`Value `: Cross-section height of the bondwire.""" return Value(self.__stub.GetCrossSectionHeight(self.msg)) @cross_section_height.setter @@ -1324,17 +1323,17 @@ def cross_section_height(self, height): ) def get_definition_name(self, evaluated=True): - """Get definition name of a bondwire object. + """Get the definition name of the bondwire object. Parameters ---------- - evaluated : bool, optional - True if an evaluated (in variable namespace) material name is wanted. + evaluated : bool, default: True + Whether an evaluated (in variable namespace) material name is wanted. Returns ------- str - Bondwire name. + Bondwire definition name. """ return self.__stub.GetDefinitionName( _BondwireQueryBuilder.bondwire_bool_message(self, evaluated) @@ -1346,14 +1345,14 @@ def set_definition_name(self, definition_name): Parameters ---------- definition_name : str - Bondwire name to be set. + Bondwire definition name to set. """ self.__stub.SetDefinitionName( _BondwireQueryBuilder.set_definition_name_message(self, definition_name) ) def get_traj(self): - """Get trajectory parameters of a bondwire object. + """Get trajectory parameters of the bondwire. Returns ------- @@ -1364,7 +1363,7 @@ def get_traj(self): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(x1, y1, x2, y2)** @@ -1385,16 +1384,16 @@ def get_traj(self): ) def set_traj(self, x1, y1, x2, y2): - """Set the parameters of the trajectory of a bondwire. + """Set the parameters of the trajectory of the bondwire. Parameters ---------- x1 : :class:`Value ` - X value of the start point. + X value of the the start point. y1 : :class:`Value ` - Y value of the start point. + Y value of the the start point. x2 : :class:`Value ` - X value of the end point. + X value of the the end point. y2 : :class:`Value ` Y value of the end point. """ @@ -1402,7 +1401,7 @@ def set_traj(self, x1, y1, x2, y2): @property def width(self): - """:class:`Value `: Width of a bondwire object.""" + """:class:`Value `: Width of the bondwire.""" val = self.__stub.GetWidthValue(self.msg) return Value(val) @@ -1411,7 +1410,7 @@ def width(self, width): self.__stub.SetWidthValue(_BondwireQueryBuilder.bondwire_value_message(self, width)) def get_start_elevation(self, start_context): - """Get the start elevation layer of a bondwire object. + """Get the start elevation layer of the bondwire. Parameters ---------- @@ -1421,7 +1420,7 @@ def get_start_elevation(self, start_context): Returns ------- :class:`Layer ` - Start context of the bondwire. + Start elevation level of the bondwire. """ return Layer( self.__stub.GetStartElevation( @@ -1430,12 +1429,12 @@ def get_start_elevation(self, start_context): ).cast() def set_start_elevation(self, start_context, layer): - """Set the start elevation of a bondwire. + """Set the start elevation of the bondwire. Parameters ---------- start_context : :class:`CellInstance ` - Start cell context of the bondwire. None means top level. + Start cell context of the bondwire. ``None`` means top-level. layer : str or :class:`Layer ` Start layer of the bondwire. """ @@ -1444,7 +1443,7 @@ def set_start_elevation(self, start_context, layer): ) def get_end_elevation(self, end_context): - """Get the end elevation layer of a bondwire object. + """Get the end elevation layer of the bondwire. Parameters ---------- @@ -1454,7 +1453,7 @@ def get_end_elevation(self, end_context): Returns ------- :class:`Layer ` - End context of the bondwire. + End elevation layer of the bondwire. """ return Layer( self.__stub.GetEndElevation( @@ -1463,12 +1462,12 @@ def get_end_elevation(self, end_context): ).cast() def set_end_elevation(self, end_context, layer): - """Set the end elevation of a bondwire. + """Set the end elevation of the bondwire. Parameters ---------- end_context : :class:`CellInstance ` - End cell context of the bondwire. None means top level. + End cell context of the bondwire. ``None`` means top-level. layer : str or :class:`Layer ` End layer of the bondwire. """ @@ -1623,7 +1622,7 @@ def get_back_drill_message(padstack_inst, from_bottom): class PadstackInstance(Primitive): - """Class representing a Padstack Instance object.""" + """Representis a padstack instance object.""" __stub: padstack_instance_pb2_grpc.PadstackInstanceServiceStub = StubAccessor( StubType.padstack_instance @@ -1643,33 +1642,34 @@ def create( solder_ball_layer, layer_map, ): - """Create a PadstackInstance object. + """Create a padstack instance. Parameters ---------- layout : :class:`Layout ` - Layout this padstack instance will be in. + Layout to create the padstack instance in. net : :class:`Net ` - Net of this padstack instance. + Net of the padstack instance. name : str - Name of padstack instance. + Name of the padstack instance. padstack_def : PadstackDef - Padstack definition of this padstack instance. + Padstack definition of the padstack instance. rotation : :class:`Value ` - Rotation of this padstack instance. + Rotation of the padstack instance. top_layer : :class:`Layer ` - Top layer of this padstack instance. + Top layer of the padstack instance. bottom_layer : :class:`Layer ` - Bottom layer of this padstack instance. + Bottom layer of the padstack instance. solder_ball_layer : :class:`Layer ` - Solder ball layer of this padstack instance, or None for none. + Solder ball layer of the padstack instance or ``None`` for none. layer_map : :class:`LayerMap ` - Layer map of this padstack instance. None or empty means do auto-mapping. + Layer map of the padstack instance. ``None`` or empty results in + auto-mapping. Returns ------- PadstackInstance - Padstack instance object created. + Padstack instance created. """ return PadstackInstance( cls.__stub.Create( @@ -1689,12 +1689,12 @@ def create( @property def padstack_def(self): - """:class:`PadstackDef `: PadstackDef of a Padstack Instance.""" + """:class:`PadstackDef `: Definition of the padstack instance.""" return PadstackDef(self.__stub.GetPadstackDef(self.msg)) @property def name(self): - """:obj:`str`: Name of a Padstack Instance.""" + """:obj:`str`: Name of the padstack instance.""" return self.__stub.GetName(self.msg).value @name.setter @@ -1702,7 +1702,7 @@ def name(self, name): self.__stub.SetName(_PadstackInstanceQueryBuilder.set_name_message(self, name)) def get_position_and_rotation(self): - """Get the position and rotation of a Padstack Instance. + """Get the position and rotation of the padstack instance. Returns ------- @@ -1712,7 +1712,7 @@ def get_position_and_rotation(self): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(x, y, rotation)** @@ -1730,7 +1730,7 @@ def get_position_and_rotation(self): ) def set_position_and_rotation(self, x, y, rotation): - """Set the position and rotation of a Padstack Instance. + """Set the position and rotation of the padstack instance. Parameters ---------- @@ -1739,29 +1739,23 @@ def set_position_and_rotation(self, x, y, rotation): y : :class:`Value ` y : Y coordinate. rotation : :class:`Value ` - rotation : Rotation in radians. + Rotation in radians. """ self.__stub.SetPositionAndRotation( _PadstackInstanceQueryBuilder.set_position_and_rotation_message(self, x, y, rotation) ) def get_layer_range(self): - """Get the top and bottom layers of a Padstack Instance. + """Get the top and bottom layers of the padstack instance. Returns ------- - tuple[ - :class:`Layer `, - :class:`Layer ` - ] + tuple[:class:`Layer `, :class:`Layer `] - Returns a tuple of the following format: + The tuple is in this format: ``(top_layer, bottom_layer)``. - **(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 ( @@ -1770,14 +1764,14 @@ def get_layer_range(self): ) def set_layer_range(self, top_layer, bottom_layer): - """Set the top and bottom layers of a Padstack Instance. + """Set the top and bottom layers of the padstack instance. Parameters ---------- top_layer : :class:`Layer ` - Top layer of the Padstack instance. + Top layer of the padstack instance. bottom_layer : :class:`Layer ` - Bottom layer of the Padstack instance. + Bottom layer of the padstack instance. """ self.__stub.SetLayerRange( _PadstackInstanceQueryBuilder.set_layer_range_message(self, top_layer, bottom_layer) @@ -1785,7 +1779,7 @@ def set_layer_range(self, top_layer, bottom_layer): @property def solderball_layer(self): - """:class:`Layer `: SolderBall Layer of Padstack Instance.""" + """:class:`Layer `: Solderball layer of the padstack instance.""" return Layer(self.__stub.GetSolderBallLayer(self.msg)).cast() @solderball_layer.setter @@ -1796,7 +1790,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 @@ -1804,7 +1798,7 @@ def layer_map(self, layer_map): self.__stub.SetLayerMap(messages.pointer_property_message(self, layer_map)) def get_hole_overrides(self): - """Get the hole overrides of Padstack Instance. + """Get the hole overrides of the padstack instance. Returns ------- @@ -1813,7 +1807,7 @@ def get_hole_overrides(self): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(is_hole_override, hole_override)** @@ -1828,14 +1822,14 @@ def get_hole_overrides(self): ) def set_hole_overrides(self, is_hole_override, hole_override): - """Set the hole overrides of Padstack Instance. + """Set the hole overrides of the padstack instance. Parameters ---------- is_hole_override : bool - If padstack instance is hole override. + Whether the padstack instance is a hole override. hole_override : :class:`Value ` - Hole override diameter of this padstack instance. + Hole override diameter of the padstack instance. """ self.__stub.SetHoleOverrides( _PadstackInstanceQueryBuilder.set_hole_overrides_message( @@ -1845,7 +1839,7 @@ def set_hole_overrides(self, is_hole_override, hole_override): @property def is_layout_pin(self): - """:obj:`bool`: If padstack instance is layout pin.""" + """:obj:`bool`: Flag indicating if the padstack instance is a layout pin.""" return self.__stub.GetIsLayoutPin(self.msg).value @is_layout_pin.setter @@ -1855,17 +1849,17 @@ def is_layout_pin(self, is_layout_pin): ) def get_back_drill_type(self, from_bottom): - """Get the back drill type of Padstack Instance. + """Get the back drill type of the padstack instance. Parameters ---------- from_bottom : bool - True to get drill type from bottom. + Whether to get the back drill type from the bottom. Returns ------- :class:`BackDrillType` - Back-Drill Type of padastack instance. + Back drill type of the padastack instance. """ return BackDrillType( self.__stub.GetBackDrillType( @@ -1874,12 +1868,12 @@ def get_back_drill_type(self, from_bottom): ) def get_back_drill_by_layer(self, from_bottom): - """Get the back drill by layer. + """Get the back drill type by the layer. Parameters ---------- from_bottom : bool - True to get drill type from bottom. + Whether to get the back drill type from the bottom. Returns ------- @@ -1889,7 +1883,7 @@ def get_back_drill_by_layer(self, from_bottom): :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(drill_to_layer, offset, diameter)** @@ -1911,19 +1905,20 @@ def get_back_drill_by_layer(self, from_bottom): ) def set_back_drill_by_layer(self, drill_to_layer, offset, diameter, from_bottom): - """Set the back drill by layer. + """Set the back drill by the layer. Parameters ---------- drill_to_layer : :class:`Layer ` - Layer drills to. If drill from top, drill stops at the upper elevation of the layer. - If from bottom, drill stops at the lower elevation of the 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 ` - Layer offset (or depth if layer is empty). + Layer offset (or depth if the layer is empty). diameter : :class:`Value ` Drilling diameter. from_bottom : bool - True to set drill type from bottom. + Whether to set the back drill type from the bottom. """ self.__stub.SetBackDrillByLayer( _PadstackInstanceQueryBuilder.set_back_drill_by_layer_message( @@ -1932,12 +1927,12 @@ def set_back_drill_by_layer(self, drill_to_layer, offset, diameter, from_bottom) ) def get_back_drill_by_depth(self, from_bottom): - """Get the back drill by depth. + """Get the back drill type by depth. Parameters ---------- from_bottom : bool - True to get drill type from bottom. + Whether to get the back drill type from the bottom. Returns ------- @@ -1945,7 +1940,7 @@ def get_back_drill_by_depth(self, from_bottom): bool, :class:`Value ` ] - Returns a tuple of the following format: + Returns a tuple in this format: **(drill_depth, diameter)** @@ -1959,16 +1954,16 @@ def get_back_drill_by_depth(self, from_bottom): return Value(params.drill_depth), Value(params.diameter) def set_back_drill_by_depth(self, drill_depth, diameter, from_bottom): - """Set the back drill by Depth. + """Set the back drill type by depth. Parameters ---------- drill_depth : :class:`Value ` - Drilling depth, may not align with layer. + Drilling depth, which may not align with the layer. diameter : :class:`Value ` Drilling diameter. from_bottom : bool - True to set drill type from bottom. + Whether to set the back drill type from the bottom. """ self.__stub.SetBackDrillByDepth( _PadstackInstanceQueryBuilder.set_back_drill_by_depth_message( @@ -1977,21 +1972,21 @@ def set_back_drill_by_depth(self, drill_depth, diameter, from_bottom): ) def get_padstack_instance_terminal(self): - """:class:`TerminalInstance `: Padstack Instance's terminal.""" + """:class:`TerminalInstance `: Terminal of the padstack instance.""" return terminal.TerminalInstance(self.__stub.GetPadstackInstanceTerminal(self.msg)) def is_in_pin_group(self, pin_group): - """Check if Padstack instance is in the Pin Group. + """Determine if the padstack instance is in a given pin group. Parameters ---------- pin_group : :class:`PinGroup ` - Pin group to check if padstack instance is in. + Pin group to check if the padstack instance is in it. Returns ------- bool - True if padstack instance is in pin group. + Whether the padstack instance is in a pin group. """ return self.__stub.IsInPinGroup( _PadstackInstanceQueryBuilder.is_in_pin_group_message(self, pin_group) @@ -1999,16 +1994,16 @@ def is_in_pin_group(self, pin_group): @property def pin_groups(self): - """:obj:`list` of :class:`PinGroup `: Pin groups of Padstack instance object. + """:obj:`list` of :class:`PinGroup `: Pin groups of the padstack instance. - Read-Only. + This property is read-only. """ pins = self.__stub.GetPinGroups(self.msg).items return [hierarchy.PinGroup(p) for p in pins] class BoardBendDef(Primitive): - """Class representing board bending definitions.""" + """Represents a board bend definition instance.""" __stub: board_bend_def_pb2_grpc.BoardBendDefServiceStub = StubAccessor(StubType.board_bend_def) @@ -2019,11 +2014,12 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle): Parameters ---------- layout : :class:`Layout ` - Layout this board bend definition will be in. + Layout to create the board bend definition in. zone_prim : :class:`Primitive ` - Zone primitive this board bend definition exists on. + Zone primitive to create the board bend definition on. bend_middle : :term:`PointDataTuple` - Tuple containing the starting and ending points of the line that represents the middle of the bend. + Tuple containing the starting and ending points of the line that represents + the middle of the bend. bend_radius : :term:`ValueLike` Radius of the bend. bend_angle : :term:`ValueLike` @@ -2032,7 +2028,7 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle): Returns ------- BoardBendDef - BoardBendDef that was created. + Board bend definition created. """ return BoardBendDef( cls.__stub.Create( @@ -2050,14 +2046,14 @@ def create(cls, layout, zone_prim, bend_middle, bend_radius, bend_angle): def boundary_primitive(self): """:class:`Primitive `: Zone primitive the board bend is placed on. - Read-Only. + This property is read-only. """ return Primitive(self.__stub.GetBoundaryPrim(self.msg)).cast() @property @parser.to_point_data_pair def bend_middle(self): - """:term:`PointDataTuple`: Tuple of the bend middle starting and ending points.""" + """:term:`PointDataTuple`: Tuple of the bend middle based on the starting and ending points.""" return self.__stub.GetBendMiddle(self.msg) @bend_middle.setter @@ -2087,8 +2083,8 @@ def angle(self, val): def bent_regions(self): """:obj:`list` of :class:`PolygonData `: Bent region polygons. - Collection of polygon data representing the areas bent by this bend definition. + This list of a collection of polygon data represents the areas bent by the bend definition. - Read-Only. + This property is read-only. """ return self.__stub.GetBentRegions(self.msg) diff --git a/src/ansys/edb/core/session.py b/src/ansys/edb/core/session.py index e0a03b188d..2cd8b7865f 100644 --- a/src/ansys/edb/core/session.py +++ b/src/ansys/edb/core/session.py @@ -434,11 +434,11 @@ def attach_session(ip_address=None, port_num=50051): Parameters ---------- - ip_address : str, optional + ip_address : str, default: None IP address of the machine that is running the server. The default is ``None``, in which case localhost is used. - port_num : int, optional - Port number that the server is listening on. The default is ``50051``. + port_num : int, default: 50051 + Port number that the server is listening on. """ MOD.current_session = _Session(ip_address, port_num, None) MOD.current_session.connect() @@ -454,9 +454,9 @@ def launch_session(ansys_em_root, port_num=None): ---------- ansys_em_root : str Directory where the ``EDB_RPC_Server.exe`` file is installed. - port_num : int, optional + port_num : int, default: None Port number to listen on. The default is ``None``, in which - case local host is used. + case localhost is used. Examples -------- @@ -487,10 +487,10 @@ def session(ansys_em_root, port_num, ip_address=None): ansys_em_root : str Directory where the ``EDB_RPC_Server.exe`` file is installed. port_num : int - Port number to listen on. The default is ``None``. - ip_address : str, optional + Port number to listen on. + ip_address : str, default: None IP address where the server executable file is running. The default is ``None``, in which - case local host is used. + case localhost is used. .. note:: This parameter is currently not supported. In future releases, this parameter is to diff --git a/src/ansys/edb/core/simulation_setup/adaptive_solutions.py b/src/ansys/edb/core/simulation_setup/adaptive_solutions.py index 7e45ed9d19..99a3116792 100644 --- a/src/ansys/edb/core/simulation_setup/adaptive_solutions.py +++ b/src/ansys/edb/core/simulation_setup/adaptive_solutions.py @@ -21,7 +21,7 @@ def __init__(self, port_1_name, port_2_name, mag_limit, phase_limit): @property def port_1_name(self): - """:obj:`str`: Name of first port.""" + """:obj:`str`: Name of the first port.""" return self._port_1_name @port_1_name.setter @@ -30,7 +30,7 @@ def port_1_name(self, port_1_name): @property def port_2_name(self): - """:obj:`str`: Name of second port.""" + """:obj:`str`: Name of the second port.""" return self._port_2_name @port_2_name.setter @@ -57,7 +57,7 @@ def phase_limit(self, phase_limit): class MatrixConvergenceData: - """Class representing matrix convergence data for an adaptive frequency solution. + """Represents matrix convergence data for an adaptive frequency solution. Attributes ---------- @@ -75,31 +75,34 @@ def __init__(self, mag_min_threshold=0.01, entry_list=None): @property def all_constant(self): - """:obj:`bool`: All matrix entries are the same. + """:obj:`bool`: Flag indicating if all matrix entries are the same. - Read-Only. + This property is read-only. """ return self._all_constant @property def all_diag_constant(self): - """:obj:`bool`: All diagonal matrix entries are the same. + """:obj:`bool`: Flag indicating if all diagonal matrix entries are the same. - Read-Only. + This property is read-only. """ return self._all_diag_constant @property def all_off_diag_constant(self): - """:obj:`bool`: All off-diagonal matrix entries are the same. + """:obj:`bool`: Flag indicating if all off-diagonal matrix entries are the same. - Read-Only. + This property is read-only. """ return self._all_off_diag_constant @property def mag_min_threshold(self): - """:obj:`float`: When magnitude is less than this value, phase is ignored.""" + """:obj:`float`: Minimum magnitude threshold. + + When the magnitude is less than the minimal threshold value, the phase is ignored. + """ return self._mag_minThreshold @mag_min_threshold.setter @@ -124,8 +127,11 @@ def set_all_constant(self, mag_limit, phase_limit, port_names): Parameters ---------- mag_limit : float + Magnitude limit. phase_limit : float + Phase limit. port_names : list[:obj:`str`] + List of port names. """ self._entry_list.clear() @@ -145,9 +151,13 @@ def set_all_diag_constant(self, mag_limit, phase_limit, port_names, clear_entrie Parameters ---------- mag_limit : float + Magnitude limit. phase_limit : float + Phase limit. port_names : list[:obj:`str`] + List of port names. clear_entries : bool + Whether to clear entries. """ if clear_entries: self._entry_list.clear() @@ -168,9 +178,13 @@ def set_all_off_diag_constant(self, mag_limit, phase_limit, port_names, clear_en Parameters ---------- mag_limit : float + Magnitude limit. phase_limit : float + Phase limit. port_names : list[:obj:`str`] + List of port names. clear_entries : bool + Whether to clear entries. """ if clear_entries: self._entry_list.clear() @@ -188,14 +202,18 @@ def set_all_off_diag_constant(self, mag_limit, phase_limit, port_names, clear_en self._all_off_diag_constant = True def add_entry(self, port_name_1, port_name_2, mag_limit, phase_limit): - """Add matrix entry. + """Add a matrix entry. Parameters ---------- port_name_1 : str + Name of the first port. port_name_2 : str + Name of the second port. mag_limit : float + Magnitude limit. phase_limit : float + Phase limit. """ new_entry = MatrixConvergenceDataEntry(port_name_1, port_name_2, mag_limit, phase_limit) for idx, entry in enumerate(self._entry_list): @@ -209,7 +227,7 @@ def add_entry(self, port_name_1, port_name_2, mag_limit, phase_limit): class SingleFrequencyAdaptiveSolution: - """Class representing a single frequency adaptive solution. + """Represents a single frequency adaptive solution. Attributes ---------- @@ -273,7 +291,7 @@ def mx_conv_data(self, mx_conv_data): @property def use_mx_conv_data(self): - """:obj:`bool`: Flag enabling usage of matrix convergence data.""" + """:obj:`bool`: Flag indicating whether matrix convergence data is used.""" return self._use_mx_conv_data @use_mx_conv_data.setter @@ -282,7 +300,7 @@ def use_mx_conv_data(self, use_mx_conv_data): class AdaptiveFrequency: - """Class representing an adaptive frequency. + """Represents an adaptive frequency. Attributes ---------- @@ -292,7 +310,7 @@ class AdaptiveFrequency: """ def __init__(self, adaptive_frequency, max_delta="0.02", output_variables=None): - """Class representing adaptive frequency.""" + """Create an adaptive frequency.""" self._adaptive_frequency = adaptive_frequency self._max_delta = max_delta self._output_variables = output_variables if output_variables is not None else {} @@ -317,7 +335,7 @@ def max_delta(self, max_delta): @property def output_variables(self): - """:obj:`dict` { :obj:`str` : :obj:`str` }: Map of output variable name to maximum delta S.""" + """:obj:`dict` { :obj:`str` : :obj:`str` }: Map of output variable names to maximum delta S.""" return self._output_variables @output_variables.setter @@ -326,11 +344,12 @@ def output_variables(self, output_variables): class MultiFrequencyAdaptiveSolution: - """Class representing a multi-frequency adaptive solution. + """Represents a multi-frequency adaptive solution. Attributes ---------- - max_passes: int + max_passes : int + Maximum number of adaptive passes. adaptive_frequencies : list[:class:`AdaptiveFrequency`] """ @@ -346,7 +365,7 @@ def __init__(self, max_passes=10, adaptive_frequencies=None): @property def adaptive_frequencies(self): - """:obj:`list` of :class:`AdaptiveFrequency`: Frequencies adaptive solutions will be calculated for.""" + """:obj:`list` of :class:`AdaptiveFrequency`: Frequencies that adaptive solutions are calculated for.""" return self._adaptive_frequencies @adaptive_frequencies.setter @@ -364,7 +383,7 @@ def max_passes(self, max_passes): class BroadbandAdaptiveSolution: - """Class representing a broadband adaptive solution. + """Represents a broadband adaptive solution. Attributes ---------- @@ -385,7 +404,7 @@ def __init__( @property def low_frequency(self): - """:obj:`str`: Lower bound adaptive frequency.""" + """:obj:`str`: Lower-bound adaptive frequency.""" return self._low_frequency @low_frequency.setter @@ -394,7 +413,7 @@ def low_frequency(self, low_frequency): @property def high_frequency(self): - """:obj:`str`: Higher bound adaptive frequency.""" + """:obj:`str`: Higher-bound adaptive frequency.""" return self._high_frequency @high_frequency.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 5d2fcf65cc..87d8f420d8 100644 --- a/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/hfss_simulation_settings.py @@ -1,4 +1,4 @@ -"""HFSS Simulation Settings.""" +"""HFSS simulation settings.""" from enum import Enum @@ -26,7 +26,7 @@ class BasisFunctionOrder(Enum): - """Enum representing basis function order types. + """Provides an enum representing basis function order types. - ZERO_ORDER - FIRST_ORDER @@ -41,7 +41,7 @@ class BasisFunctionOrder(Enum): class SolverType(Enum): - """Enum representing hfss solver types. + """Provides an enum representing HFSS solver types. - AUTO_SOLVER - DIRECT_SOLVER @@ -57,7 +57,7 @@ class SolverType(Enum): class AdaptType(Enum): - """Enum representing hfss adaptive solution types. + """Provides an enum representing HFSS adaptive solution types. - SINGLE - MULTI_FREQUENCIES @@ -72,7 +72,7 @@ class AdaptType(Enum): class HFSSSimulationSettings(SimulationSettings): - """Class representing HFSS simulation settings.""" + """Represents HFSS simulation settings.""" @property def general(self): @@ -81,7 +81,7 @@ def general(self): @property def options(self): - """:class:`HFSSSettingsOptions`: HFSS simulation settings options.""" + """:class:`HFSSSettingsOptions`: HFSS simulation setting options.""" return HFSSSettingsOptions(self._sim_setup) @property @@ -106,13 +106,13 @@ def dcr(self): class HFSSGeneralSettings(SimulationSettingsBase): - """Class representing general settings for HFSS simulations.""" + """Represents general settings for HFSS simulations.""" __stub: HFSSGeneralSettingsServiceStub = StubAccessor(StubType.hfss_general_sim_settings) @property def single_frequency_adaptive_solution(self): - """:class:`SingleFrequencyAdaptiveSolution`: Single frequency adaptive solution settings.""" + """:class:`SingleFrequencyAdaptiveSolution`: Settings for a single frequency adaptive solution.""" return parser.to_single_frequency_adaptive_solution( self.__stub.GetSingleFrequencyAdaptiveSolution(self.msg) ) @@ -130,7 +130,7 @@ def single_frequency_adaptive_solution(self, single_frequency_adaptive_solution) @property def multi_frequency_adaptive_solution(self): - """:class:`MultiFrequencyAdaptiveSolution`: Multi-frequency adaptive solution settings.""" + """:class:`MultiFrequencyAdaptiveSolution`: Settings for a multi-frequency adaptive solution.""" return parser.to_multi_frequency_adaptive_solution( self.__stub.GetMultiFrequencyAdaptiveSolution(self.msg) ) @@ -148,7 +148,7 @@ def multi_frequency_adaptive_solution(self, multi_frequency_adaptive_solution): @property def broadband_adaptive_solution(self): - """:class:`BroadbandAdaptiveSolution`: Broadband adaptive solution settings.""" + """:class:`BroadbandAdaptiveSolution`: Settings for a broadband adaptive solution.""" return parser.to_broadband_adaptive_solution( self.__stub.GetBroadbandFrequencyAdaptiveSolution(self.msg) ) @@ -164,7 +164,7 @@ def broadband_adaptive_solution(self, broadband_adaptive_solution): @property def adaptive_solution_type(self): - """:class:`AdaptType`: Adaptive solution type that is currently set for the simulation.""" + """:class:`AdaptType`: Adaptive solution type that is set for the simulation.""" return AdaptType(self.__stub.GetAdaptType(self.msg).adapt_type) @adaptive_solution_type.setter @@ -175,7 +175,7 @@ def adaptive_solution_type(self, adaptive_solution_type): @property def save_fields(self): - """:obj:`bool`: Flag indicating whether or not to save fields data during simulation.""" + """:obj:`bool`: Flag indicating if field data is to be saved during the simulation.""" return self.__stub.GetSaveFieldsFlag(self.msg).value @save_fields.setter @@ -184,7 +184,7 @@ def save_fields(self, save_fields): @property def save_rad_fields_only(self): - """:obj:`bool`: Flag indicating whether or not to only save radiated fields data during simulation.""" + """:obj:`bool`: Flag indicating if only radiated field data is to be saved during the simulation.""" return self.__stub.GetSaveRadFieldsOnlyFlag(self.msg).value @save_rad_fields_only.setter @@ -195,7 +195,7 @@ def save_rad_fields_only(self, save_rad_fields_only): @property def use_mesh_region(self): - """:obj:`bool`: Flag indicating whether or not to use mesh regions.""" + """:obj:`bool`: Flag indicating if mesh regions are used.""" return self.__stub.GetUseMeshRegion(self.msg).value @use_mesh_region.setter @@ -204,7 +204,7 @@ def use_mesh_region(self, use_mesh_region): @property def mesh_region_name(self): - """:obj:`str`: Name of mesh region to be used.""" + """:obj:`str`: Name of the mesh region to use.""" return self.__stub.GetMeshRegionName(self.msg).value @mesh_region_name.setter @@ -213,7 +213,7 @@ def mesh_region_name(self, mesh_region_name): @property def use_parallel_refinement(self): - """:obj:`bool`: Flag indicating whether or not to use parallel refinement.""" + """:obj:`bool`: Flag indicating if parallel refinement is used.""" return self.__stub.GetUseParallelRefinement(self.msg).value @use_parallel_refinement.setter @@ -224,13 +224,13 @@ def use_parallel_refinement(self, use_parallel_refinement): class HFSSSettingsOptions(SettingsOptions): - """Class representing HFSS simulation settings options.""" + """Represents options for HFSS simulation settings.""" __stub: HFSSOptionsSettingsServiceStub = StubAccessor(StubType.hfss_options_sim_settings) @property def use_max_refinement(self): - """:obj:`bool`: Flag indicating whether or not to use max refinement values during simulation.""" + """:obj:`bool`: Flag indicating if maximum refinement values are used during simulation.""" return self.__stub.GetUseMaxRefinement(self.msg).value @use_max_refinement.setter @@ -239,7 +239,7 @@ def use_max_refinement(self, use_max_refinement): @property def max_refinement_per_pass(self): - """:obj:`int`: Max mesh refinement per adaptive pass.""" + """:obj:`int`: Maximum mesh refinement per adaptive pass.""" return self.__stub.GetMaxRefinementPerPass(self.msg).value @max_refinement_per_pass.setter @@ -294,7 +294,7 @@ def solver_type(self, solver_type): @property def relative_residual(self): - """:class:`float`: Relative residual value used by hfss iterative solver.""" + """:class:`float`: Relative residual value that the HFSS iterative solver is to use.""" return self.__stub.GetRelativeResidual(self.msg).value @relative_residual.setter @@ -303,7 +303,7 @@ def relative_residual(self, relative_residual): @property def enhanced_low_frequency_accuracy(self): - """:obj:`bool`: Flag indicating whether or not to enable enhanced low frequency accuracy during simulation.""" + """:obj:`bool`: Flag indicating if enhanced low-frequency accuracy is enabled during simulation.""" return self.__stub.GetEnhancedLowFrequencyAccuracy(self.msg).value @enhanced_low_frequency_accuracy.setter @@ -314,7 +314,7 @@ def enhanced_low_frequency_accuracy(self, enhanced_low_frequency_accuracy): class HFSSSolverSettings(SolverSettings): - """Class representing solver settings for HFSS simulations.""" + """Representis solver settings for HFSS simulations.""" __stub: HFSSSolverSettingsServiceStub = StubAccessor(StubType.hfss_solver_sim_settings) @@ -329,7 +329,7 @@ def max_delta_z0(self, max_delta_z0): @property def set_triangles_for_wave_port(self): - """:obj:`bool`: Flag indicating whether or not to use min/max triangle values for waveports.""" + """:obj:`bool`: Flag indicating ifthe minimum and maximum triangle values for waveports are used.""" return self.__stub.GetSetTrianglesForWaveport(self.msg).value @set_triangles_for_wave_port.setter @@ -340,7 +340,7 @@ def set_triangles_for_wave_port(self, set_triangles_for_wave_port): @property def min_triangles_for_wave_port(self): - """:obj:`int`: Minimum number of triangles used for meshing waveports.""" + """:obj:`int`: Minimum number of triangles to use for meshing waveports.""" return self.__stub.GetMinTrianglesForWavePort(self.msg).value @min_triangles_for_wave_port.setter @@ -351,7 +351,7 @@ def min_triangles_for_wave_port(self, min_triangles_for_wave_port): @property def max_triangles_for_wave_port(self): - """:obj:`int`: Maximum number of triangles used for meshing waveports.""" + """:obj:`int`: Maximum number of triangles to use for meshing waveports.""" return self.__stub.GetMaxTrianglesForWavePort(self.msg).value @max_triangles_for_wave_port.setter @@ -362,7 +362,7 @@ def max_triangles_for_wave_port(self, max_triangles_for_wave_port): @property def enable_intra_plane_coupling(self): - """:obj:`bool`: Enable intra-plane coupling of pwr/gnd nets for enhanced accuracy.""" + """:obj:`bool`: Flag indicating if intra-plane coupling of power/ground nets is enabled to enhance accuracy.""" return self.__stub.GetIntraPlaneCouplingEnabled(self.msg).value @enable_intra_plane_coupling.setter @@ -373,13 +373,13 @@ def enable_intra_plane_coupling(self, enable_intra_plane_coupling): class HFSSAdvancedSettings(AdvancedSettings): - """Class representing advanced settings for HFSS simulations.""" + """Represents advanced settings for HFSS simulations.""" __stub: HFSSAdvancedSettingsServiceStub = StubAccessor(StubType.hfss_advanced_sim_settings) @property def ic_mode_auto_resolution(self): - """:obj:`bool`: Flag indicating whether or not to auto calculate model resolution for IC designs.""" + """:obj:`bool`: Flag indicating if model resolution is automatically calculated for IC designs.""" return self.__stub.GetICModeAutoResolution(self.msg).value @ic_mode_auto_resolution.setter @@ -390,7 +390,7 @@ def ic_mode_auto_resolution(self, ic_mode_auto_resolution): @property def ic_mode_length(self): - """:obj:`str`: Model resolution used when manually settings model resolution of IC designs.""" + """:obj:`str`: Model resolution to use when manually setting the model resolution of IC designs.""" return self.__stub.GetICModeLength(self.msg).value @ic_mode_length.setter @@ -399,7 +399,7 @@ def ic_mode_length(self, ic_mode_length): class HFSSAdvancedMeshingSettings(AdvancedMeshingSettings): - """Class representing advanced meshing settings for HFSS simulations.""" + """Represents advanced meshing settings for HFSS simulations.""" __stub: HFSSAdvancedMeshingSettingsServiceStub = StubAccessor( StubType.hfss_advanced_sim_meshing_settings @@ -409,7 +409,7 @@ class HFSSAdvancedMeshingSettings(AdvancedMeshingSettings): def layer_snap_tol(self): """:obj:`str`: Snapping tolerance for hierarchical layer alignment. - Unitless values represent fraction of total stackup height + Unitless values represent a fraction of the total stackup height. """ return self.__stub.GetLayerAlignment(self.msg).value @@ -419,7 +419,7 @@ def layer_snap_tol(self, layer_snap_tol): class HFSSDCRSettings(SimulationSettingsBase): - """Class representing DCR settings for HFSS simulations.""" + """Represents DCR settings for HFSS simulations.""" __stub: DCRSettingsServiceStub = StubAccessor(StubType.hfss_dcr_sim_settings) @@ -461,7 +461,7 @@ def percent_error(self, percent_error): @property def percent_refinement_per_pass(self): - """:obj:`float`: Mesh refinement percent per conduction adaptive pass.""" + """:obj:`float`: Mesh refinement percentage per conduction adaptive pass.""" return self.__stub.GetPercentRefinementPerPass(self.msg).value @percent_refinement_per_pass.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 f8872aa52d..95ad465a72 100644 --- a/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/hfss_simulation_setup.py @@ -1,4 +1,4 @@ -"""HFSS Simulation Setup.""" +"""HFSS simulation setup.""" import ansys.api.edb.v1.hfss_simulation_setup_pb2 as pb @@ -10,31 +10,31 @@ class HfssSimulationSetup(SimulationSetup): - """Class representing hfss simulation setup data.""" + """Represents HFSS simulation setup data.""" __stub: HfssSimulationSetupServiceStub = StubAccessor(StubType.hfss_sim_setup) @classmethod def create(cls, cell, name): - """Create a HfssSimulationSetup. + """Create an HFSS simulation setup. Parameters ---------- cell : :class:`Cell ` - Cell containing new simulation setup. + Cell to create the simulation setup in. name : str - Name of new simulation setup + Name of the simulation setup. Returns ------- HfssSimulationSetup - Newly created simulation setup. + HFSS simulation setup created. """ return super()._create(cell, name, SimulationSetupType.HFSS) @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/mesh_operation.py b/src/ansys/edb/core/simulation_setup/mesh_operation.py index fb107eaf3c..89dcdb8962 100644 --- a/src/ansys/edb/core/simulation_setup/mesh_operation.py +++ b/src/ansys/edb/core/simulation_setup/mesh_operation.py @@ -1,20 +1,21 @@ -"""Mesh Operation.""" +"""Mesh operation.""" class MeshOperation: - """Class representing mesh operations. + """Represents mesh operations. Attributes ---------- - name : str - Name of the operation. - net_layer_info : list[tuple(str, str, bool)] - Each entry has net name, layer name, and isSheet which is True if it is a sheet object. - enabled : bool - True if mesh operation is enabled. - refine_inside : bool - True if should refine inside. - mesh_region : str + name : str, default: "" + Name of the mesh operation. The default is ``""``, in which case a name is automatically assigned. + net_layer_info : list[tuple(str, str, bool)], default: None + List with each entry having a net name, layer name, and ``isSheet`` flag indicating + if the entry is a sheet. + enabled : bool, default: True + Whether the mesh operation is enabled. + refine_inside : bool, default: False + Whether to refine inside. + mesh_region : str, default: "" Mesh region. """ @@ -26,7 +27,7 @@ def __init__( refine_inside=False, mesh_region="", ): - """Create a MeshOperation.""" + """Create a mesh operation.""" self._name = name self._net_layer_info = [] if net_layer_info is None else net_layer_info self._enabled = enabled @@ -35,7 +36,7 @@ def __init__( @property def name(self): - """:obj:`str`: Mesh operation name.""" + """:obj:`str`: Name of the mesh operation.""" return self._name @name.setter @@ -44,9 +45,10 @@ def name(self, name): @property def net_layer_info(self): - """:obj:`list` of :obj:`tuple` of (:obj:`str`, :obj:`str`, :obj:`bool`): List of mesh op net layer info. + """:obj:`list` of :obj:`tuple` of (:obj:`str`, :obj:`str`, :obj:`bool`): List of net layer \ + information for the mesh operation. - tuple is of the form (net_name, layer_name, is_sheet) + The tuple is in this form: (net_name, layer_name, is_sheet)``. """ return self._net_layer_info @@ -56,7 +58,7 @@ def net_layer_info(self, net_layer_info): @property def enabled(self): - """:obj:`bool`: Flag for enabling the mesh operation.""" + """:obj:`bool`: Flag indicating if the mesh operation is enabled.""" return self._enabled @enabled.setter @@ -65,7 +67,7 @@ def enabled(self, enabled): @property def refine_inside(self): - """:obj:`bool`: Flag for enabling refine inside.""" + """:obj:`bool`: Flag indicating if refining inside is enabled.""" return self._refine_inside @refine_inside.setter @@ -74,7 +76,7 @@ def refine_inside(self, refine_inside): @property def mesh_region(self): - """:obj:`str`: Name of mesh region.""" + """:obj:`str`: Name of the mesh region.""" return self._mesh_region @mesh_region.setter @@ -83,30 +85,31 @@ def mesh_region(self, mesh_region): class SkinDepthMeshOperation(MeshOperation): - """Class representing skin depth mesh op. + """Represents a skin depth mesh operation. Attributes ---------- - name : str - Name of the operation. - net_layer_info : list[tuple[str, str, bool]] - Each entry has net name, layer name, and isSheet which is True if it is a sheet object. - enabled : bool - True if mesh operation is enabled. - refine_inside : bool - True if should refine inside. - mesh_region : str + name : str, default: "" + Name of the mesh operation. The default is ``""``, in which case a name is automatically assigned. + net_layer_info : list[tuple(str, str, bool)], default: None + List with each entry having a net name, layer name, and ``isSheet`` flag indicating + if the entry is a sheet. + enabled : bool, default: True + Whether the mesh operation is enabled. + refine_inside : bool, default: False + Whether to refine inside. + mesh_region : str, default: "" Mesh region. - skin_depth : str - Skin depth (number with optional length units). - surface_triangle_length : str - Surface triangle length (number with optional length units). - num_layers : str - Number of layers (integer). - max_elements : str - Maximum number of elements (integer). - restrict_max_elements : bool - True if we restrict the number of elements. + skin_depth : str, default: "1um" + Skin depth.`. + surface_triangle_length : str, default: "1mm" + Surface triangle length with units. + num_layers : str, default: 2 + Number of layers. + max_elements : str, default: "1000" + Maximum number of elements. + restrict_max_elements : bool, default: False + Whether to restrict the number of elements. """ def __init__( @@ -122,7 +125,7 @@ def __init__( max_elements="1000", restrict_max_elements=False, ): - """Create a SkinDepthMeshOperation.""" + """Create a skin depth mesh operation.""" super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region) self._skin_depth = skin_depth self._surface_triangle_length = surface_triangle_length @@ -168,7 +171,7 @@ def max_elements(self, max_elements): @property def restrict_max_elements(self): - """:obj:`bool`: Flag to restrict the maximum number of mesh elements.""" + """:obj:`bool`: Flag indicating if the maximum number of mesh elements is restricted.""" return self._restrict_max_elements @restrict_max_elements.setter @@ -177,28 +180,29 @@ def restrict_max_elements(self, restrict_max_elements): class LengthMeshOperation(MeshOperation): - """Class representing skin depth mesh op. + """Represents a length mesh operation. Attributes ---------- - name : str - Name of the operation. - net_layer_info : list[tuple(str, str, bool)] - Each entry has net name, layer name, and isSheet which is True if it is a sheet object. - enabled : bool - True if mesh operation is enabled. - refine_inside : bool - True if should refine inside. - mesh_region : str + name : str, default: "" + Name of the mesh operation. The default is ``""``, in which case a name is automatically assigned. + net_layer_info : list[tuple(str, str, bool)], default: None + List with each entry having a net name, layer name, and ``isSheet`` flag indicating + if the entry is a sheet. + enabled : bool, default: True + Whether the mesh operation is enabled. + refine_inside : bool, default: False + Whether to refine inside. + mesh_region : str, default: "" Mesh region. - max_length : str - maximum length of mesh elements (number with optional length units). - restrict_max_length : str - True if we restrict length of mesh elements (number with optional length units). - max_elements : str - Number of layers (integer). - restrict_max_elements : bool - True if we restrict the number of elements. + max_length : str, default: "1mm" + maximum length of the mesh elements. + restrict_max_length : str, default: True + Whether to restrict the length of the mesh elements. + max_elements : str, default: "1000" + Number of layers. + restrict_max_elements : bool, default: False + Whether to restrict the number of elements. """ def __init__( @@ -213,7 +217,7 @@ def __init__( max_elements="1000", restrict_max_elements=False, ): - """Class representing skin depth mesh op.""" + """Initialize an instance of a skin depth mesh operation.""" super().__init__(name, net_layer_info, enabled, refine_inside, mesh_region) self._max_length = max_length self._restrict_max_length = restrict_max_length @@ -222,7 +226,7 @@ def __init__( @property def max_length(self): - """:obj:`str`: Maximum length of mesh elements.""" + """:obj:`str`: Maximum length of the mesh elements.""" return self._max_length @max_length.setter @@ -231,7 +235,7 @@ def max_length(self, max_length): @property def restrict_max_length(self): - """:obj:`bool`: Flag to restrict the maximum length of mesh elements.""" + """:obj:`bool`: Flag indicating if the maximum length of mesh elements is restricted.""" return self._restrict_max_length @restrict_max_length.setter @@ -249,7 +253,7 @@ def max_elements(self, max_elements): @property def restrict_max_elements(self): - """:obj:`bool`: Flag to restrict the maximum number of mesh elements.""" + """:obj:`bool`: Flag indicating if the maximum number of mesh elements is restricted.""" return self._restrict_max_elements @restrict_max_elements.setter 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 511614bc3b..42a0a9a63d 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 @@ -1,4 +1,4 @@ -"""RaptorX Simulation Settings.""" +"""RaptorX simulation settings.""" import ansys.api.edb.v1.raptor_x_simulation_settings_pb2 as pb @@ -38,7 +38,7 @@ def _to_raptor_x_sim_settings_options_property_msg(obj, options): class RaptorXSimulationSettings(SimulationSettings): - """Class representing SIWave simulation settings.""" + """Represents SIWave simulation settings.""" @property def general(self): @@ -52,13 +52,14 @@ def advanced(self): class RaptorXGeneralSettings(SimulationSettingsBase): - """Class representing general settings for RaptorX simulations.""" + """Represents general settings for RaptorX simulations.""" __stub: RaptorXGeneralSettingsServiceStub = StubAccessor(StubType.raptor_x_general_sim_settings) @property def use_gold_em_solver(self): - """:obj:`bool`: Flag indicating whether to use the gold em or fast em solver.""" + """:obj:`bool`: Flag indicating if the gold em solver is used. If ``False``, \ + the fast em solver is used.""" return self.__stub.GetUseGoldEMSolver(self.msg).value @use_gold_em_solver.setter @@ -67,7 +68,7 @@ def use_gold_em_solver(self, use_gold_em_solver): @property def max_frequency(self): - """:obj:`str`: Max frequency value. Controls how tight the model mesh will be.""" + """:obj:`str`: Maximum frequency value, which controls the tightness of the model mesh.""" return self.__stub.GetMaxFrequency(self.msg).value @max_frequency.setter @@ -76,7 +77,7 @@ def max_frequency(self, max_frequency): @property def global_temperature(self): - """:obj:`float`: Simulation temperature in degrees celsius.""" + """:obj:`float`: Simulation temperature in degrees Celsius.""" return self.__stub.GetGlobalTemperature(self.msg).value @global_temperature.setter @@ -85,7 +86,7 @@ def global_temperature(self, global_temperature): @property def save_netlist(self): - """:obj:`bool`: Flag indicating whether to generate netlist output.""" + """:obj:`bool`: Flag indicating if the netlist output is saved.""" return self.__stub.GetSaveNetlist(self.msg).value @save_netlist.setter @@ -94,7 +95,7 @@ def save_netlist(self, save_netlist): @property def netlist_export_spectre(self): - """:obj:`bool`: Flag indicating whether to export the netlist in spectre format.""" + """:obj:`bool`: Flag indicating if the netlist is exported in Spectre format.""" return self.__stub.GetNetlistExportSpectre(self.msg).value @netlist_export_spectre.setter @@ -105,7 +106,7 @@ def netlist_export_spectre(self, netlist_export_spectre): @property def save_rfm(self): - """:obj:`bool`: Flag indicating whether to export the RFM file.""" + """:obj:`bool`: Flag indicating if an RFM file is exported.""" return self.__stub.GetSaveRFM(self.msg).value @save_rfm.setter @@ -114,13 +115,13 @@ def save_rfm(self, save_rfm): class RaptorXAdvancedSettings(SimulationSettingsBase): - """Class representing advanced settings for RaptorX simulations.""" + """Represents advanced settings for RaptorX simulations.""" __stub: RaptorXAdvancedSettingsServiceStub = StubAccessor(StubType.raptor_x_adv_sim_settings) @property def use_mesh_frequency(self): - """:obj:`bool`: Flag indicating whether to override the default meshing frequency.""" + """:obj:`bool`: Flag indicating if the default meshing frequency is overridden.""" return self.__stub.GetUseMeshFrequency(self.msg).value @use_mesh_frequency.setter @@ -138,7 +139,7 @@ def mesh_frequency(self, mesh_frequency): @property def use_edge_mesh(self): - """:obj:`bool`: Flag indicating whether to use edge mesh.""" + """:obj:`bool`: Flag indicating if the edge mesh is used.""" return self.__stub.GetUseEdgeMesh(self.msg).value @use_edge_mesh.setter @@ -147,7 +148,7 @@ def use_edge_mesh(self, use_edge_mesh): @property def edge_mesh(self): - """:obj:`str`: The thickness and the width of the exterior conductor filament.""" + """:obj:`str`: Thickness and width of the exterior conductor filament.""" return self.__stub.GetEdgeMesh(self.msg).value @edge_mesh.setter @@ -156,7 +157,7 @@ def edge_mesh(self, edge_mesh): @property def use_cells_per_wavelength(self): - """:obj:`bool`: Flag indicating whether to use cells per wavelength.""" + """:obj:`bool`: Flag indicating if cells per wavelength are used.""" return self.__stub.GetUseCellsPerWavelength(self.msg).value @use_cells_per_wavelength.setter @@ -176,7 +177,7 @@ def cells_per_wavelength(self, cells_per_wavelength): @property def use_plane_projection_factor(self): - """:obj:`bool`: Flag indicating whether to use plane projection factor.""" + """:obj:`bool`: Flag indicating if the plane projection factor is used.""" return self.__stub.GetUsePlaneProjectionFactor(self.msg).value @use_plane_projection_factor.setter @@ -187,7 +188,7 @@ def use_plane_projection_factor(self, use_plane_projection_factor): @property def plane_projection_factor(self): - """:obj:`float`: Plane projection factor used to reduce mesh complexity of large metal planes.""" + """:obj:`float`: Plane projection factor for reducing the mesh complexity of large metal planes.""" return self.__stub.GetPlaneProjectionFactor(self.msg).value @plane_projection_factor.setter @@ -198,7 +199,7 @@ def plane_projection_factor(self, plane_projection_factor): @property def use_relaxed_z_axis(self): - """:obj:`bool`: Flag indicating whether to use simplified meshing along the z-axis.""" + """:obj:`bool`: Flag indicating if simplified meshing is used along the z axis.""" return self.__stub.GetUseRelaxedZAxis(self.msg).value @use_relaxed_z_axis.setter @@ -207,7 +208,7 @@ def use_relaxed_z_axis(self, use_relaxed_z_axis): @property def use_eliminate_slit_per_holes(self): - """:obj:`bool`: Flag indicating whether to remove strain relief or thermal relief slits and holes.""" + """:obj:`bool`: Flag indicating if strain relief or thermal relief slits and holes are removed.""" return self.__stub.GetUseEliminateSlitPerHoles(self.msg).value @use_eliminate_slit_per_holes.setter @@ -218,7 +219,7 @@ def use_eliminate_slit_per_holes(self, use_eliminate_slit_per_holes): @property def eliminate_slit_per_holes(self): - """:obj:`float`: Threshold for strain or thermal relief slits and holes polygon areas.""" + """:obj:`float`: Threshold for strain or thermal relief slits and hole polygon areas.""" return self.__stub.GetEliminateSlitPerHoles(self.msg).value @eliminate_slit_per_holes.setter @@ -229,7 +230,7 @@ def eliminate_slit_per_holes(self, eliminate_slit_per_holes): @property def use_arc_resolution(self): - """:obj:`bool`: Flag indicating whether to approximate arcs with polygons.""" + """:obj:`bool`: Flag indicating if arcs with polygons are approximated.""" return self.__stub.GetUseArcResolution(self.msg).value @use_arc_resolution.setter @@ -247,7 +248,7 @@ def arc_resolution(self, arc_resolution): @property def use_auto_removal_sliver_poly(self): - """:obj:`bool`: Flag indicating whether to automatically align slight misaligned overlapping polygons.""" + """:obj:`bool`: Flag indicating if slight misaligned overlapping polygons are to be automatically aligned.""" return self.__stub.GetUseAutoRemovalSliverPoly(self.msg).value @use_auto_removal_sliver_poly.setter @@ -269,7 +270,7 @@ def auto_removal_sliver_poly(self, auto_removal_sliver_poly): @property def use_accelerate_via_extraction(self): - """:obj:`bool`: Flag indicating whether to simplify/merge neighboring vias.""" + """:obj:`bool`: Flag indicating if neighboring vias are simplified/merged.""" return self.__stub.GetUseAccelerateViaExtraction(self.msg).value @use_accelerate_via_extraction.setter @@ -280,7 +281,8 @@ def use_accelerate_via_extraction(self, use_accelerate_via_extraction): @property def use_enable_substrate_network_extraction(self): - """:obj:`bool`: Enables modeling of substrate coupling effects using equivalent distributed RC networks.""" + """:obj:`bool`: Flag indicating if modeling of substrate coupling effects \ + is enabled using equivalent distributed RC networks.""" return self.__stub.GetUseEnableSubstrateNetworkExtraction(self.msg).value @use_enable_substrate_network_extraction.setter @@ -291,7 +293,7 @@ def use_enable_substrate_network_extraction(self, use_enable_substrate_network_e @property def use_lde(self): - """:obj:`bool`: Flag indicating whether to take variations in resistivity into account.""" + """:obj:`bool`: Flag indicating if variations in resistivity are taken into account.""" return self.__stub.GetUseLDE(self.msg).value @use_lde.setter @@ -300,7 +302,7 @@ def use_lde(self, use_lde): @property def use_extract_floating_metals_dummy(self): - """:obj:`bool`: Flag indicating whether to model floating metals as dummy fills.""" + """:obj:`bool`: Flag indicating if floating metals are modeled as dummy fills.""" return self.__stub.GetUseExtractFloatingMetalsDummy(self.msg).value @use_extract_floating_metals_dummy.setter @@ -311,7 +313,7 @@ def use_extract_floating_metals_dummy(self, use_extract_floating_metals_dummy): @property def use_extract_floating_metals_floating(self): - """:obj:`bool`: Flag indicating whether to model floating metals as floating nets.""" + """:obj:`bool`: Flag indicating if floating metals are modeled as floating nets.""" return self.__stub.GetUseExtractFloatingMetalsFloating(self.msg).value @use_extract_floating_metals_floating.setter @@ -322,7 +324,7 @@ def use_extract_floating_metals_floating(self, use_extract_floating_metals_float @property def use_enable_etch_transform(self): - """:obj:`bool`: Flag indicating whether to "pre-distort" the layout based on foundry rules.""" + """:obj:`bool`: Flag indicating if layout is "pre-distorted" based on foundry rules.""" return self.__stub.GetUseEnableEtchTransform(self.msg).value @use_enable_etch_transform.setter @@ -333,7 +335,8 @@ def use_enable_etch_transform(self, use_enable_etch_transform): @property def use_enable_hybrid_extraction(self): - """:obj:`bool`: Allows modeler to split the layout into two parts in an attempt to decrease the complexity.""" + """:obj:`bool`: Flag indicating if the modeler is to split the layout into \ + two parts in an attempt to decrease the complexity.""" return self.__stub.GetUseEnableHybridExtraction(self.msg).value @use_enable_hybrid_extraction.setter @@ -344,7 +347,7 @@ def use_enable_hybrid_extraction(self, use_enable_hybrid_extraction): @property def use_enable_advanced_cap_effects(self): - """:obj:`bool`: Flag indicating whether to apply capacitance related effects such as conformal dielectrics.""" + """:obj:`bool`: Flag indicating if capacitance-related effects such as conformal dielectrics are applied.""" return self.__stub.GetUseEnableAdvancedCapEffects(self.msg).value @use_enable_advanced_cap_effects.setter @@ -355,7 +358,7 @@ def use_enable_advanced_cap_effects(self, use_enable_advanced_cap_effects): @property def use_override_shrink_factor(self): - """:obj:`bool`: Flag indicating whether to override shrink factor.""" + """:obj:`bool`: Flag indicating if shrink factor is overridden.""" return self.__stub.GetUseOverrideShrinkFac(self.msg).value @use_override_shrink_factor.setter @@ -388,7 +391,7 @@ def advanced_options(self, advanced_options): @property def net_settings_options(self): - """:obj:`dict` { :obj:`str` : :obj:`list`[:obj:`str`] }: Net settings options.""" + """:obj:`dict` { :obj:`str` : :obj:`list`[:obj:`str`] }: Options for net settings.""" return _to_options_dict(self.__stub.GetNetSettingsOptions(self.msg)) @net_settings_options.setter 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 adf2cdb0ef..40d9607677 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 @@ -1,27 +1,27 @@ -"""RaptorX Simulation Setup.""" +"""RaptorX simulation setup.""" from ansys.edb.core.simulation_setup.raptor_x_simulation_settings import RaptorXSimulationSettings from ansys.edb.core.simulation_setup.simulation_setup import SimulationSetup, SimulationSetupType class RaptorXSimulationSetup(SimulationSetup): - """Class representing RaptorX simulation setup data.""" + """Represents RaptorX simulation setup data.""" @classmethod def create(cls, cell, name): - """Create a RaptorXSimulationSetup. + """Create a RaptorX simulation setup. Parameters ---------- cell : :class:`Cell ` - Cell containing new simulation setup. + Cell to create the simulation setup in. name : str - Name of new simulation setup + Name of the simulation setup. Returns ------- RaptorXSimulationSetup - Newly created simulation setup. + RaptorX simulation setup created. """ return super()._create(cell, name, SimulationSetupType.RAPTOR_X) diff --git a/src/ansys/edb/core/simulation_setup/simulation_settings.py b/src/ansys/edb/core/simulation_setup/simulation_settings.py index a33ad28e5f..9fd526ee2e 100644 --- a/src/ansys/edb/core/simulation_setup/simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/simulation_settings.py @@ -41,9 +41,9 @@ def __init__(self, sim_setup): @property def msg(self): - """:obj:`EDBObjMessage` : Protobuf message that represents this object's ID. + """:obj:`EDBObjMessage`: Protobuf message that represents this object's ID. - Read-Only. + This property is read-only. """ return self._sim_setup.msg @@ -55,7 +55,7 @@ class SimulationSettings(SimulationSettingsBase): @property def enabled(self): - """:obj:`bool`: Flag indicating if this simulation setup is enabled.""" + """:obj:`bool`: Flag indicating if the simulation setup is enabled.""" return self.__stub.GetEnabled(self.msg).value @enabled.setter @@ -70,7 +70,7 @@ class SettingsOptions(SimulationSettingsBase): @property def do_lamda_refine(self): - """:obj:`bool`: Flag indicating indicating whether or not lambda refinement will be used during meshing.""" + """:obj:`bool`: Flag indicating if lambda refinement is used during meshing.""" return self.__stub.GetDoLamdaRefineFlag(self.msg).value @do_lamda_refine.setter @@ -88,7 +88,7 @@ def lamda_target(self, lamda_target): @property def use_default_lamda_value(self): - """:obj:`bool`: Flag indicating indicating whether or not to use default lambda target value.""" + """:obj:`bool`: Flag indicating if the default lambda target value is used.""" return self.__stub.GetLamdaTarget(self.msg).value @use_default_lamda_value.setter @@ -103,7 +103,7 @@ class AdvancedSettings(SimulationSettingsBase): @property def union_polygons(self): - """:obj:`bool`: Flag indicating whether or not to union polygons before meshing.""" + """:obj:`bool`: Flag indicating if polygons are unioned before meshing.""" return self.__stub.GetUnionPolygons(self.msg).value @union_polygons.setter @@ -112,7 +112,7 @@ def union_polygons(self, union_polygons): @property def use_defeature(self): - """:obj:`bool`: Flag indicating whether or to perform polygon defeaturing.""" + """:obj:`bool`: Flag indicating if polygon defeaturing is performed.""" return self.__stub.GetUseDefeature(self.msg).value @use_defeature.setter @@ -121,7 +121,7 @@ def use_defeature(self, use_defeature): @property def use_defeature_absolute_length(self): - """:obj:`bool`: Flag for whether or not to use absolute length or extent ratio when defeaturing polygons.""" + """:obj:`bool`: Flag indicating if absolute length or extent ratio is used when defeaturing polygons.""" return self.__stub.GetUseDefeatureAbsoluteLength(self.msg).value @use_defeature_absolute_length.setter @@ -132,7 +132,7 @@ def use_defeature_absolute_length(self, use_defeature_absolute_length): @property def remove_floating_geometry(self): - """:obj:`bool`: Flag indicating whether or not to remove geometry not connected to any other geometry.""" + """:obj:`bool`: Flag indicating if a geometry not connected to any other geometry is removed.""" return self.__stub.GetRemoveFloatingGeometry(self.msg).value @remove_floating_geometry.setter @@ -163,7 +163,7 @@ def defeature_ratio(self, defeature_ratio): @property def small_void_area(self): - """:obj:`float`: Voids with an area smaller than this value will be ignored during simulation.""" + """:obj:`float`: Voids with an area smaller than this value are ignored during simulation.""" return self.__stub.GetSmallVoidArea(self.msg).value @small_void_area.setter @@ -245,7 +245,7 @@ def max_num_arc_points(self, max_num_arc_points): @property def use_arc_chord_error_approx(self): - """:obj:`bool`: Flag indicating whether or not to use arc chord error approximation.""" + """:obj:`bool`: Flag indicating if arc chord error approximation is used.""" return self.__stub.GetUseArcChordErrorApprox(self.msg).value @use_arc_chord_error_approx.setter diff --git a/src/ansys/edb/core/simulation_setup/simulation_setup.py b/src/ansys/edb/core/simulation_setup/simulation_setup.py index 890900bb7a..3918d5a2f4 100644 --- a/src/ansys/edb/core/simulation_setup/simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/simulation_setup.py @@ -42,12 +42,12 @@ class SweepData: End frequency is number with optional frequency units. step : str Step is either frequency with optional frequency units or an integer when a count is needed. - fast_sweep : bool - True if this is a fast sweep. + fast_sweep : bool, default: False + Whether this is a fast sweep. Notes ----- - Here are the choices for the distribution parameter + Here are the choices for the distribution parameter: .. list-table:: Values for distribution parameter :widths: 20 45 25 @@ -123,7 +123,7 @@ def name(self, name): @property def position(self): - """:obj:`int`: Position of simulation in setup order.""" + """:obj:`int`: Position of the simulation in the setup order.""" return self.__stub.GetPosition(self.msg).value @position.setter diff --git a/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_settings.py b/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_settings.py index 1560e2d6de..395e2641c4 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/siwave_dcir_simulation_settings.py @@ -1,4 +1,4 @@ -"""SIWave DCIR Simulation Settings.""" +"""SIWave DCIR simulation settings.""" import ansys.api.edb.v1.siwave_dcir_simulation_settings_pb2 as pb @@ -8,7 +8,7 @@ class SIWaveDCIRSimulationSettings(SIWaveSimulationSettings): - """Class representing SIWave DCIR simulation settings.""" + """Represents SIWave DCIR simulation settings.""" __stub: SIWaveDCIRSimulationSettingsServiceStub = StubAccessor( StubType.siwave_dcir_sim_settings @@ -16,7 +16,7 @@ class SIWaveDCIRSimulationSettings(SIWaveSimulationSettings): @property def icepak_temp_file(self): - """:obj:`bool`: File path to file containing Icepak temperature map to be imported.""" + """:obj:`bool`: Path to the file containing the Icepak temperature map to import.""" return self.__stub.GetIcepakTempFile(self.msg).value @icepak_temp_file.setter @@ -25,9 +25,9 @@ def icepak_temp_file(self, icepak_temp_file): @property def source_terms_to_ground(self): - """:obj:`dict` { :obj:`str` : :obj:`int` }: A dictionary of SourceName, NodeToGround pairs. + """:obj:`dict` { :obj:`str` : :obj:`int` }: Dictionary of ``SourceName, NodeToGround`` pairs. - NodeToGround is one of 0 (unspecified), 1 (negative), 2 (positive) + ``NodeToGround`` options are ``0`` (unspecified), ``1`` (negative), and ``2`` (positive). """ return { source: t_to_g @@ -47,7 +47,7 @@ def source_terms_to_ground(self, source_terms_to_ground): @property def export_dc_thermal_data(self): - """:obj:`bool`: Flag indicating whether to export dc thermal data.""" + """:obj:`bool`: Flag indicating if DC thermal data is exported.""" return self.__stub.GetExportDCThermalData(self.msg).value @export_dc_thermal_data.setter @@ -58,7 +58,7 @@ def export_dc_thermal_data(self, export_dc_thermal_data): @property def import_thermal_data(self): - """:obj:`bool`: Flag indicating whether to import thermal data.""" + """:obj:`bool`: Flag indicating if thermal data is imported.""" return self.__stub.GetImportThermalData(self.msg).value @import_thermal_data.setter @@ -67,7 +67,7 @@ def import_thermal_data(self, import_thermal_data): @property def full_dc_report_path(self): - """:obj:`str`: DC report path.""" + """:obj:`str`: Path to the DC report.""" return self.__stub.GetFullDCReportPath(self.msg).value @full_dc_report_path.setter @@ -76,7 +76,7 @@ def full_dc_report_path(self, full_dc_report_path): @property def via_report_path(self): - """:obj:`str`: Via report path.""" + """:obj:`str`: Path to the via report.""" return self.__stub.GetViaReportPath(self.msg).value @via_report_path.setter @@ -85,7 +85,7 @@ def via_report_path(self, via_report_path): @property def per_pin_res_path(self): - """:obj:`str`: Per pin res path.""" + """:obj:`str`: Path to the per pin resolution.""" return self.__stub.GetPerPinResPath(self.msg).value @per_pin_res_path.setter @@ -94,7 +94,7 @@ def per_pin_res_path(self, per_pin_res_path): @property def dc_report_config_file(self): - """:obj:`str`: DC report config file.""" + """:obj:`str`: Configuration file for the DC report.""" return self.__stub.GetDCReportConfigFile(self.msg).value @dc_report_config_file.setter @@ -105,7 +105,7 @@ def dc_report_config_file(self, dc_report_config_file): @property def dc_report_show_active_devices(self): - """:obj:`bool`: Flag indicating whether to show active devices in the DC report.""" + """:obj:`bool`: Flag indicating if active devices are shown in the DC report.""" return self.__stub.GetDCReportShowActiveDevices(self.msg).value @dc_report_show_active_devices.setter @@ -116,7 +116,7 @@ def dc_report_show_active_devices(self, dc_report_show_active_devices): @property def per_pin_use_pin_format(self): - """:obj:`bool`: Flag indicating per pin use pin format.""" + """:obj:`bool`: Flag indicating if the per pin uses the pin format.""" return self.__stub.GetPerPinUsePinFormat(self.msg).value @per_pin_use_pin_format.setter @@ -127,7 +127,7 @@ def per_pin_use_pin_format(self, per_pin_use_pin_format): @property def use_loop_res_for_per_pin(self): - """:obj:`bool`: Flag indicating whether to use loop res for per pin.""" + """:obj:`bool`: Flag indicating if the per pin uses the loop resolution.""" return self.__stub.GetUseLoopResForPerPin(self.msg).value @use_loop_res_for_per_pin.setter 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 2ddc858e7c..ccf3c21b21 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 @@ -1,4 +1,4 @@ -"""SIWave Simulation Setup.""" +"""SIWave simulation setup.""" from ansys.edb.core.simulation_setup.simulation_setup import SimulationSetup, SimulationSetupType from ansys.edb.core.simulation_setup.siwave_dcir_simulation_settings import ( @@ -7,27 +7,27 @@ class SIWaveDCIRSimulationSetup(SimulationSetup): - """Class representing SIWave DCIR simulation setup data.""" + """Represents SIWave DCIR simulation setup data.""" @classmethod def create(cls, cell, name): - """Create a SIWaveDCIRSimulationSetup. + """Create a SIWave DCIR simulation setup. Parameters ---------- cell : :class:`Cell ` - Cell containing new simulation setup. + Cell to create the simulation setup in. name : str - Name of new simulation setup + Name of the simulation setup. Returns ------- SIWaveDCIRSimulationSetup - Newly created simulation setup. + Simulation setup created. """ return super()._create(cell, name, SimulationSetupType.SI_WAVE_DCIR) @property def settings(self): - """:class:`SIWaveSimulationSettings`: Simulation settings of the siwave 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 fda5c4ab6c..0b8fe407c2 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py +++ b/src/ansys/edb/core/simulation_setup/siwave_simulation_settings.py @@ -1,4 +1,4 @@ -"""SIWave Simulation Settings.""" +"""SIWave simulation settings.""" from enum import Enum @@ -21,7 +21,7 @@ class SParamInterpolation(Enum): - """Enum representing s parameter interpolation types. + """Provides an enum representing s parameter interpolation types. - POINT_IN - LINEAR_IN @@ -34,7 +34,7 @@ class SParamInterpolation(Enum): class SParamExtrapolation(Enum): - """Enum representing s parameter extrapolation types. + """Provides an enum representing s parameter extrapolation types. - ZERO_EX - SAME_EX @@ -49,7 +49,7 @@ class SParamExtrapolation(Enum): class SParamDCBehavior(Enum): - """Enum representing s parameter dc behavior types. + """Provides an enum representing s parameter DC behavior types. - ZERO_DC - SAME_DC @@ -68,7 +68,7 @@ class SParamDCBehavior(Enum): class SIWaveSimulationSettings(SimulationSettings): - """Class representing SIWave simulation settings.""" + """Represents SIWave simulation settings.""" @property def general(self): @@ -87,7 +87,7 @@ def dc(self): @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 @@ -97,13 +97,13 @@ def s_parameter(self): class SIWaveGeneralSettings(SimulationSettingsBase): - """Class representing general settings for SIWave simulations.""" + """Represents general settings for SIWave simulations.""" __stub: SIWaveGeneralSettingsServiceStub = StubAccessor(StubType.siwave_general_sim_settings) @property def use_si_settings(self): - """:obj:`bool`: Flag indicating whether to use SI or PI settings.""" + """:obj:`bool`: Flag indicating if SI or PI settings are used.""" return self.__stub.GetUseSISettings(self.msg).value @use_si_settings.setter @@ -112,7 +112,7 @@ def use_si_settings(self, use_si_settings): @property def use_custom_settings(self): - """:obj:`bool`: Flag indicating whether to use custom settings rather than PI/SI settings.""" + """:obj:`bool`: Flag indicating if custom settings are used rather than SI or PI settings.""" return self.__stub.GetUseCustomSettings(self.msg).value @use_custom_settings.setter @@ -139,13 +139,13 @@ def pi_slider_pos(self, pi_slider_pos): class SIWaveAdvancedSettings(SimulationSettingsBase): - """Class representing advanced settings for SIWave simulations.""" + """Represents advanced settings for SIWave simulations.""" __stub: SIWaveAdvancedSettingsServiceStub = StubAccessor(StubType.siwave_advanced_sim_settings) @property def include_co_plane_coupling(self): - """:obj:`bool`: Flag indicating whether to include co-plane coupling.""" + """:obj:`bool`: Flag indicating if the co-plane coupling is included.""" return self.__stub.GetIncludeCoPlaneCoupling(self.msg).value @include_co_plane_coupling.setter @@ -156,7 +156,7 @@ def include_co_plane_coupling(self, include_co_plane_coupling): @property def include_inter_plane_coupling(self): - """:obj:`bool`: Flag indicating whether to include inter-plane coupling.""" + """:obj:`bool`: Flag indicating if the inter-plane coupling is included.""" return self.__stub.GetIncludeInterPlaneCoupling(self.msg).value @include_inter_plane_coupling.setter @@ -167,7 +167,7 @@ def include_inter_plane_coupling(self, include_inter_plane_coupling): @property def include_split_plane_coupling(self): - """:obj:`bool`: Flag indicating whether to include split-plane coupling.""" + """:obj:`bool`: Flag indicating if the split-plane coupling is included.""" return self.__stub.GetIncludeSplitPlaneCoupling(self.msg).value @include_split_plane_coupling.setter @@ -178,7 +178,7 @@ def include_split_plane_coupling(self, include_split_plane_coupling): @property def include_fringe_plane_coupling(self): - """:obj:`bool`: Flag indicating whether to include fringe-plane coupling.""" + """:obj:`bool`: Flag indicating if the fringe-plane coupling is included.""" return self.__stub.GetIncludeFringePlaneCoupling(self.msg).value @include_fringe_plane_coupling.setter @@ -189,7 +189,7 @@ def include_fringe_plane_coupling(self, include_fringe_plane_coupling): @property def include_trace_plane_coupling(self): - """:obj:`bool`: Flag indicating whether to include trace-plane coupling.""" + """:obj:`bool`: Flag indicating if the trace-plane coupling is included.""" return self.__stub.GetIncludeTracePlaneCoupling(self.msg).value @include_trace_plane_coupling.setter @@ -262,7 +262,7 @@ def snap_length_threshold(self, snap_length_threshold): @property def mesh_automatic(self): - """:obj:`bool`: Flag indicating whether to automatically determine mesh refinement frequency.""" + """:obj:`bool`: Flag indicating it mesh refinement frequency is automatically determined.""" return self.__stub.GetMeshAutomatic(self.msg).value @mesh_automatic.setter @@ -280,7 +280,7 @@ def mesh_frequency(self, mesh_frequency): @property def return_current_distribution(self): - """:obj:`bool`: Flag indicating whether to trace return current distribution.""" + """:obj:`bool`: Flag indicating if return current distribution is traced.""" return self.__stub.Get3DReturnCurrentDistribution(self.msg).value @return_current_distribution.setter @@ -291,7 +291,7 @@ def return_current_distribution(self, return_current_distribution): @property def include_vi_sources(self): - """:obj:`bool`: Flag indicating whether to include voltage/current source connections/parasitics.""" + """:obj:`bool`: Flag indicating if voltage/current source connections/parasitics are included.""" return self.__stub.GetIncludeVISources(self.msg).value @include_vi_sources.setter @@ -300,7 +300,7 @@ def include_vi_sources(self, include_vi_sources): @property def include_inf_gnd(self): - """:obj:`bool`: Flag indicating whether to include an infinite ground plane.""" + """:obj:`bool`: Flag indicating if an infinite ground plane is included.""" return self.__stub.GetIncludeInfGnd(self.msg).value @include_inf_gnd.setter @@ -318,7 +318,7 @@ def inf_gnd_location(self, inf_gnd_location): @property def perform_erc(self): - """:obj:`bool`: Flag indicating whether to perform ERC during simulation setup.""" + """:obj:`bool`: Flag indicating if ERC is performed during simulation setup.""" return self.__stub.GetPerformERC(self.msg).value @perform_erc.setter @@ -327,7 +327,7 @@ def perform_erc(self, perform_erc): @property def ignore_non_functional_pads(self): - """:obj:`bool`: Flag indicating whether to ignore non-functional pads.""" + """:obj:`bool`: Flag indicating if non-functional pads are ignored.""" return self.__stub.GetIgnoreNonFunctionalPads(self.msg).value @ignore_non_functional_pads.setter @@ -338,13 +338,13 @@ def ignore_non_functional_pads(self, ignore_non_functional_pads): class SIWaveDCSettings(SimulationSettingsBase): - """Class representing dc settings for SIWave simulations.""" + """Represents DC settings for SIWave simulations.""" __stub: SIWaveDCSettingsServiceStub = StubAccessor(StubType.siwave_dc_sim_settings) @property def use_dc_custom_settings(self): - """:obj:`bool`: Flag indicating whether to use custom dc settings.""" + """:obj:`bool`: Flag indicating if custom DC settings are used.""" return self.__stub.GetUseDCCustomSettings(self.msg).value @use_dc_custom_settings.setter @@ -355,7 +355,7 @@ def use_dc_custom_settings(self, use_dc_custom_settings): @property def compute_inductance(self): - """:obj:`bool`: Flag indicating whether to calculate inductance.""" + """:obj:`bool`: Flag indicating if inductance is calculated.""" return self.__stub.GetComputeInductance(self.msg).value @compute_inductance.setter @@ -364,7 +364,7 @@ def compute_inductance(self, compute_inductance): @property def plot_jv(self): - """:obj:`bool`: Flag indicating whether to plot current density and voltage distribution.""" + """:obj:`bool`: Flag indicating if current density and voltage distribution are plotted.""" return self.__stub.GetPlotJV(self.msg).value @plot_jv.setter @@ -391,7 +391,7 @@ def dc_slider_pos(self, dc_slider_pos): class SIWaveDCAdvancedSettings(SimulationSettingsBase): - """Class representing advanced dc settings for SIWave simulations.""" + """Represents advanced DC settings for SIWave simulations.""" __stub: SIWaveDCAdvancedSettingsServiceStub = StubAccessor( StubType.siwave_dc_advanced_sim_settings @@ -399,7 +399,7 @@ class SIWaveDCAdvancedSettings(SimulationSettingsBase): @property def dc_min_plane_area_to_mesh(self): - """:obj:`str`: Geometry with an area smaller than this will be ignored.""" + """:obj:`str`: Geometry with an area smaller than this value is ignored.""" return self.__stub.GetDCMinPlaneAreaToMesh(self.msg).value @dc_min_plane_area_to_mesh.setter @@ -410,7 +410,7 @@ def dc_min_plane_area_to_mesh(self, dc_min_plane_area_to_mesh): @property def dc_min_void_area_to_mesh(self): - """:obj:`str`: Voids with an area smaller than this will be ignored.""" + """:obj:`str`: Voids with an area smaller than this value are ignored.""" return self.__stub.GetDCMinVoidAreaToMesh(self.msg).value @dc_min_void_area_to_mesh.setter @@ -421,7 +421,7 @@ def dc_min_void_area_to_mesh(self, dc_min_void_area_to_mesh): @property def max_init_mesh_edge_length(self): - """:obj:`str`: Initial max edge length.""" + """:obj:`str`: Initial maximum edge length.""" return self.__stub.GetMaxInitMeshEdgeLength(self.msg).value @max_init_mesh_edge_length.setter @@ -432,7 +432,7 @@ def max_init_mesh_edge_length(self, max_init_mesh_edge_length): @property def perform_adaptive_refinement(self): - """:obj:`bool`: Flag indicating whether to perform adaptive refinement.""" + """:obj:`bool`: Flag indicating if adaptive refinement is performed.""" return self.__stub.GetPerformAdaptiveRefinement(self.msg).value @perform_adaptive_refinement.setter @@ -461,7 +461,7 @@ def min_num_passes(self, min_num_passes): @property def percent_local_refinement(self): - """:obj:`int`: Percent local refinement used for adaptive mesh refinement.""" + """:obj:`int`: Percent of local refinement used for adaptive mesh refinement.""" return self.__stub.GetPercentLocalRefinement(self.msg).value @percent_local_refinement.setter @@ -472,7 +472,7 @@ def percent_local_refinement(self, percent_local_refinement): @property def energy_error(self): - """:obj:`float`: Percent energy error used for adaptive mesh refinement.""" + """:obj:`float`: Percent of energy error used for adaptive mesh refinement.""" return self.__stub.GetEnergyError(self.msg).value @energy_error.setter @@ -481,7 +481,7 @@ def energy_error(self, energy_error): @property def mesh_bws(self): - """:obj:`bool`: Flag indicating whether to mesh bondwires.""" + """:obj:`bool`: Flag indicating if bondwires are meshed.""" return self.__stub.GetMeshBws(self.msg).value @mesh_bws.setter @@ -490,7 +490,7 @@ def mesh_bws(self, mesh_bws): @property def refine_bws(self): - """:obj:`bool`: Flag indicating whether to refine mesh along bondwires.""" + """:obj:`bool`: Flag indicating if the mesh along bondwires is refined.""" return self.__stub.GetRefineBws(self.msg).value @refine_bws.setter @@ -499,7 +499,7 @@ def refine_bws(self, refine_bws): @property def mesh_vias(self): - """:obj:`bool`: Flag indicating whether to mesh vias.""" + """:obj:`bool`: Flag indicating if vias are meshed.""" return self.__stub.GetMeshVias(self.msg).value @mesh_vias.setter @@ -508,7 +508,7 @@ def mesh_vias(self, mesh_vias): @property def refine_vias(self): - """:obj:`bool`: Flag indicating whether to refine mesh along vias.""" + """:obj:`bool`: Flag indicating if the mesh along vias is refined.""" return self.__stub.GetRefineVias(self.msg).value @refine_vias.setter @@ -517,7 +517,7 @@ def refine_vias(self, refine_vias): @property def num_bw_sides(self): - """:obj:`int`: Number of sides used to approximate cylindrical bondwires.""" + """:obj:`int`: Number of sides to use to approximate cylindrical bondwires.""" return self.__stub.GetNumBwSides(self.msg).value @num_bw_sides.setter @@ -526,7 +526,7 @@ def num_bw_sides(self, num_bw_sides): @property def num_via_sides(self): - """:obj:`int`: Number of sides used to approximate cylindrical vias.""" + """:obj:`int`: Number of sides to use to approximate cylindrical vias.""" return self.__stub.GetNumViaSides(self.msg).value @num_via_sides.setter @@ -535,13 +535,13 @@ def num_via_sides(self, num_via_sides): class SIWaveSParameterSettings(SimulationSettingsBase): - """Class representing s parameter settings for SIWave simulations.""" + """Represents s parameter settings for SIWave simulations.""" __stub: SIWaveSParameterSettingsServiceStub = StubAccessor(StubType.siwave_s_param_sim_settings) @property def use_state_space(self): - """:obj:`bool`: Flag indicating whether to use state space or custom model.""" + """:obj:`bool`: Flag indicating if state space is used. If ``False``, a custom model is used.""" return self.__stub.GetUseStateSpace(self.msg).value @use_state_space.setter 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 2b85c05eb8..c7ae19f333 100644 --- a/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py +++ b/src/ansys/edb/core/simulation_setup/siwave_simulation_setup.py @@ -1,27 +1,27 @@ -"""SIWave Simulation Setup.""" +"""SIWave simulation setup.""" from ansys.edb.core.simulation_setup.simulation_setup import SimulationSetup, SimulationSetupType from ansys.edb.core.simulation_setup.siwave_simulation_settings import SIWaveSimulationSettings class SIWaveSimulationSetup(SimulationSetup): - """Class representing SIWave simulation setup data.""" + """Represents SIWave simulation setup data.""" @classmethod def create(cls, cell, name): - """Create a SIWaveSimulationSetup. + """Create a SIWave simulationsetup. Parameters ---------- cell : :class:`Cell ` - Cell containing new simulation setup. + Cell to create simulation setup in. name : str - Name of new simulation setup + Name of the simulation setup. Returns ------- SIWaveSimulationSetup - Newly created simulation setup. + Simulation setup created. """ return super()._create(cell, name, SimulationSetupType.SI_WAVE) diff --git a/src/ansys/edb/core/terminal/terminals.py b/src/ansys/edb/core/terminal/terminals.py index 562fdf796c..26295fc816 100644 --- a/src/ansys/edb/core/terminal/terminals.py +++ b/src/ansys/edb/core/terminal/terminals.py @@ -15,7 +15,7 @@ class TerminalType(Enum): - """Enum class representing terminal types.""" + """Provides an enum representing terminal types.""" EDGE = term_pb2.EDGE_TERM POINT = term_pb2.POINT_TERM @@ -26,7 +26,7 @@ class TerminalType(Enum): class BoundaryType(Enum): - """Enum class representing terminal boundary types.""" + """Provides an enum representing terminal boundary types.""" PORT = term_pb2.PORT_BOUNDARY PEC = term_pb2.PEC_BOUNDARY @@ -40,7 +40,7 @@ class BoundaryType(Enum): class SourceTermToGroundType(Enum): - """Enum class representing source terminal to ground types.""" + """Provides an enum representing source terminal-to-ground types.""" NO_GROUND = term_pb2.NO_GROUND NEGATIVE = term_pb2.NEGATIVE @@ -48,7 +48,7 @@ class SourceTermToGroundType(Enum): class HfssPIType(Enum): - """Enum class representing HFSS PI types.""" + """Provides an enum representing HFSS PI types.""" DEFAULT = term_pb2.PI_DEFAULT COAXIAL_OPEN = term_pb2.PI_COAXIAL_OPEN @@ -58,20 +58,20 @@ class HfssPIType(Enum): class EdgeType(Enum): - """Enum class representing edge types.""" + """Provides an enum representing edge types.""" PRIMITIVE = edge_term_pb2.PRIMITIVE_EDGE PADSTACK = edge_term_pb2.PAD_EDGE class Edge(ObjBase): - """Class representing an edge.""" + """Represents an edge.""" __stub = StubAccessor(StubType.edge) type = TypeField(None) def cast(self): - """Cast the base Edge object to correct subclass, if possible. + """Cast the base edge object to the correct subclass, if possible. Returns ------- @@ -104,13 +104,13 @@ def _params(self): class PadEdge(Edge): - """Class representing a padstack edge.""" + """Represents a padstack edge.""" type = TypeField(EdgeType.PADSTACK) @classmethod def create(cls, padstack_instance, layer, arc): - """Create a PadEdge. + """Create a padstack edge. Parameters ---------- @@ -126,37 +126,22 @@ def create(cls, padstack_instance, layer, arc): @property def padstack_instance(self): - """Return the padstack instance this edge is on. - - Returns - ------- - PadstackInstance - """ + """:class:`PadstackInstance`: Padstack instance that the edge is on.""" return primitive.PadstackInstance(self._params.padstack_instance) @property def layer(self): - """Return the layer this edge is on. - - Returns - ------- - Layer - """ + """:class:`Layer`: Layer that the edge is on.""" return Layer(self._params.layer.id).cast() @property def arc(self): - """Return the arc of this edge. - - Returns - ------- - ArcData - """ + """:class:`ArcData`: Arc of the edge.""" return ArcData(self._params.arc) class PrimitiveEdge(Edge): - """Class representing a primitive edge.""" + """Represents a primitive edge.""" type = TypeField(EdgeType.PRIMITIVE) @@ -177,38 +162,29 @@ def create(cls, prim, point): @property def primitive(self): - """Return primitive of this terminal. - - Returns - ------- - Primitive - """ + """:class:`Primitive`: Primitive of the terminal.""" return primitive.Primitive(self._params.primitive).cast() @property def point(self): - """Return the x, y coordinates of this terminal. - - Returns - ------- - (Value, Value) - """ + """:obj:`list`: Coordinates (x, y) of the terminal.""" return self._params.point class Terminal(conn_obj.ConnObj): - """Class representing a terminal object.""" + """Represents a terminal object.""" __stub = StubAccessor(StubType.terminal) type = TypeField(None) layout_obj_type = LayoutObjType.TERMINAL def cast(self, term_type=None): - """Cast the terminal object to correct concrete type. Fetch the type if necessary. + """Cast the terminal object to the correct concrete type, fetching the type if necessary. Parameters - term_type : TerminalType ---------- + term_type : TerminalType + Returns ------- Terminal @@ -235,12 +211,14 @@ def cast(self, term_type=None): @classmethod def find(cls, layout, name): - """Find a terminal by name. + """Find a terminal by name in a given layout. Parameters ---------- layout : Layout + Layout to search for the terminal. name : str + Name of the terminal. Returns ------- @@ -260,328 +238,154 @@ def _params(self, values): @property def _type(self): - """Return the terminal type.""" + """:class:`TerminalType`: Terminal type.""" return TerminalType(self._params.term_type) @property def bundle_terminal(self): - """Return a bundle terminal this terminal belongs to, if any. - - Returns - ------- - BundleTerminal - """ + """:class:`BundleTerminal`: Bundle terminal that the terminal belongs to, if any.""" return BundleTerminal(self._params.bundle_term) @property def reference_terminal(self): - """Return a terminal this terminal references, if any. - - Returns - ------- - Terminal - """ + """:class:`Terminal`: Terminal that the terminal references, if any.""" return Terminal(self._params.ref_term).cast() @reference_terminal.setter def reference_terminal(self, value): - """Set a terminal this terminal references. - - Parameters - ---------- - value : Terminal - """ self._params = {"ref_term": value} @property def reference_layer(self): - """Return a layer this terminal references, if any. - - Returns - ------- - Layer - """ + """:class:`Layer`: Layer that the terminal references, if any, by either layer object or name.""" return Layer(self._params.ref_layer).cast() @reference_layer.setter def reference_layer(self, value): - """Set a layer this terminal references by Layer object or by layer name. - - Parameters - ---------- - value : Layer or str - """ self._params = {"ref_layer": value} @property def is_interface_terminal(self): - """Return whether this terminal is an interface. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the terminal is an interface.""" return self._params.is_interface @property def is_reference_terminal(self): - """Return whether this terminal is a reference terminal. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the terminal is a reference terminal.""" return self._params.is_reference @property def use_reference_from_hierarchy(self): - """Return whether this terminal can use references from hierarchy. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the terminal can use references from the hierarchy.""" return self._params.use_ref_from_hierarchy @use_reference_from_hierarchy.setter def use_reference_from_hierarchy(self, value): - """Set whether this terminal can use references from hierarchy. - - Parameters - ---------- - value : bool - """ self._params = {"use_ref_from_hierarchy": value} @property def is_auto_port(self): - """Return whether this terminal is an auto port. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the terminal is an auto port.""" return self._params.is_auto_port @is_auto_port.setter def is_auto_port(self, value): - """Set whether this terminal is an auto port. - - Parameters - ---------- - value : bool - """ self._params = {"is_auto_port": value} @property def is_circuit_port(self): - """Return whether this terminal is a circuit port. - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the terminal is a circuit port.""" return self._params.is_circuit_port @is_circuit_port.setter def is_circuit_port(self, value): - """Set whether this terminal is a circuit port. - - Parameters - ---------- - value : bool - """ self._params = {"is_circuit_port": value} @property def name(self): - """Return the name of this terminal. - - Returns - ------- - str - """ + """:obj:`str`: Name of the terminal.""" return self._params.name @name.setter def name(self, value): - """Set the name of this terminal. - - Parameters - ---------- - value : str - """ self._params = {"name": value} @property def boundary_type(self): - """Return the boundary type of this terminal. - - Returns - ------- - BoundaryType - """ + """:class:`BoundaryType`: Boundary type of the terminal.""" return BoundaryType(self._params.boundary_type) @boundary_type.setter def boundary_type(self, value): - """Set the boundary type of this terminal. - - Parameters - ---------- - value : BoundaryType - """ self._params = {"boundary_type": value.value} @property def impedance(self): - """Return the impedance of this terminal. - - Returns - ------- - Value - """ + """:class:`Value`: Impedance of the terminal.""" return Value(self._params.impedance) @impedance.setter def impedance(self, value): - """Set the impedance of this terminal. - - Parameters - ---------- - value : Value - """ self._params = {"impedance": value} @property def source_amplitude(self): - """Return the source amplitude of this terminal. - - Returns - ------- - Value - """ + """:class:`Value`: Source amplitude of the terminal.""" return Value(self._params.source_amplitude) @source_amplitude.setter def source_amplitude(self, value): - """Set the source amplitude of this terminal. - - Parameters - ---------- - value : Value - """ self._params = {"source_amplitude": value} @property def source_phase(self): - """Return the source phase of this terminal. - - Returns - ------- - Value - """ + """:class:`Value`: Source phase of the terminal.""" return Value(self._params.source_phase) @source_phase.setter def source_phase(self, value): - """Set the source phase of this terminal. - - Parameters - ---------- - value : Value - """ self._params = {"source_phase": value} @property def term_to_ground(self): - """Return source term to ground type. - - Returns - ------- - SourceTermToGroundType - """ + """:class:`SourceTermToGroundType`: Source terminal-to-ground type.""" return SourceTermToGroundType(self._params.term_to_ground) @term_to_ground.setter def term_to_ground(self, value): - """Set the source term to ground type. - - Parameters - ---------- - value : SourceTermToGroundType - """ self._params = {"term_to_ground": value.value} @property def hfss_pi_type(self): - """Return the HFSS PI type. - - Returns - ------- - HfssPIType - """ + """:class:`HfssPIType`: HFSS PI type.""" return HfssPIType(self._params.hfss_pi_type) @hfss_pi_type.setter def hfss_pi_type(self, value): - """Set the HFSS PI type. - - Parameters - ---------- - value : HfssPIType - """ self._params = {"hfss_pi_type": value.value} @property def model(self): - """Return the S-parameter model. - - Returns - ------- - str - """ + """:obj:`str`: S-parameter model.""" return self._params.s_param_model @model.setter def model(self, value): - """Set the S-parameter model. - - Parameters - ---------- - value : str - """ self._params = {"s_param_model": value} @property @parser.to_rlc def rlc_boundary_parameters(self): - """Return the RLC boundary parameters. - - Returns - ------- - Rlc - """ + """:class:`Rlc`: RLC boundary parameters.""" return self._params.rlc @rlc_boundary_parameters.setter def rlc_boundary_parameters(self, value): - """Set the RLC boundary parameters. - - Parameters - ---------- - value : Rlc - """ self._params = {"rlc": value} @property def port_post_processing_prop(self): - """Return the port post processing props. - - Returns - ------- - PortPostProcessingProp - """ + """:class:`PortPostProcessingProp`: Port postprocessing properties.""" msg = self._params.port_post_processing_prop return PortPostProcessingProp( voltage_magnitude=msg.voltage_magnitude, @@ -595,12 +399,6 @@ def port_post_processing_prop(self): @port_post_processing_prop.setter def port_post_processing_prop(self, value): - """Set the port post processing props. - - Parameters - ---------- - value : PortPostProcessingProp - """ self._params = {"port_post_processing_prop": value} def _product_solvers(self, product_id): @@ -609,16 +407,19 @@ def _product_solvers(self, product_id): ) def product_solver_option(self, product_id, solver_name): - """Return product solver option name. + """Get the name of the product solver option. Parameters ---------- product_id : ProductIdType + ID of the product. solver_name : str + Name of the solver. Returns ------- str + Name of the product solver option. """ return next( solver.option @@ -627,44 +428,52 @@ def product_solver_option(self, product_id, solver_name): ) def set_product_solver_option(self, product_id, solver_name, option): - """Set product solver option name. + """Set the product solver option. Parameters ---------- product_id : ProductIdType + ID of the product. solver_name : str + Name of the solver. option : str + Name of the product solver option. """ self.__stub.SetProductSolverOptions( messages.term_set_solver_option_message(self, product_id, solver_name, option) ) def product_solver_names(self, product_id): - """Return the list of solver names. + """Get the list of solver names. Parameters ---------- product_id : ProductIdType + ID of the product. """ return [solver.name for solver in self._product_solvers(product_id)] class TerminalInstance(conn_obj.ConnObj): - """Class representing a terminal instance.""" + """Represents a terminal instance.""" __stub = StubAccessor(StubType.terminal_instance) layout_obj_type = LayoutObjType.TERMINAL_INSTANCE @classmethod def create(cls, layout, cell_instance, name, net_ref): - """Create a terminal instance object. + """Create a terminal instance. Parameters ---------- layout : Layout + Layout to create the terminal instance in. cell_instance : CellInstance + Name of the cell instance to create the terminal instance on. name : str + Name of the terminal instance. net_ref : Net or str or None + Net reference. Returns ------- @@ -678,37 +487,22 @@ def create(cls, layout, cell_instance, name, net_ref): @property def owning_cell_instance(self): - """Return an cell instance that owns this terminal. - - Returns - ------- - CellInstance - """ + """:class:`CellInstance`: Cell instance that owns the terminal.""" return hierarchy.CellInstance(self.__stub.GetOwningCellInstance(self.msg)) @property def definition_terminal(self): - """Return a definition terminal, if any. - - Returns - ------- - Terminal - """ + """:class:`Terminal`: Definition terminal, if any.""" return Terminal(self.__stub.GetDefinitionTerminal(self.msg)).cast() @property def definition_terminal_name(self): - """Return a name of definition terminal. - - Returns - ------- - str - """ + """:obj:`str`: Name of the definition terminal.""" return self.__stub.GetDefinitionTerminalName(self.msg).value class TerminalInstanceTerminal(Terminal): - """Class representing a terminal instance terminal.""" + """Represents a terminal instance terminal.""" __stub = StubAccessor(StubType.terminal_instance_terminal) type = TypeField(TerminalType.TERM_INST) @@ -720,10 +514,15 @@ def create(cls, layout, term_instance, name, net_ref, is_ref=False): Parameters ---------- layout : Layout + Layout to create the terminal instance terminal in. term_instance : TerminalInstance + Terminal instance to create the terminal instance terminal on. name + Name of the terminal instance terminal. net_ref : Net or str or None - is_ref : bool, optional + Net reference. + is_ref : bool, default: False + Whether the terminal instance terminal is a reference terminal. Returns ------- @@ -739,35 +538,23 @@ def create(cls, layout, term_instance, name, net_ref, is_ref=False): @property def terminal_instance(self): - """Return the terminal instance. - - Returns - ------- - TerminalInstance - """ + """:class:`TerminalInstance`: Terminal instance.""" return TerminalInstance(self.__stub.GetTerminalInstance(self.msg)) @terminal_instance.setter def terminal_instance(self, value): - """Set the terminal instance. - - Parameters - ---------- - value : TerminalInstance - """ self.__stub.SetTerminalInstance(messages.term_inst_term_set_instance_message(self, value)) class BundleTerminal(Terminal): - """Class representing a bundle terminal object.""" + """Represents a bundle terminal object.""" __stub = StubAccessor(StubType.bundle_terminal) type = TypeField(TerminalType.BUNDLE) @classmethod def create(cls, terminals): - """ - Create a bundle terminal. + """Create a bundle terminal. Parameters ---------- @@ -781,38 +568,37 @@ def create(cls, terminals): @property def terminals(self): - """Get list of terminals grouped in this terminal. - - Returns - ------- - list of Terminal - """ + """:obj:`list`: All terminals grouped in the terminal.""" return [Terminal(msg).cast() for msg in self.__stub.GetTerminals(self.msg)] def ungroup(self): - """Delete this grouping.""" + """Delete the grouping.""" self.__stub.Ungroup(self.msg) self.msg = None class PointTerminal(Terminal): - """Class representing a point terminal object.""" + """Represents a point terminal object.""" __stub = StubAccessor(StubType.point_terminal) type = TypeField(TerminalType.POINT) @classmethod def create(cls, layout, net, layer, name, point): - """ - Create a point terminal. + """Create a point terminal. Parameters ---------- layout : Layout + Layout to create the point terminal in. net : str or Net or None + Net. layer : str or Layer + Layer to place the point terminal on. name : str + Name of the point terminal. point : PointLike + Type of the point terminal. Returns ------- @@ -824,12 +610,8 @@ def create(cls, layout, net, layer, name, point): @property def params(self): - """Get x, y coordinates and the layer this point terminal is placed on. - - Returns - ------- - (Layer, (Value, Value)) - """ + """:class:`layer`, :obj:`list (Value, Value)`: Layer that the point terminal is placed on and a list of \ + the (x, y) coordinates.""" res = self.__stub.GetParameters(self.msg) point = ( Value(res.point.x), @@ -840,37 +622,25 @@ def params(self): @property def layer(self): - """Get the layer the point terminal is placed on. - - Returns - ------- - Layer - """ + """:class:`Layer`: Layer that the point terminal is placed on.""" return self.params[0] @property def point(self): - """Get the x, y coordinates of the point terminal. + """:obj:`list (Value, Value)`: Coordinates (x, y) of the point terminal. - Returns - ------- - (Value, Value) + To set the (x, y) coordinates and the layer that the point terminal is placed on, + use a tuple in this format: ``[str or Layer, PointData]``. """ return self.params[1] @params.setter def params(self, params): - """Set x, y coordinates and the layer this point terminal is placed on. - - Parameters - ---------- - params : tuple[str or Layer, PointData] - """ self.__stub.SetParameters(messages.point_term_set_params_message(self, *params)) class PadstackInstanceTerminal(Terminal): - """Class representing Padstack Instance Terminal.""" + """Represents a padstack instance terminal.""" __stub = StubAccessor(StubType.padstack_instance_terminal) type = TypeField(TerminalType.PADSTACK_INST) @@ -882,11 +652,17 @@ def create(cls, layout, name, padstack_instance, layer, net, is_ref=False): Parameters ---------- layout : Layout + Layout to create the padstack instance terminal in. name : str + Name of the padstack instance terminal. padstack_instance : PadstackInstance + Padstack instance. layer : Layer or str + Layer to place the padstack instance terminal on. net : Net or str or None - is_ref : bool, optional + Net. + is_ref : bool, default: False + Whether the padstack instance terminal is a reference terminal. Returns ------- @@ -902,12 +678,7 @@ def create(cls, layout, name, padstack_instance, layer, net, is_ref=False): @property def params(self): - """Return padstack instance and layer. - - Returns - ------- - (PadstackInstance, Layer) - """ + """:obj:`list` of :class:`PadstackInstance` and :class:`Layer`: Padstack instance and layer.""" res = self.__stub.GetParameters(self.msg) padstack_instance = primitive.PadstackInstance(res.padstack_instance) layer = Layer(res.layer).cast() @@ -915,12 +686,6 @@ def params(self): @params.setter def params(self, params): - """Set padstack instance and layer for this terminal. - - Parameters - ---------- - params : (PadstackInstance, Layer) - """ (padstack_instance, layer) = params self.__stub.SetParameters( messages.padstack_inst_term_set_params_message(self, padstack_instance, layer) @@ -928,27 +693,17 @@ def params(self, params): @property def padstack_instance(self): - """Return the padstack instance of this terminal. - - Returns - ------- - PadstackInstance - """ + """:class:`PadstackInstance`: Padstack instance of the terminal.""" return self.params[0] @property def layer(self): - """Return the layer this terminal is on. - - Returns - ------- - Layer - """ + """:class:`Layer`: Layer the terminal is placed on.""" return self.params[1] class PinGroupTerminal(Terminal): - """Class representing a pin group terminal.""" + """Represents a pin group terminal.""" __stub = StubAccessor(StubType.pin_group_terminal) type = TypeField(TerminalType.PIN_GROUP) @@ -960,10 +715,15 @@ def create(cls, layout, name, pin_group, net_ref, is_ref=False): Parameters ---------- layout : Layout + Layout to create the pin group terminal in. net_ref : Net or str or None + Net reference. name : str + Name of the pin group terminal. pin_group : PinGroup - is_ref : bool, optional + Pin group. + is_ref : bool, default: False + Whether the pin group terminal is a reference terminal. Returns ------- @@ -977,47 +737,25 @@ def create(cls, layout, name, pin_group, net_ref, is_ref=False): @property def pin_group(self): - """Return the pin group of this terminal. - - Returns - ------- - PinGroup - """ + """:class:`PinGroup`: Pin group of the terminal.""" return hierarchy.PinGroup(self.__stub.GetPinGroup(self.msg)) @pin_group.setter def pin_group(self, value): - """Set the pin group of this terminal. - - Parameters - ---------- - value : PinGroup - """ self.__stub.SetPinGroup(messages.pin_group_term_set_pin_group_message(self, value)) @property def layer(self): - """Return the layer. - - Returns - ------- - Layer - """ + """:class:`Layer`: Layer.""" return Layer(self.__stub.GetLayer(self.msg)).cast() @layer.setter def layer(self, value): - """Set the layer. - - Parameters - ---------- - value : Layer - """ self.__stub.SetLayer(messages.pin_group_term_set_layer_message(self, value)) class EdgeTerminal(Terminal): - """Class representing Edge Terminal.""" + """Represents an edge terminal.""" __stub = StubAccessor(StubType.edge_terminal) type = TypeField(TerminalType.EDGE) @@ -1029,10 +767,14 @@ def create(cls, layout, name, edges, net_ref=None, is_ref=False): Parameters ---------- layout : Layout + Layout to create the edge terminal in. name : str + Name of the edge terminal. edges : list of Edge net_ref : Net or str or None - is_ref : bool, optional + Net reference. The default is ``None``. + is_ref : bool, default: False + Whether the edge terminal is a reference terminal. Returns ------- @@ -1046,20 +788,9 @@ def create(cls, layout, name, edges, net_ref=None, is_ref=False): @property def edges(self): - """Return the edges on this terminal. - - Returns - ------- - list of Edge - """ + """:obj:`list` of :class:`Edge`: All edges on the terminal.""" return [Edge(msg).cast() for msg in self.__stub.GetEdges(self.msg)] @edges.setter def edges(self, edges): - """Set the edges on this terminal. - - Parameters - ---------- - edges : list of Edge - """ self.__stub.GetEdges(messages.edge_term_set_edges_message(self, edges)) diff --git a/src/ansys/edb/core/typing/__init__.py b/src/ansys/edb/core/typing/__init__.py index 37a4685aaa..13d55cb18e 100644 --- a/src/ansys/edb/core/typing/__init__.py +++ b/src/ansys/edb/core/typing/__init__.py @@ -1,4 +1,4 @@ -"""This package contains common type definitions used throughout edb codebase.""" +"""This package contains common type definitions used throughout the EDB codebase.""" from typing import Iterable, Tuple, Union diff --git a/src/ansys/edb/core/utility/conversions.py b/src/ansys/edb/core/utility/conversions.py index 46bcd6412e..e368dc9901 100644 --- a/src/ansys/edb/core/utility/conversions.py +++ b/src/ansys/edb/core/utility/conversions.py @@ -5,7 +5,7 @@ def to_value(val): - """Take a value implicitly convertible to Value and return as Value. + """Take a value implicitly convertible to a ``Value``type and return as a ``Value`` type. Parameters ---------- @@ -21,12 +21,12 @@ def to_value(val): return utility.Value(val) else: raise TypeError( - f"value-like objects must be either of type Value or int/float/complex/str. - Received '{val}'" + f"Value-like objects must be either of type Value or int/float/complex/str. - Received '{val}'" ) def to_point(val): - """Take a value implicitly convertible to PointData and return as PointData. + """Take a value implicitly convertible to a ``PointData`` type and return as a ``PointData`` type. Parameters ---------- @@ -45,16 +45,17 @@ def to_point(val): return geometry.PointData(val) raise TypeError( - "point-like objects must be either of type PointData or a list/tuple containing (start, end) or (arc_height)." + "Point-like objects must be either of type PointData or a list/tuple containing (start, end) or (arc_height)." ) def to_point3d(val): - """Convert a value to Point3DData object. + """Convert a value to a ``Point3DData`` object. Parameters ---------- val : geometry.Point3DData, tuple[:term:`ValueLike`,:term:`ValueLike`,:term:`ValueLike`] + Value to convert. Returns ------- diff --git a/src/ansys/edb/core/utility/heat_sink.py b/src/ansys/edb/core/utility/heat_sink.py index 08f7566de4..c53ffd5c72 100644 --- a/src/ansys/edb/core/utility/heat_sink.py +++ b/src/ansys/edb/core/utility/heat_sink.py @@ -1,4 +1,4 @@ -"""HeatSink.""" +"""Heat sink.""" from enum import Enum @@ -8,7 +8,7 @@ class HeatSinkFinOrientation(Enum): - """Enum representing bondwire types. + """Provides an enum representing bondwire types. - X_ORIENTED X axis oriented. @@ -24,20 +24,20 @@ class HeatSinkFinOrientation(Enum): class HeatSink: - """Class representing HeatSink. + """Represents a heat sink. Attributes ---------- fin_thickness : :term:`ValueLike` - HeatSink's fin thickness. + Fin thickness of the heat sink. fin_spacing : :term:`ValueLike` - HeatSink's fin spacing. + Fin spacing of the heat sink. fin_base_height : :term:`ValueLike` - Base elevation of the HeatSink + Base elevation of the the heat sink. fin_height : :term:`ValueLike` - HeatSink's fin height. + Fin height of the heat sink. fin_orientation : HeatSinkFinOrientation - HeatSink's fin orientation if not set is set to X axis orientation. + Fin orientation of the heat sink if it is not set to the X axis. """ @@ -49,7 +49,7 @@ def __init__( fin_height=0, fin_orientation=HeatSinkFinOrientation.X_ORIENTED, ): - """Construct a HeatSink object using given values.""" + """Initialize a heat sink object using given values.""" self.fin_thickness = conversions.to_value(fin_thickness) self.fin_spacing = conversions.to_value(fin_spacing) self.fin_base_height = conversions.to_value(fin_base_height) diff --git a/src/ansys/edb/core/utility/hfss_extent_info.py b/src/ansys/edb/core/utility/hfss_extent_info.py index f250f77c4d..c5c50428e1 100644 --- a/src/ansys/edb/core/utility/hfss_extent_info.py +++ b/src/ansys/edb/core/utility/hfss_extent_info.py @@ -1,4 +1,4 @@ -"""HFSS Extent Info.""" +"""HFSS extent information.""" from enum import Enum @@ -9,53 +9,53 @@ class HfssExtentInfo: - """HFSS Extent info class. + """Provides HFSS extent information. Attributes ---------- use_open_region: bool - Is Open Region used? + Whether an open region is used. extent_type: HfssExtentInfo.HFSSExtentInfoType Extent type. open_region_type: HfssExtentInfo.OpenRegionType Open region type. base_polygon: Primitive - Polygon to use if extent type is Polygon. + Polygon to use if the extent is the ``Polygon`` type. dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType Dielectric extent type. dielectric_base_polygon: :class:`Primitive ` - Polygon to use if dielectric extent type is Polygon. + Polygon to use if dielectric extent is is the ``Polygon`` type. dielectric: (float, bool) - Dielectric extent size. First parameter is the value and second parameter \ + Dielectric extent size. The first parameter is the value, and the second parameter \ indicates if the value is a multiple. honor_user_dielectric: bool - Honoring user defined dielectric primitive when calculate dielectric extent. + Whether to honor a user-defined dielectric primitive when calculating a dielectric extent. airbox_truncate_at_ground: bool - Whether airbox will be truncated at the ground layers. + Whether to truncate the airbox at the ground layers. airbox_horizontal: (float, bool) - Airbox horizontal extent size. First parameter is the value and second parameter \ + Airbox horizontal extent size. The first parameter is the value, and the second parameter \ indicates if the value is a multiple. airbox_vertical_positive: (float, bool) - Airbox positive vertical extent size. First parameter is the value and second parameter \ + Airbox positive vertical extent size. The first parameter is the value, and the second parameter \ indicates if the value is a multiple. airbox_vertical_negative: (float, bool) - Airbox negative vertical extent size. First parameter is the value and second parameter indicates \ - if the value is a multiple. + Airbox negative vertical extent size. The first parameter is the value, and the second parameter \ + indicates if the value is a multiple. sync_airbox_vertical_extent: bool - Whether airbox positive and negative vertical extent will be synchronized. + Whether to synchronize the airbox positive and negative vertical extent. is_pml_visible: bool - Check to see if the PML boxes should be rendered or not. + Whether to check to see if the PML boxes are to rendered. operating_frequency: :class:`Value ` - PML Operating Frequency. + PML operating frequency. radiation_level: :class:`Value ` - PML Radiation level to calculate the thickness of boundary. + PML radiation level for calculating the thickness of the boundary. user_xy_data_extent_for_vertical_expansion: bool - if true, retain the old behaviour for the vertical expansion of the airbox. - The vertical extent will be calculated from the XY data extent. + Whether to retain the old behavior for the vertical expansion of the airbox. + If ``True``, the vertical extent is calculated from the XY data extent. """ class HFSSExtentInfoType(Enum): - """Enum representing available hfss extenct info types. + """Provides an enum representing available HFSS extent information types. - BOUNDING_BOX Bounding box extent. @@ -64,7 +64,7 @@ class HFSSExtentInfoType(Enum): - CONVEX_HUL Convex hull extent. - POLYGON - Use user defined polygon as extent. + Use user-defined polygon as the extent. """ BOUNDING_BOX = edb_defs_pb2.HFSS_EXTENT_BOUNDING_BOX @@ -73,7 +73,7 @@ class HFSSExtentInfoType(Enum): POLYGON = edb_defs_pb2.HFSS_EXTENT_POLYGON class OpenRegionType(Enum): - """Enum representing available open region types. + """Provides an enum representing open region types. - RADIATION Bounding box extent. @@ -104,49 +104,51 @@ def __init__( radiation_level=Value(0), user_xy_data_extent_for_vertical_expansion=True, ): - """Create an HfssExtentInfo object. + """Create an HFSS extent information object. Parameters ---------- - use_open_region: bool - Is Open Region used? - extent_type: HfssExtentInfo.HFSSExtentInfoType + use_open_region: bool, default: True + Whether an open region is used. + extent_type: HfssExtentInfo.HFSSExtentInfoType, default: BOUNDING_BOX Extent type. - open_region_type: HfssExtentInfo.OpenRegionType + open_region_type: HfssExtentInfo.OpenRegionType, default: RADIATION Open region type. - base_polygon: Primitive - Polygon to use if extent type is Polygon. - dielectric_extent_type: HfssExtentInfo.HFSSExtentInfoType + base_polygon: Primitive, default: None + 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 ` - Polygon to use if dielectric extent type is Polygon. - dielectric: (float, bool) - Dielectric extent size. First parameter is the value and second parameter \ - indicates if the value is a multiple. - honor_user_dielectric: bool - Honoring user defined dielectric primitive when calculate dielectric extent. - airbox_truncate_at_ground: bool - Whether airbox will be truncated at the ground layers. - airbox_horizontal: (float, bool) - Airbox horizontal extent size. First parameter is the value and second parameter \ - indicates if the value is a multiple. - airbox_vertical_positive: (float, bool) - Airbox positive vertical extent size. First parameter is the value and second parameter \ - indicates if the value is a multiple. - airbox_vertical_negative: (float, bool) - Airbox negative vertical extent size. First parameter is the value and second parameter indicates \ - if the value is a multiple. - sync_airbox_vertical_extent: bool - Whether airbox positive and negative vertical extent will be synchronized. - is_pml_visible: bool - Check to see if the PML boxes should be rendered or not. - operating_frequency: :class:`Value ` - PML Operating Frequency. - radiation_level: :class:`Value ` - PML Radiation level to calculate the thickness of boundary. - user_xy_data_extent_for_vertical_expansion: bool - if true, retain the old behaviour for the vertical expansion of the airbox. - The vertical extent will be calculated from the XY data extent. + 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. + The second parameter is a Boolean indicating if the value is a multiple. + honor_user_dielectric: bool, default: True + Whether to honor a user-defined dielectric primitive when calculating the dielectric + extent. + airbox_truncate_at_ground: bool, default: False + Whether to truncate the airbox at the ground layers. + airbox_horizontal: (float, bool), default: (0.15, True) + Airbox horizontal extent size. The first parameter is the value. + The second parameter is a Boolean indicating if the value is a multiple. + airbox_vertical_positive: (float, bool), default: (0.15, True) + Airbox positive vertical extent size. The first parameter is the value. + The second parameter is a Boolean indicating if the value is a multiple. + airbox_vertical_negative: (float, bool), default: (0.15, True) + Airbox negative vertical extent size. The first parameter is the value. + The second parameter is a Boolean indicating if the value is a multiple. + sync_airbox_vertical_extent: bool, default: True + 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" + PML operating frequency. + 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. + The default is ``True``, in which case the vertical extent is calculated from + the XY data extent. """ self.use_open_region = use_open_region self.extent_type = extent_type diff --git a/src/ansys/edb/core/utility/layer_map.py b/src/ansys/edb/core/utility/layer_map.py index ebc30a94f2..1f7a037051 100644 --- a/src/ansys/edb/core/utility/layer_map.py +++ b/src/ansys/edb/core/utility/layer_map.py @@ -1,4 +1,4 @@ -"""Layer Map.""" +"""Layer map.""" from enum import Enum @@ -11,7 +11,7 @@ class _QueryBuilder: @staticmethod def layer_map_unique_direction_message(direction): - """Create a LayerMapUniqueDirection Message. + """Create a ``LayerMapUniqueDirection`` message. Parameters ---------- @@ -23,7 +23,7 @@ def layer_map_unique_direction_message(direction): @staticmethod def layer_map_two_int_properties_message(target, from_id, to_id): - """Create a LayerMapTwoIntProperties Message. + """Create a ``LayerMapTwoIntProperties`` message. Parameters ---------- @@ -39,12 +39,12 @@ def layer_map_two_int_properties_message(target, from_id, to_id): class LayerMap(ObjBase): - """Class representing a Layer Map two way map where key and val is layer id.""" + """Represents a two-way layer map where the key and value is the layer ID.""" __stub = StubAccessor(StubType.layer_map) class LayerMapUniqueDirection(Enum): - """Enum representing unique direction.""" + """Provides an enum representing a unique direction.""" FORWARD_UNIQUE = pb.FORWARD_UNIQUE """FORWARD_UNIQUE Mapping many to one (1,1), (2,1), (3,1)""" @@ -55,17 +55,17 @@ class LayerMapUniqueDirection(Enum): @staticmethod def create(direction): - """Create a LayerMap object. + """Create a layer map object. Parameters ---------- direction: LayerMapUniqueDirection - Variable representing map's direction + Variable representing the map's direction. Returns ------- LayerMap - The LayerMap Object that was created. + LayerMap object created. """ return LayerMap( StubAccessor(StubType.layer_map) @@ -74,20 +74,20 @@ def create(direction): ) def clear(self): - """Clear a LayerMap's entries.""" + """Clear the entrties of the layer map.""" self.__stub.Clear( self.msg, ) def set_mapping(self, from_id, to_id): - """Create an entry to the LayerMap object. + """Create an entry in the layer map object. Parameters ---------- from_id: int - Layer Id (key) "from" which to map with the "to_id" + Layer ID (key) "from" which to map with the ``to_id`` parameter. to_id: int - Layer Id (value) "to" which to map with the "from_id" + Layer ID (value) "to" which to map with the ``from_id`` parameter. """ self.__stub.SetMapping( _QueryBuilder.layer_map_two_int_properties_message( @@ -98,7 +98,7 @@ def set_mapping(self, from_id, to_id): ) def get_mapping_forward(self, layer_id): - """Get list of ids mapped forward with the given id (key).""" + """Get the list of IDs mapped forward with the given ID (key).""" msg = self.__stub.GetMappingForward( messages.int_property_message( target=self, @@ -108,7 +108,7 @@ def get_mapping_forward(self, layer_id): return [int(to_id) for to_id in msg.ids] def get_mapping_backward(self, layer_id): - """Get list of ids mapped backward with the given id (value).""" + """Get a list of IDs mapped backward with the given ID (value).""" msg = self.__stub.GetMappingBackward( messages.int_property_message( target=self, diff --git a/src/ansys/edb/core/utility/material_property_thermal_modifier_params.py b/src/ansys/edb/core/utility/material_property_thermal_modifier_params.py index 2b998077c0..1875e022af 100644 --- a/src/ansys/edb/core/utility/material_property_thermal_modifier_params.py +++ b/src/ansys/edb/core/utility/material_property_thermal_modifier_params.py @@ -1,19 +1,19 @@ -"""Class representing Material Property Thermal Modifier Parameters.""" +"""Class representing parameters for the material property thermal modifier.""" from ansys.edb.core.utility.value import Value class BasicQuadraticParams: - """Class representing BasicQuadraticParams. + """Represents basic quadratic parameters. Attributes ---------- temp_ref_val : str, int, float, complex, Value - The TempRef value in the quadratic model. + Temperature reference value in the quadratic model. c1_val : str, int, float, complex, Value - The C1 value in the quadratic model. + C1 value in the quadratic model. c2_val : str, int, float, complex, Value - The C2 value in the quadratic model. + C2 value in the quadratic model. """ def __init__( @@ -22,16 +22,16 @@ def __init__( c1_val=Value(0), c2_val=Value(0), ): - """Construct a BasicQuadraticParams object using given values. + """Initialize a basic quadratic parameters object using given values. Parameters ---------- temp_ref_val : str, int, float, complex, Value - The TempRef value in the quadratic model. + Temperature reference value in the quadratic model. c1_val : str, int, float, complex, Value - The C1 value in the quadratic model. + C1 value in the quadratic model. c2_val : str, int, float, complex, Value - The C2 value in the quadratic model. + C2 value in the quadratic model. """ self.temp_ref_val = Value(temp_ref_val) self.c1_val = c1_val @@ -39,21 +39,23 @@ def __init__( class AdvancedQuadraticParams: - """Class representing AdvancedQuadraticParams. + """Represents advanced quadratic parameters. Attributes ---------- temp_lower_limit_val : str, int, float, complex, Value - The lower temperature limit where the quadratic model is valid. + Lower temperature limit where the quadratic model is valid. temp_upper_limit_val : str, int, float, complex, Value - The upper temperature limit where the quadratic model is valid. + Upper temperature limit where the quadratic model is valid. auto_calc_constant_thermal_modifier_vals : str, int, float, complex, Value - The flag indicating if the lower_constant_thermal_modifier_val and \ - upper_constant_thermal_modifier_val values should be auto calculated. + Flag indicating if the values for the lower and upper constant thermal modifieries + are to be automatically calculated. lower_constant_thermal_modifier_val : str, int, float, complex, Value - The constant thermal modifier value for temperatures lower than lower_constant_thermal_modifier_val. + Constant thermal modifier value for temperatures less than the lower constant + thermal modifier value. upper_constant_thermal_modifier_val : str, int, float, complex, Value - The constant thermal modifier value for temperatures greater than upper_constant_thermal_modifier_val. + Constant thermal modifier value for temperatures greater than the upper + constant thermal modifier value. """ def __init__( @@ -64,21 +66,23 @@ def __init__( lower_constant_thermal_modifier_val=1, upper_constant_thermal_modifier_val=1, ): - """Construct an AdvancedQuadraticParams object using given values. + """Initialize an advanced quadratic parameters object using given values. Parameters ---------- - temp_lower_limit_val : str, int, float, complex, Value - The lower temperature limit where the quadratic model is valid. - temp_upper_limit_val : str, int, float, complex, Value - The upper temperature limit where the quadratic model is valid. - auto_calc_constant_thermal_modifier_vals : str, int, float, complex, Value - The flag indicating if the lower_constant_thermal_modifier_val and \ - upper_constant_thermal_modifier_val values should be auto calculated. - lower_constant_thermal_modifier_val : str, int, float, complex, Value - The constant thermal modifier value for temperatures lower than lower_constant_thermal_modifier_val. - upper_constant_thermal_modifier_val : str, int, float, complex, Value - The constant thermal modifier value for temperatures greater than upper_constant_thermal_modifier_val. + temp_lower_limit_val : str or int or float or complex or Value, default: "-273.15cel + Lower temperature limit where the quadratic model is valid. + temp_upper_limit_val : str or int or float or complex, or Value, default: "1000cel" + Upper temperature limit where the quadratic model is valid. + auto_calc_constant_thermal_modifier_vals : str or int or float or complex or Value, default: True + Flag indicating if the values for the lower and upper constant thermal modifieries + are to be automatically calculated. + lower_constant_thermal_modifier_val : str or int or float or complex or Value, default: 1 + Constant thermal modifier value for temperatures less than the lower constant + thermal modifier value. + upper_constant_thermal_modifier_val : str or int or float or complex or Value, default: 1 + Constant thermal modifier value for temperatures greater than the upper + constant thermal modifier value. """ self.temp_lower_limit_val = Value(temp_lower_limit_val) self.temp_upper_limit_val = Value(temp_upper_limit_val) diff --git a/src/ansys/edb/core/utility/port_post_processing_prop.py b/src/ansys/edb/core/utility/port_post_processing_prop.py index 11ec56c177..92028b128c 100644 --- a/src/ansys/edb/core/utility/port_post_processing_prop.py +++ b/src/ansys/edb/core/utility/port_post_processing_prop.py @@ -1,10 +1,10 @@ -"""Port Post Processing Prop.""" +"""Port postprocessing properties.""" from ansys.edb.core.utility.value import Value class PortPostProcessingProp: - """Represents Port Post Processing Prop.""" + """Represents the port postprocessing properties.""" def __init__( self, @@ -16,24 +16,27 @@ def __init__( do_deembed_gap_l=False, do_renormalize=False, ): - """Initialize post processing properties. + """Initialize port postprocessing properties. Parameters ---------- - voltage_magnitude : str, int, float, complex, Value, optional - Excitation voltage magnitude. - voltage_phase : str, int, float, complex, Value, optional - Excitation voltage phase. - deembed_length : str, int, float, complex, Value, optional - Dembeed distance. Only applied if do_deembed is True. - renormalization_impedance : str, int, float, complex, Value, optional - Renormalization impedance. Only applied if do_renormalize is True. + voltage_magnitude : str or int or float or complex or Value, optional + Excitation voltage magnitude. The default is ``0``. + voltage_phase : str or int or float or complex or Value, optional + Excitation voltage phase. The default is ``0``. + deembed_length : str or int or float or complex or Value, optional + Dembeed distance. The default is ``0``. This parameter is only + applied if ``do_deembed=True``. + renormalization_impedance : str or int or float or complex or Value, optional + Renormalization impedance. The default is ``0``. This parameter is only + applied if ``do_renormalize=True``. do_deembed : bool, optional - Enable port to be deembedded. + Whether to enable the port to be deembedded. The default is ``False``. do_deembed_gap_l : bool, optional - Enable port impedance renormalization. + Whether to enable port impedance renormalization. The default is ``False``. do_renormalize : bool, optional - Enable the gap port inductance to be deembedded. + Whether to enable the gap port inductance to be deembedded. The default + is ``False``. """ self.voltage_magnitude = voltage_magnitude self.voltage_phase = voltage_phase @@ -45,6 +48,7 @@ def __init__( Returns ------- bool + ``True`` when successful, ``False`` when failed. """ self.do_deembed_gap_l = do_deembed_gap_l """Enable port impedance renormalization. @@ -52,6 +56,7 @@ def __init__( Returns ------- bool + ``True`` when successful, ``False`` when failed. """ self.do_renormalize = do_renormalize """Enable port impedance renormalization. @@ -59,68 +64,49 @@ def __init__( Returns ------- bool + ``True`` when successful, ``False`` when failed. """ @property def voltage_magnitude(self): - """ - Excitation voltage magnitude. - - Returns - ------- - Value - """ + """Excitation voltage magnitude.""" return self._voltage_magnitude @voltage_magnitude.setter def voltage_magnitude(self, value): - """Set excitation voltage magnitude.""" self._voltage_magnitude = Value(value) @property def voltage_phase(self): - """ - Excitation voltage phase. - - Returns - ------- - Value - """ + """Excitation voltage phase.""" return self._voltage_phase @voltage_phase.setter def voltage_phase(self, value): - """Set excitation voltage phase.""" self._voltage_phase = Value(value) @property def deembed_length(self): """ - Deembed Length. Only applied if do_deembed is True. + Deembed length. - Returns - ------- - Value + This property is only applied if ``do_deembed=True``. """ return self._deembed_length @deembed_length.setter def deembed_length(self, value): - """Set deembed length.""" self._deembed_length = Value(value) @property def renormalization_impedance(self): """ - Renormalization Impedance. Only applied if do_renormalize is True. + Renormalization impedance. - Returns - ------- - Value + This property is only applied if ``do_renormalize=True``. """ return self._renormalization_impedance @renormalization_impedance.setter def renormalization_impedance(self, value): - """Set renormalization impedance.""" self._renormalization_impedance = Value(value) diff --git a/src/ansys/edb/core/utility/rlc.py b/src/ansys/edb/core/utility/rlc.py index a51cc599f8..7d1e365b7a 100644 --- a/src/ansys/edb/core/utility/rlc.py +++ b/src/ansys/edb/core/utility/rlc.py @@ -4,24 +4,28 @@ class Rlc: - """Class representing RLC. + """Represents an RLC. Attributes ---------- - r : str, int, float, complex, Value - Resistance value. Only used if r_enabled is True - r_enabled : bool - Resistance enabled. - l : str, int, float, complex, Value - Inductance value. Only used if c-l_enabled is True - l_enabled : bool - Inductance enabled. - c : str, int, float, complex, Value - Capacitance value. Only used if c_enabled is True - c_enabled : bool - Capacitance enabled. - is_parallel : bool - True means r,l,c elements are in parallel. Otherwise they are in series. + r : str, int, float, complex, Value, default: 0 + Resistance value. This parameter is only used if + ``r_enabled=True``. + r_enabled : bool, default: False + Whether resistance is enabled. + l : str, int, float, complex, Value, default: 0 + Inductance value. This parameter is only used if + ``c-l_enabled=True``. + l_enabled : bool, default: False + Whether inductance is enabled. + c : str, int, float, complex, Value, default: 0 + Capacitance value. This parameter is only used if + ``c_enabled=True``. + c_enabled : bool, default: False + Whether capacitance is enabled. + is_parallel : bool, default: True + Whether the r, l, and c elements are in parallel. If ``False``, these + elements are in series. """ def __init__( @@ -34,24 +38,25 @@ def __init__( c_enabled=False, is_parallel=True, ): - """Construct a Rlc object using given values. + """Initialize an RLC object using given values. Parameters ---------- - r : str, int, float, complex, Value, optional - Resistance value. Only used if r_enabled is True - r_enabled : bool, optional - Resistance enabled. - l : str, int, float, complex, Value, optional - Inductance value. Only used if l_enabled is True - l_enabled : bool, optional - Inductance enabled. - c : str, int, float, complex, Value, optional - Capacitance value. Only used if c_enabled is True - c_enabled : bool, optional - Capacitance enabled. - is_parallel : bool, optional - True means r,l,c elements are in parallel. Otherwise they are in series. + r : str, int, float, complex, Value, default: 0 + Resistance value. This parameter is only used if ``r_enabled=True``. + r_enabled : bool, default: False + Whether resistance is enabled. + l : str, int, float, complex, Value, default: 0 + Inductance value. This parameter is only used if ``c-l_enabled=True``. + l_enabled : bool, default: False + Whether inductance is enabled. + c : str, int, float, complex, Value, default: 0 + Capacitance value. This parameter is only used if ``c_enabled=True``. + c_enabled : bool, default: False + Whether capacitance is enabled. + is_parallel : bool, default: True + Whether the r, l, and c elements are in parallel. If ``False``, these + elements are in series. """ self.r = r self.l = l @@ -63,7 +68,7 @@ def __init__( class PinPair: - """Class representing PinPair. + """Represents a pin pair. Attributes ---------- @@ -74,7 +79,7 @@ class PinPair: """ def __init__(self, pin1, pin2): - """Construct a pin pair object. + """Initialize a pin pair object. Parameters ---------- @@ -88,25 +93,25 @@ def __init__(self, pin1, pin2): class PinPairRlc: - """Class representing PinPairRlc. + """Represents a pin pair RLC. Attributes ---------- pin_pair : PinPair Pin pair property. rlc : Rlc - Rlc value + RLC value. """ def __init__(self, pin_pair, rlc): - """Construct a pin pair rlc object. + """Initialize a pin pair RLC object. Parameters ---------- pin_pair: PinPair Pin pair property. rlc: Rlc - Rlc property + RLC property. """ self.pin_pair = pin_pair self.rlc = rlc diff --git a/src/ansys/edb/core/utility/temperature_settings.py b/src/ansys/edb/core/utility/temperature_settings.py index 826ca2f7d8..e9a2fbba40 100644 --- a/src/ansys/edb/core/utility/temperature_settings.py +++ b/src/ansys/edb/core/utility/temperature_settings.py @@ -1,16 +1,19 @@ -"""Temperature Settings.""" +"""Temperature settings.""" from ansys.edb.core.utility.value import Value class TemperatureSettings: """ - Temperature settings class. + Provides temperature settings. Attributes ---------- include_temp_dependence : bool + Whether to include temperature dependence. enable_thermal_feedback : bool + Whether to enable thermal feedback. temperature : :term:`ValueLike` + Temperature value. """ def __init__(self, include_temp_dependence, enable_thermal_feedback, temperature): diff --git a/src/ansys/edb/core/utility/transform.py b/src/ansys/edb/core/utility/transform.py index da738b47a8..0c1eb656d2 100644 --- a/src/ansys/edb/core/utility/transform.py +++ b/src/ansys/edb/core/utility/transform.py @@ -1,4 +1,4 @@ -"""Transform Class.""" +"""Transformations.""" import ansys.api.edb.v1.transform_pb2 as pb from ansys.api.edb.v1.transform_pb2_grpc import TransformServiceStub @@ -27,7 +27,7 @@ def transform_operator_message(target, target_2): class Transform(ObjBase): - """Class representing a transformation.""" + """Represents a transformation.""" __stub: TransformServiceStub = StubAccessor(StubType.transform) @@ -38,15 +38,15 @@ def create(cls, scale, angle, mirror, offset_x, offset_y): Parameters ---------- scale : :term:`ValueLike` - Scale parameter + Scale parameter. angle : :term:`ValueLike` - Rotation angle, specified CCW in radians. + Rotation angle, specified counter-clockwise in radians. mirror : :obj:`bool` - Mirror about Y-axis + Mirror about Y-axis. offset_x : :term:`ValueLike` - X offset + X offset. offset_y : :term:`ValueLike` - Y offset + Y offset. Returns ------- @@ -62,7 +62,7 @@ def create(cls, scale, angle, mirror, offset_x, offset_y): def scale(self): """:class:`Value `: Scale property. - This property can be set to :term:`ValueLike` + This property can be set to :term:`ValueLike`. """ return Value(self.__stub.GetScale(messages.edb_obj_message(self))) @@ -74,7 +74,7 @@ def scale(self, value): def rotation(self): """:class:`Value `: Rotation property. - This property can be set to :term:`ValueLike` + This property can be set to :term:`ValueLike`. """ return Value(self.__stub.GetRotation(messages.edb_obj_message(self))) @@ -86,7 +86,7 @@ def rotation(self, value): def offset_x(self): """:class:`Value `: X offset property. - This property can be set to :term:`ValueLike` + This property can be set to :term:`ValueLike`. """ return Value(self.__stub.GetOffsetX(messages.edb_obj_message(self))) @@ -98,7 +98,7 @@ def offset_x(self, value): def offset_y(self): """:class:`Value `: Y offset property. - This property can be set to :term:`ValueLike` + This property can be set to :term:`ValueLike`. """ return Value(self.__stub.GetOffsetY(messages.edb_obj_message(self))) @@ -108,7 +108,7 @@ def offset_y(self, value): @property def mirror(self): - """:obj:`bool`: Mirror property. If true, mirror about Y-axis.""" + """:obj:`bool`: Mirror property. If ``True``, mirror about y axis.""" return self.__stub.GetMirror(messages.edb_obj_message(self)).value @mirror.setter @@ -117,11 +117,11 @@ def mirror(self, value): @property def is_identity(self): - """:obj:`bool`: Gets whether the transformation is an identity transformation.""" + """:obj:`bool`: Flag indicating if the transformation is an identity transformation.""" return self.__stub.IsIdentity(messages.edb_obj_message(self)).value def __add__(self, other_transform): - """Add operator, concatenate two transformations. + """Add operator and concatenate two transformations. Parameters ---------- @@ -131,7 +131,7 @@ def __add__(self, other_transform): Returns ------- Transform - A new transformation object + Transformation object created. """ return Transform( self.__stub.TransformPlus( @@ -145,12 +145,12 @@ def transform_point(self, point): Parameters ---------- point: :class:`PointData ` - The point to transform [x, y] Point values. + Point values [x, y] to transform. Returns ------- :class:`PointData ` - The transformed point + Transformed point. """ pnt_msg = self.__stub.TransformPoint(messages.point_property_message(self, point)) return Value(pnt_msg.x), Value(pnt_msg.y) @@ -162,11 +162,11 @@ def transform_polygon(self, polygon): Parameters ---------- polygon: :class:`PolygonData ` - The polygon to transform. + Polygon to transform. Returns ------- :class:`PolygonData ` - The transformed polygon. + 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 aaa165bce2..e7bf481301 100644 --- a/src/ansys/edb/core/utility/transform3d.py +++ b/src/ansys/edb/core/utility/transform3d.py @@ -1,4 +1,4 @@ -"""Transform 3D Class.""" +"""3D transformformations.""" import ansys.api.edb.v1.transform3d_pb2 as pb from ansys.api.edb.v1.transform3d_pb2_grpc import Transform3DServiceStub from google.protobuf import empty_pb2 @@ -28,7 +28,7 @@ def is_equal_message(target, value, eps, rotation): class Transform3D(ObjBase): - """Represents a 3d transformation. + """Represents a 3D transformation. Parameters ---------- @@ -36,17 +36,18 @@ class Transform3D(ObjBase): rot_axis_from : :term:`Point3DLike` rot_axis_to : :term:`Point3DLike` rot_angle : str, int, float, complex, Value - Rotation angle, specified CCW in radians, from rot_axis_from towards rot_axis_to + Rotation angle, specified counter-clockwise in radians, from the ``rot_axis_from`` parameter + towards the ``rot_axis_to`` parameter. offset : :term:`Point3DLike` mirror : bool - Mirror against YZ plane + Mirror against the YZ plane. """ __stub: Transform3DServiceStub = StubAccessor(StubType.transform3d) @classmethod def create_identity(cls): - """Create an identity transformation 3d matrix. + """Create an identity transformation 3D matrix. Returns ------- @@ -56,7 +57,7 @@ def create_identity(cls): @classmethod def create_copy(cls, transform3d): - """Create a Transform3D by copying another Transform3D. + """Create a 3D transformation by copying another 3D transformation. Returns ------- @@ -66,12 +67,13 @@ def create_copy(cls, transform3d): @classmethod def create_from_matrix(cls, matrix): - """Create from general matrix data. + """Create a 3D transformation from general matrix data. Parameters ---------- matrix : :obj:`list` of :obj:`list` of :obj:`floats` - The 4x4 array to copy from. + Array (4x4) to copy from. + Returns ------- Transform3D @@ -82,12 +84,12 @@ def create_from_matrix(cls, matrix): @classmethod def create_from_offset(cls, offset): - """Create a Transform3D with offset. + """Create a 3D transformation with an offset. Parameters ---------- offset : :term:`Point3DLike` - The vector offset. + Vector offset. Returns ------- Transform3D @@ -96,14 +98,14 @@ def create_from_offset(cls, offset): @classmethod def create_from_center_scale(cls, center, scale): - """Create a Transform3D for scaling about a point. + """Create a 3D transformation for scaling about a point. Parameters ---------- center : :term:`Point3DLike` - The center of the transformation. + Center of the transformation. scale : :obj:`float` - The scale factor of the transformation. + Scale factor of the transformation. Returns ------- @@ -115,12 +117,13 @@ def create_from_center_scale(cls, center, scale): @classmethod def create_from_angle(cls, zyx_decomposition): - """Create a Transform3D from zyx decomposition. + """Create a 3D transformation from ZYX decomposition. Parameters ---------- zyx_decomposition : :term:`Point3DLike` - ZYX decomposition. + ZYX decomposition. + Returns ------- Transform3D @@ -131,7 +134,7 @@ def create_from_angle(cls, zyx_decomposition): @classmethod def create_from_axis(cls, x, y, z): - """Create a Transform3D with rotation matrix from 3 axis. + """Create a 3D transformation with a rotation matrix from three axes. Parameters ---------- @@ -152,7 +155,7 @@ def create_from_axis(cls, x, y, z): @classmethod def create_from_axis_and_angle(cls, axis, angle): - """Create a Transform3D with axis and angle. + """Create a 3D transformation with the given axis and angle. Parameters ---------- @@ -171,7 +174,7 @@ def create_from_axis_and_angle(cls, axis, angle): @classmethod def create_from_one_axis_to_another(cls, from_axis, to_axis): - """Create a Transform3D with rotation from to axis. + """Create a 3D transformformation with rotation from an axis to an axis. Parameters ---------- @@ -190,7 +193,7 @@ def create_from_one_axis_to_another(cls, from_axis, to_axis): @classmethod def create_from_transform_2d(cls, transform, z_off): - """Create a Transform3D with Transform data. + """Create a 3D transformation with transform data. Parameters ---------- @@ -208,15 +211,15 @@ def create_from_transform_2d(cls, transform, z_off): ) def transpose(self): - """Transpose transfrom3d.""" + """Transpose the 3D transformation.""" self.__stub.Transpose(messages.edb_obj_message(self)) def invert(self): - """Invert transfrom3d.""" + """Invert the 3D transformation.""" self.__stub.Invert(messages.edb_obj_message(self)) def is_identity(self, eps, rotation): - """Get is identity of a Transform3d. + """Get identity of the 3D transformation. Parameters ---------- @@ -232,7 +235,7 @@ def is_identity(self, eps, rotation): ).value def is_equal(self, other_transform, rotation, eps): - """Equality check for two 3d transformations. + """Equality check for two #D transformations. Parameters ---------- @@ -243,7 +246,7 @@ def is_equal(self, other_transform, rotation, eps): Returns ------- :obj:`bool` - Result of equality check + Result of equality check. """ return self.__stub.IsEqual( @@ -251,17 +254,17 @@ def is_equal(self, other_transform, rotation, eps): ).value def __add__(self, other_transform): - """Add operator, concatenate two 3d transformations. + """Add operator and concatenate two 3D transformations. Parameters ---------- other_transform : Transform3D - Second transformation3D + Second 3D transformation. Returns ------- Transform - A new transformation3d object. + 3D transformation object created. """ return Transform3D( self.__stub.OperatorPlus(messages.pointer_property_message(self, other_transform)) @@ -275,7 +278,7 @@ def axis(self): @to_point3d_data def transform_point(self, point): - """Get the transform point of the Transform3d. + """Get the transform point of the 3D transformation. Parameters ---------- @@ -284,14 +287,14 @@ def transform_point(self, point): Returns ------- :term:`Point3DLike` - TransformPoint. + Transform point. """ return self.__stub.TransformPoint(messages.cpos_3d_property_message(self, point)) @property @to_point3d_data def z_y_x_rotation(self): - """:term:`Point3DLike`: ZYXRotation.""" + """:term:`Point3DLike`: ZYX rotation.""" return self.__stub.GetZYXRotation(messages.edb_obj_message(self)) @property @@ -308,7 +311,7 @@ def shift(self): @property def matrix(self): - """:obj:`list` of :obj:`list` of :obj:`floats` : Transformation matrix as a 2D 4x4 Array.""" + """:obj:`list` of :obj:`list` of :obj:`floats` : Transformation matrix as a 2D 4x4 array.""" msg = self.__stub.GetMatrix(messages.edb_obj_message(self)) matrix = [[float(_) for _ in msg.doubles[(i - 1) * 4 : i * 4]] for i in range(1, 5)] return matrix diff --git a/src/ansys/edb/core/utility/value.py b/src/ansys/edb/core/utility/value.py index c92dcfb232..3e90ffedd0 100644 --- a/src/ansys/edb/core/utility/value.py +++ b/src/ansys/edb/core/utility/value.py @@ -1,4 +1,4 @@ -"""Value Class.""" +"""Value.""" import math from ansys.api.edb.v1 import value_pb2, value_pb2_grpc @@ -15,23 +15,26 @@ class Value: Attributes ---------- val : :term:`ValueLike` - The value assigned to the new Value + Value assigned to the new value. _owner : None, :class:`Database `, :class:`Cell `, :class:`Layout `, \ :class:`ComponentDef ` Notes ----- - Values can be either constant (e.g. 1, 2.35, 7+0.3i, 23mm) or parametric (e.g. w1 + w2) + A value can be either a constant (such as ``1``, ``2.35``, ``"7+0.3i"``, and ``"23mm"``) or + parametric (such as.``w1 + w2``). - if the Value is parametric, it needs _owner set to the object that hosts the variables used. If the owner is - Cell or Layout, the expression can reference both Database variables and Cell variables. A better way to create - parametric values is to call obj_with_variables.create_value(str) which will automatically set the _owner to - the correct object. + 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 + 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. Values can be used in expressions with the following operators: - .. list-table:: Mathematical operators supported by Values + .. list-table:: **Mathematical operators supported by values** :widths: 25 25 25 :header-rows: 1 @@ -66,13 +69,13 @@ class Value: - greater than - bool - The Value will be evaluated to a constant (if it is parametric) before applying the operators. + The value is evaluated to a constant (if it is parametric) before applying the operators. """ __stub: value_pb2_grpc.ValueServiceStub = session.StubAccessor(session.StubType.value) def __init__(self, val, _owner=None): - """Construct a Value object.""" + """Initialize a value object.""" self.msg = ValueMessage() if isinstance(val, ValueMessage): self.msg = val @@ -107,90 +110,97 @@ def __str__(self): return str(complex(self.msg.constant.real, self.msg.constant.imag)) def __eq__(self, other): - """Compare if two values are equivalent by evaluated value. + """Compare this value to another value to determine if they are equivalent. Parameters ---------- other : Value - Value that will be compared to self + Value to compare. Returns ------- bool + ``True`` if the two values are equivalent, ``False`` otherwise. """ return self.equals(other) def __add__(self, other): - """Perform addition of two values. + """Add this value and another value. Parameters ---------- other : str, int, float, complex, Value + Other value to add. + Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant value wrapping either a real or complex number. """ other = conversions.to_value(other) return self.__class__(self.value + other.value) def __sub__(self, other): - """Perform subtraction of two values. + """Subtract this value from another value. Parameters ---------- other : str, int, float, complex, Value + Other value to subtract. Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant Value wrapping either a real or complex number. """ other = conversions.to_value(other) return self.__class__(self.value - other.value) def __mul__(self, other): - """Perform multiplication of two values. + """Multiply this value and another value. Parameters ---------- other : str, int, float, complex, Value + Other value to multiply. Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant Value wrapping either a real or complex number. """ other = conversions.to_value(other) return self.__class__(self.value * other.value) def __truediv__(self, other): - """Perform floating-point division of two values. + """Perform floating-point division of this value and another value. Parameters ---------- other : str, int, float, complex, Value + Other value for the floating-point division. Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant value wrapping either a real or complex number. """ other = conversions.to_value(other) return self.__class__(self.value / other.value) def __floordiv__(self, other): - """Perform division of two values and return its floor (integer part). + """Divide this value by another value and return its floor (integer part). Parameters ---------- other : str, int, float, complex, Value + Other value for the division. Returns ------- Value - this is a constant Value wrapping an integer number + Constant value wrapping an integer. """ other = conversions.to_value(other) return self.__class__(self.value // other.value) @@ -201,12 +211,12 @@ def __pow__(self, power, modulo=None): Parameters ---------- power : int, float - the exponent applied to this Value. + Exponent to apply to the value. Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant value wrapping either a real or complex number. """ return self.__class__(self.value**power) @@ -216,47 +226,54 @@ def __neg__(self): Returns ------- Value - this is a constant Value wrapping either real or complex number + Constant value wrapping either a real or complex number. """ return self.__class__(-self.value) def __gt__(self, other): - """Compare if this value is greater than another value. + """Compare this value to another to see if this value is greater. Parameters ---------- other : str, int, float, complex, Value + Other value to compare to. Returns ------- bool + ``True`` if this value is greater than the other value. """ return self.value > other.value def __lt__(self, other): - """Compare if this value is less than another value. + """Compare this value to another to see if this value is less. Parameters ---------- other : str, int, float, complex, Value + Other value to compare to. Returns ------- bool + ``True`` if this value is less than the other value. """ return self.value < other.value def equals(self, other, tolerance=1e-9): - """Check if two values are equivalent when evaluated. + """Check if this value and other value are equivalent when evaluated. Parameters ---------- other : str, int, float, complex, Value - tolerance : float, optional + Other value to compare to. + tolerance : float, default: 1e-9 + Tolerance. Returns ------- bool + `True`` if this value and the other value are equivalent when evaluated. """ try: other = conversions.to_value(other) @@ -271,55 +288,34 @@ def equals(self, other, tolerance=1e-9): @property def is_parametric(self): - """Is Value object parametric (dependent on variables). - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the value is parametric (dependent on variables).""" return not self.msg.HasField("constant") @property def is_complex(self): - """Is Value a complex number (has a non-zero imaginary part). - - Returns - ------- - bool - """ + """:obj:`bool`: Flag indicating if the the value is a complex number (has a non-zero imaginary part).""" return type(self.value) == complex @property def double(self): - """Get float from Value object. + """:obj:`float`: Float from the value object. - Returns - ------- - float - If number is complex, this returns real part. + If the number is complex, this returns the real part. """ evaluated = self.value return evaluated.real if type(evaluated) == complex else evaluated @property def complex(self): - """Get complex value from Value object. + """:obj:`complex`: Complex value from the value object. - Returns - ------- - complex - If number is real, the imaginary part will be 0. + If the number is real, the imaginary part is ``0``. """ return complex(self.value) @property def value(self): - """Evaluate to a constant and return as a float or complex. - - Returns - ------- - complex, float - """ + """:obj:`complex`: Evaluation to a constant and return as a float or complex.""" if self.is_parametric: evaluated = self.__stub.GetComplex( value_pb2.ValueTextMessage( @@ -336,10 +332,5 @@ def value(self): @property def sqrt(self): - """Compute square root of this value as a constant Value. - - Returns - ------- - Value - """ + """Square root of this value as a constant value.""" return self**0.5