diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 6827ce59b0..0000000000 --- a/.flake8 +++ /dev/null @@ -1,7 +0,0 @@ -[flake8] -exclude = venv, __init__.py, doc/_build, doc/source/examples -select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403 -count = True -max-complexity = 10 -max-line-length = 120 -statistics = True \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd516c8b39..98f29499a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,32 +10,17 @@ ci: repos: -- repo: https://github.com/psf/black - rev: 23.10.1 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!! +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.9 hooks: - - id: black - args: - - --line-length=120 + - id: ruff + - id: ruff-format - repo: https://github.com/adamchainz/blacken-docs - rev: 1.16.0 + rev: 1.19.1 hooks: - id: blacken-docs - additional_dependencies: [black==23.10.1] - -- repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - -- repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 - hooks: - - id: flake8 - args: [ - --max-line-length, "120", - ansys, codegen, doc, examples, tests - ] + additional_dependencies: [black==25.1.0] - repo: https://github.com/codespell-project/codespell rev: v2.3.0 diff --git a/doc/print_errors.py b/doc/print_errors.py index 81209d557e..ba1c3c0a37 100644 --- a/doc/print_errors.py +++ b/doc/print_errors.py @@ -1,4 +1,5 @@ """Read errors output from a Sphinx build and remove duplicate groups.""" + import os import pathlib import sys diff --git a/pyproject.toml b/pyproject.toml index 54945f5152..9c9eb0f418 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,14 +89,131 @@ Source = "https://github.com/ansys/pyedb" Discussions = "https://github.com/ansys/pyedb/discussions" Releases = "https://github.com/ansys/pyedb/releases" -[tool.black] -line-length = 88 - -[tool.isort] -profile = "black" -force_sort_within_sections = true -default_section = "THIRDPARTY" -src_paths = ["doc", "src", "tests"] +[tool.ruff] +line-length = 120 +fix = true + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +docstring-code-format = true + +[tool.ruff.lint] +select = [ + "D", # pydocstyle, see https://docs.astral.sh/ruff/rules/#pydocstyle-d + "E", # pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w + "F", # pyflakes, see https://docs.astral.sh/ruff/rules/#pyflakes-f + "I", # isort, see https://docs.astral.sh/ruff/rules/#isort-i + "N", # pep8-naming, see https://docs.astral.sh/ruff/rules/#pep8-naming-n + "PTH", # flake8-use-pathlib, https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth + "TD", # flake8-todos, https://docs.astral.sh/ruff/rules/#flake8-todos-td + "W", # pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w +] +ignore = [ + # "D" - pydocstyle, see https://docs.astral.sh/ruff/rules/#pydocstyle-d + "D100", # undocumented-public-module + "D101", # undocumented-public-class + "D102", # undocumented-public-method + "D103", # undocumented-public-function + "D104", # undocumented-public-package + "D105", # undocumented-magic-method + "D106", # undocumented-public-nested-class + "D200", # unnecessary-multiline-docstring + "D202", # blank-line-after-function + "D205", # missing-blank-line-after-summary + "D208", # over-indentation + "D209", # new-line-after-last-paragraph + "D210", # surrounding-whitespace + "D214", # overindented-section + "D215", # overindented-section-underline + "D301", # escape-sequence-in-docstring + "D400", # missing-trailing-period + "D401", # non-imperative-mood + "D403", # first-word-uncapitalized + "D404", # docstring-starts-with-this + "D405", # non-capitalized-section-name + "D406", # missing-new-line-after-section-name + "D407", # missing-dashed-underline-after-section + "D409", # mismatched-section-underline-length + "D410", # no-blank-line-after-section + "D411", # no-blank-line-before-section + "D412", # blank-lines-between-header-and-content + "D414", # empty-docstring-section + "D419", # empty-docstring + + # "E" - pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w + "E402", # module-import-not-at-top-of-file + "E711", # none-comparison + "E713", # not-in-test + "E721", # type-comparison + "E722", # bare-except + "E731", # lambda-assignment + "E741", # ambiguous-variable-name + "E743", # ambiguous-function-name + + # "F" - pyflakes, see https://docs.astral.sh/ruff/rules/#pyflakes-f + "F401", # unused-import + "F523", # string-dot-format-extra-positional-arguments + "F541", # f-string-missing-placeholders + "F811", # redefined-while-unused + "F821", # undefined-name + "F841", # unused-variable + + # "N" - pep8-naming, see https://docs.astral.sh/ruff/rules/#pep8-naming-n + "N801", # invalid-class-name + "N802", # invalid-function-name + "N803", # invalid-argument-name + "N806", # non-lowercase-variable-in-function + "N812", # lowercase-imported-as-non-lowercase + "N813", # camelcase-imported-as-lowercase + "N815", # mixed-case-variable-in-class-scope + "N817", # camelcase-imported-as-acronym + "N818", # error-suffix-on-exception-name + "N999", # invalid-module-name + + # "PTH" - flake8-use-pathlib, https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth + "PTH100", # os-path-abspath + "PTH101", # os-chmod + "PTH102", # os-mkdir + "PTH103", # os-makedirs + "PTH104", # os-rename + "PTH107", # os-remove + "PTH108", # os-unlink + "PTH110", # os-path-exists + "PTH111", # os-path-expanduser + "PTH112", # os-path-isdir + "PTH113", # os-path-isfile + "PTH116", # os-stat + "PTH118", # os-path-join + "PTH119", # os-path-basename + "PTH120", # os-path-dirname + "PTH122", # os-path-splitext + "PTH123", # builtin-open + "PTH202", # os-path-getsize + + # "TD" - flake8-todos, https://docs.astral.sh/ruff/rules/#flake8-todos-td + "TD001", # invalid-todo-tag + "TD002", # missing-todo-author + "TD003", # missing-todo-link + "TD004", # missing-todo-colon + "TD005", # missing-todo-description + "TD006", # invalid-todo-capitalization + + # "W" - pycodestyle, see https://docs.astral.sh/ruff/rules/#pycodestyle-e-w + "W605" # invalid-escape-sequence +] + +[tool.ruff.lint.pydocstyle] +# Use Numpy-style docstrings. +convention = "numpy" + +[tool.ruff.lint.isort] +force-sort-within-sections = true +known-first-party = ["doc", "src", "tests"] +combine-as-imports = true + +[tool.ruff.lint.mccabe] +max-complexity = 10 [tool.codespell] skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,*.a3dcomp,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,*.cdb,*.CDB,build,./factory/*,PKG-INFO,*.mypy_cache/*,./_unused/*,pyproject.toml' diff --git a/src/pyedb/configuration/cfg_components.py b/src/pyedb/configuration/cfg_components.py index df5e35b2d4..6abbc2c68b 100644 --- a/src/pyedb/configuration/cfg_components.py +++ b/src/pyedb/configuration/cfg_components.py @@ -145,8 +145,8 @@ def _retrieve_ic_die_properties_from_edb(self): def _set_ic_die_properties_to_edb(self): from ansys.edb.core.definition.die_property import ( DieOrientation as GrpcDieOrientation, + DieType as GrpcDieType, ) - from ansys.edb.core.definition.die_property import DieType as GrpcDieType from ansys.edb.core.utility.value import Value as GrpcValue cp = self.pyedb_obj.component_property diff --git a/src/pyedb/configuration/cfg_padstacks.py b/src/pyedb/configuration/cfg_padstacks.py index 35cb846bc2..4ab53a3b23 100644 --- a/src/pyedb/configuration/cfg_padstacks.py +++ b/src/pyedb/configuration/cfg_padstacks.py @@ -103,8 +103,6 @@ def __init__(self, parent): def get_solder_ball_definition(self): from ansys.edb.core.definition.solder_ball_property import ( SolderballPlacement as GrpcSolderballPlacement, - ) - from ansys.edb.core.definition.solder_ball_property import ( SolderballShape as GrpcSolderballShape, ) @@ -256,8 +254,6 @@ def get_pad_parameters_from_edb(self): def set_pad_parameters_to_edb(self, param): from ansys.edb.core.definition.padstack_def_data import ( PadGeometryType as GrpcPadGeometryType, - ) - from ansys.edb.core.definition.padstack_def_data import ( PadType as GrpcPadType, ) from ansys.edb.core.utility.value import Value as GrpcValue diff --git a/src/pyedb/configuration/cfg_ports_sources.py b/src/pyedb/configuration/cfg_ports_sources.py index afc5197a2f..68ee72eff0 100644 --- a/src/pyedb/configuration/cfg_ports_sources.py +++ b/src/pyedb/configuration/cfg_ports_sources.py @@ -776,8 +776,6 @@ def set_parameters_to_edb(self, edb_primitives): from ansys.edb.core.geometry.point_data import PointData as GrpcPointData from ansys.edb.core.terminal.edge_terminal import ( EdgeTerminal as GrpcEdgeTerminal, - ) - from ansys.edb.core.terminal.edge_terminal import ( PrimitiveEdge as GrpcPrimitiveEdge, ) from ansys.edb.core.utility.value import Value as GrpcValue diff --git a/src/pyedb/dotnet/clr_module.py b/src/pyedb/dotnet/clr_module.py index be541c5dd3..fcd7558482 100644 --- a/src/pyedb/dotnet/clr_module.py +++ b/src/pyedb/dotnet/clr_module.py @@ -50,8 +50,7 @@ def custom_show_warning(message, category, filename, lineno, file=None, line=Non # TODO: Fall backing to dotnetcore2 should be removed in a near future. except Exception: warnings.warn( - "Unable to set .NET root and locate the runtime configuration file. " - "Falling back to using dotnetcore2." + "Unable to set .NET root and locate the runtime configuration file. Falling back to using dotnetcore2." ) warnings.warn(LINUX_WARNING) diff --git a/src/pyedb/dotnet/database/Variables.py b/src/pyedb/dotnet/database/Variables.py index 59a9ccc909..535cddd26f 100644 --- a/src/pyedb/dotnet/database/Variables.py +++ b/src/pyedb/dotnet/database/Variables.py @@ -35,8 +35,10 @@ """ -from __future__ import absolute_import # noreorder -from __future__ import division +from __future__ import ( + absolute_import, # noreorder + division, +) import os import re @@ -490,13 +492,13 @@ def decompose(self, variable_value): # pragma: no cover -------- >>> hfss = Hfss() >>> print(hfss.variable_manager.decompose("5mm")) - >>> (5.0, 'mm') + >>> (5.0, "mm") >>> hfss["v1"] = "3N" >>> print(hfss.variable_manager.decompose("v1")) - >>> (3.0, 'N') + >>> (3.0, "N") >>> hfss["v2"] = "2*v1" >>> print(hfss.variable_manager.decompose("v2")) - >>> (6.0, 'N') + >>> (6.0, "N") """ if variable_value in self.independent_variable_names: val, unit = decompose_variable_value(self[variable_value].expression) @@ -1006,8 +1008,13 @@ def set_variable( creating the property if it does not already exist. Also make it read-only and hidden and add a description. - >>> aedtapp.variable_manager.set_variable(variable_name="p2", expression="10mm", readonly=True, hidden=True, - ... description="This is the description of this variable.") + >>> aedtapp.variable_manager.set_variable( + ... variable_name="p2", + ... expression="10mm", + ... readonly=True, + ... hidden=True, + ... description="This is the description of this variable.", + ... ) Set the value of the project variable ``$p1`` to ``"30mm"``, creating the variable if it does not exist. @@ -1704,7 +1711,7 @@ def decompose(self): # pragma: no cover >>> hfss = Hfss() >>> hfss["v1"] = "3N" >>> print(hfss.variable_manager["v1"].decompose("v1")) - >>> (3.0, 'N') + >>> (3.0, "N") """ return decompose_variable_value(self.evaluated_value) @@ -1730,9 +1737,9 @@ def rescale_to(self, units): # pragma: no cover """ new_unit_system = unit_system(units) - assert ( - new_unit_system == self.unit_system - ), "New unit system {0} is inconsistent with the current unit system {1}." + assert new_unit_system == self.unit_system, ( + "New unit system {0} is inconsistent with the current unit system {1}." + ) self._units = units return self @@ -1755,9 +1762,9 @@ def format(self, format): # pragma: no cover >>> from pyedb.dotnet.database.Variables import Variable >>> v = Variable("10W") - >>> assert v.format("f") == '10.000000W' - >>> assert v.format("06.2f") == '010.00W' - >>> assert v.format("6.2f") == ' 10.00W' + >>> assert v.format("f") == "10.000000W" + >>> assert v.format("06.2f") == "010.00W" + >>> assert v.format("6.2f") == " 10.00W" """ return ("{0:" + format + "}{1}").format(self.numeric_value, self._units) @@ -1848,9 +1855,9 @@ def __add__(self, other): # pragma: no cover """ assert isinstance(other, Variable), "You can only add a variable with another variable." - assert ( - self.unit_system == other.unit_system - ), "Only ``Variable`` objects with the same unit system can be added." + assert self.unit_system == other.unit_system, ( + "Only ``Variable`` objects with the same unit system can be added." + ) result_value = self.value + other.value result_units = SI_UNITS[self.unit_system] # If the units of the two operands are different, return SI-Units @@ -1889,9 +1896,9 @@ def __sub__(self, other): # pragma: no cover """ assert isinstance(other, Variable), "You can only subtract a variable from another variable." - assert ( - self.unit_system == other.unit_system - ), "Only ``Variable`` objects with the same unit system can be subtracted." + assert self.unit_system == other.unit_system, ( + "Only ``Variable`` objects with the same unit system can be subtracted." + ) result_value = self.value - other.value result_units = SI_UNITS[self.unit_system] # If the units of the two operands are different, return SI-Units diff --git a/src/pyedb/dotnet/database/cell/layout.py b/src/pyedb/dotnet/database/cell/layout.py index 72dd09ca45..c756fb463f 100644 --- a/src/pyedb/dotnet/database/cell/layout.py +++ b/src/pyedb/dotnet/database/cell/layout.py @@ -23,6 +23,7 @@ """ This module contains these classes: `EdbLayout` and `Shape`. """ + from typing import Union from pyedb.dotnet.database.cell.hierarchy.component import EDBComponent diff --git a/src/pyedb/dotnet/database/cell/primitive/primitive.py b/src/pyedb/dotnet/database/cell/primitive/primitive.py index b309a8b11b..0057ea00fd 100644 --- a/src/pyedb/dotnet/database/cell/primitive/primitive.py +++ b/src/pyedb/dotnet/database/cell/primitive/primitive.py @@ -37,8 +37,8 @@ class Primitive(Connectable): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_prim = edb.modeler.primitives[0] - >>> edb_prim.is_void # Class Property - >>> edb_prim.IsVoid() # EDB Object Property + >>> edb_prim.is_void # Class Property + >>> edb_prim.IsVoid() # EDB Object Property """ def __init__(self, pedb, edb_object): diff --git a/src/pyedb/dotnet/database/components.py b/src/pyedb/dotnet/database/components.py index ce8c054dd8..26f4779b52 100644 --- a/src/pyedb/dotnet/database/components.py +++ b/src/pyedb/dotnet/database/components.py @@ -20,9 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""This module contains the `Components` class. +"""This module contains the `Components` class.""" -""" import codecs import json import math @@ -541,16 +540,17 @@ def get_component_placement_vector( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector( - ... mounted_component=mounted_cmp, - ... hosting_component=hosting_cmp, - ... mounted_component_pin1="A12", - ... mounted_component_pin2="A14", - ... hosting_component_pin1="A12", - ... hosting_component_pin2="A14") + ... mounted_component=mounted_cmp, + ... hosting_component=hosting_cmp, + ... mounted_component_pin1="A12", + ... mounted_component_pin2="A14", + ... hosting_component_pin1="A12", + ... hosting_component_pin2="A14", + ... ) """ m_pin1_pos = [0.0, 0.0] m_pin2_pos = [0.0, 0.0] @@ -1255,7 +1255,7 @@ def deactivate_rlc_component(self, component=None, create_circuit_port=False, pe Examples -------- >>> from pyedb import Edb - >>> edb_file = r'C:\my_edb_file.aedb' + >>> edb_file = r"C:\my_edb_file.aedb" >>> edb = Edb(edb_file) >>> for cmp in list(edb.components.instances.keys()): >>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False) @@ -1729,9 +1729,9 @@ def set_component_model(self, componentname, model_type="Spice", modelpath=None, >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") - >>> edbapp.components.set_component_model("A1", model_type="Spice", - ... modelpath="pathtospfile", - ... modelname="spicemodelname") + >>> edbapp.components.set_component_model( + ... "A1", model_type="Spice", modelpath="pathtospfile", modelname="spicemodelname" + ... ) """ if not modelname: @@ -2131,9 +2131,7 @@ def set_component_rlc( >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") - >>> edbapp.components.set_component_rlc( - ... "R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False - ... ) + >>> edbapp.components.set_component_rlc("R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False) """ if res_value is None and ind_value is None and cap_value is None: diff --git a/src/pyedb/dotnet/database/dotnet/database.py b/src/pyedb/dotnet/database/dotnet/database.py index 512e667db3..7750d3d40d 100644 --- a/src/pyedb/dotnet/database/dotnet/database.py +++ b/src/pyedb/dotnet/database/dotnet/database.py @@ -21,6 +21,7 @@ # SOFTWARE. """Database.""" + import os import re import sys diff --git a/src/pyedb/dotnet/database/edb_data/nets_data.py b/src/pyedb/dotnet/database/edb_data/nets_data.py index efde838c2e..898eb517ac 100644 --- a/src/pyedb/dotnet/database/edb_data/nets_data.py +++ b/src/pyedb/dotnet/database/edb_data/nets_data.py @@ -37,8 +37,8 @@ class EDBNetsData(NetDotNet): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_net = edb.nets.nets["GND"] - >>> edb_net.name # Class Property - >>> edb_net.name # EDB Object Property + >>> edb_net.name # Class Property + >>> edb_net.name # EDB Object Property """ def __init__(self, raw_net, core_app): @@ -220,7 +220,7 @@ class EDBExtendedNetData(ExtendedNetDotNet): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_extended_net = edb.nets.extended_nets["GND"] - >>> edb_extended_net.name # Class Property + >>> edb_extended_net.name # Class Property """ def __init__(self, core_app, raw_extended_net=None): diff --git a/src/pyedb/dotnet/database/edb_data/primitives_data.py b/src/pyedb/dotnet/database/edb_data/primitives_data.py index 458781c2d6..e3edbff9af 100644 --- a/src/pyedb/dotnet/database/edb_data/primitives_data.py +++ b/src/pyedb/dotnet/database/edb_data/primitives_data.py @@ -358,9 +358,9 @@ class EDBArcs(object): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> prim_arcs = edb.modeler.primitives[0].arcs - >>> prim_arcs.center # arc center - >>> prim_arcs.points # arc point list - >>> prim_arcs.mid_point # arc mid point + >>> prim_arcs.center # arc center + >>> prim_arcs.points # arc point list + >>> prim_arcs.mid_point # arc mid point """ def __init__(self, app, arc): diff --git a/src/pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py b/src/pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py index a8363fffd3..eb50089663 100644 --- a/src/pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py +++ b/src/pyedb/dotnet/database/edb_data/raptor_x_simulation_setup_data.py @@ -85,11 +85,13 @@ def add_frequency_sweep(self, name=None, frequency_sweep=None): Examples -------- >>> setup1 = edbapp.create_hfss_setup("setup1") - >>> setup1.add_frequency_sweep(frequency_sweep=[ - ... ["linear count", "0", "1kHz", 1], - ... ["log scale", "1kHz", "0.1GHz", 10], - ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ... ]) + >>> setup1.add_frequency_sweep( + ... frequency_sweep=[ + ... ["linear count", "0", "1kHz", 1], + ... ["log scale", "1kHz", "0.1GHz", 10], + ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], + ... ] + ... ) """ if name in self.frequency_sweeps: return False @@ -234,9 +236,7 @@ def net_settings_options(self, value): if isinstance(value, list): self._advanced_settings.NetSettingsOptions = convert_py_list_to_net_list(value) else: - self.logger.error( - f"RaptorX setup net_settings_options input setter must be a list. " f"Provided value {value}" - ) + self.logger.error(f"RaptorX setup net_settings_options input setter must be a list. Provided value {value}") @property def override_shrink_fac(self): @@ -276,7 +276,7 @@ def use_accelerate_via_extraction(self, value): self._advanced_settings.UseAccelerateViaExtraction = value else: self.logger.error( - "RaptorX setup use_accelerate_via_extraction setter input must be boolean." f"Provided value {value}" + f"RaptorX setup use_accelerate_via_extraction setter input must be boolean.Provided value {value}" ) @property @@ -290,7 +290,7 @@ def use_auto_removal_sliver_poly(self, value): self._advanced_settings.UseAutoRemovalSliverPoly = value else: self.logger.error( - f"RaptorX setup use_auto_removal_sliver_poly setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_auto_removal_sliver_poly setter must be a boolean. Provided value {value}" ) @property @@ -334,7 +334,7 @@ def use_eliminate_slit_per_holes(self, value): self._advanced_settings.UseEliminateSlitPerHoles = value else: self.logger.error( - f"RaptorX setup use_eliminate_slit_per_holes setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_eliminate_slit_per_holes setter must be a boolean. Provided value {value}" ) @property @@ -350,7 +350,7 @@ def use_enable_advanced_cap_effects(self, value): self._advanced_settings.UseEnableAdvancedCapEffects = value else: self.logger.error( - f"RaptorX setup use_enable_advanced_cap_effects setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_enable_advanced_cap_effects setter must be a boolean. Provided value {value}" ) @property @@ -366,7 +366,7 @@ def use_enable_etch_transform(self, value): self._advanced_settings.UseEnableEtchTransform = value else: self.logger.error( - f"RaptorX setup use_enable_etch_transform setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_enable_etch_transform setter must be a boolean. Provided value {value}" ) @property @@ -382,7 +382,7 @@ def use_enable_hybrid_extraction(self, value): self._advanced_settings.UseEnableHybridExtraction = value else: self.logger.error( - f"RaptorX setup use_enable_hybrid_extraction setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_enable_hybrid_extraction setter must be a boolean. Provided value {value}" ) @property @@ -414,7 +414,7 @@ def use_extract_floating_metals_dummy(self, value): self._advanced_settings.UseExtractFloatingMetalsDummy = value else: self.logger.error( - f"RaptorX setup use_extract_floating_metals_dummy setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_extract_floating_metals_dummy setter must be a boolean. Provided value {value}" ) @property @@ -430,8 +430,7 @@ def use_extract_floating_metals_floating(self, value): self._advanced_settings.UseExtractFloatingMetalsFloating = value else: self.logger.error( - f"RaptorX setup use_extract_floating_metals_floating setter must be a boolean. " - f"Provided value {value}" + f"RaptorX setup use_extract_floating_metals_floating setter must be a boolean. Provided value {value}" ) @property @@ -493,7 +492,7 @@ def use_plane_projection_factor(self, value): self._advanced_settings.UsePlaneProjectionFactor = value else: self.logger.error( - f"RaptorX setup use_plane_projection_factor setter must be a boolean. " f"Provided value {value}" + f"RaptorX setup use_plane_projection_factor setter must be a boolean. Provided value {value}" ) @property @@ -506,4 +505,4 @@ def use_relaxed_z_axis(self, value): if isinstance(value, bool): self._advanced_settings.UseRelaxedZAxis = value else: - self.logger.error(f"RaptorX setup use_relaxed_z_axis setter must be a boolean. " f"Provided value {value}") + self.logger.error(f"RaptorX setup use_relaxed_z_axis setter must be a boolean. Provided value {value}") diff --git a/src/pyedb/dotnet/database/edb_data/simulation_configuration.py b/src/pyedb/dotnet/database/edb_data/simulation_configuration.py index f907d1175b..102ff16e52 100644 --- a/src/pyedb/dotnet/database/edb_data/simulation_configuration.py +++ b/src/pyedb/dotnet/database/edb_data/simulation_configuration.py @@ -2132,7 +2132,7 @@ class SimulationConfiguration(object): Defined the radiation box type, Conformal, Bounding box and ConvexHull are supported (HFSS only). - >>> sim_setup.max_num_passes= 30 + >>> sim_setup.max_num_passes = 30 Default value is 30, specify the maximum number of adaptive passes (only HFSS). Reasonable high value is recommended to force the solver reaching the convergence criteria. @@ -2147,7 +2147,7 @@ class SimulationConfiguration(object): local minima. >>> from dotnet.generic.constants import BasisOrder - >>> sim_setup.basis_order = BasisOrder.Single + >>> sim_setup.basis_order = BasisOrder.Single Select the order basis (HFSS only), Zero, Single, Double and Mixed are supported. For Signal integrity Single or Mixed should be used. @@ -2229,7 +2229,7 @@ class SimulationConfiguration(object): Activate the loop resistance usage per pin when ``True`` - >>> sim_setup.dc_via_report_path = 'C:\\temp\\via_report_file' + >>> sim_setup.dc_via_report_path = "C:\\temp\\via_report_file" Define the via report path file. diff --git a/src/pyedb/dotnet/database/hfss.py b/src/pyedb/dotnet/database/hfss.py index d8032760c4..3fc3ade8e7 100644 --- a/src/pyedb/dotnet/database/hfss.py +++ b/src/pyedb/dotnet/database/hfss.py @@ -23,6 +23,7 @@ """ This module contains the ``EdbHfss`` class. """ + import math from pyedb.dotnet.database.edb_data.hfss_extent_info import HfssExtentInfo @@ -174,8 +175,8 @@ def create_circuit_port_on_pin(self, pos_pin, neg_pin, impedance=50, port_name=N >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_circuit_port_on_pin(pins[0], pins[1],50,"port_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_circuit_port_on_pin(pins[0], pins[1], 50, "port_name") Returns ------- @@ -211,8 +212,8 @@ def create_voltage_source_on_pin(self, pos_pin, neg_pin, voltage_value=3.3, phas >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1],50,"source_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name") """ return self._pedb.siwave.create_voltage_source_on_pin(pos_pin, neg_pin, voltage_value, phase_value, source_name) @@ -242,8 +243,8 @@ def create_current_source_on_pin(self, pos_pin, neg_pin, current_value=0.1, phas >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1],50,"source_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1], 50, "source_name") """ return self._pedb.siwave.create_current_source_on_pin(pos_pin, neg_pin, current_value, phase_value, source_name) @@ -272,8 +273,8 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1],50,"res_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1], 50, "res_name") """ return self._pedb.siwave.create_resistor_on_pin(pos_pin, neg_pin, rvalue, resistor_name) diff --git a/src/pyedb/dotnet/database/layout_validation.py b/src/pyedb/dotnet/database/layout_validation.py index 50b394425c..8de63136d1 100644 --- a/src/pyedb/dotnet/database/layout_validation.py +++ b/src/pyedb/dotnet/database/layout_validation.py @@ -153,7 +153,7 @@ def disjoint_nets( Examples -------- - >>> renamed_nets = edb.layout_validation.disjoint_nets(["GND","Net2"]) + >>> renamed_nets = edb.layout_validation.disjoint_nets(["GND", "Net2"]) """ timer_start = self._pedb._logger.reset_timer() diff --git a/src/pyedb/dotnet/database/materials.py b/src/pyedb/dotnet/database/materials.py index b39574c283..c4d293d570 100644 --- a/src/pyedb/dotnet/database/materials.py +++ b/src/pyedb/dotnet/database/materials.py @@ -244,9 +244,7 @@ def dc_permittivity(self, value: Union[int, float]): if self.__dc_model and value: self.__dc_model.SetDCRelativePermitivity(value) else: - self.__edb.logger.error( - f"DC permittivity cannot be updated in material without DC model or value {value}." f"" - ) + self.__edb.logger.error(f"DC permittivity cannot be updated in material without DC model or value {value}.") @property def dielectric_model_frequency(self): diff --git a/src/pyedb/dotnet/database/modeler.py b/src/pyedb/dotnet/database/modeler.py index 33d8d99a1b..fa0b94ca23 100644 --- a/src/pyedb/dotnet/database/modeler.py +++ b/src/pyedb/dotnet/database/modeler.py @@ -23,6 +23,7 @@ """ This module contains these classes: `EdbLayout` and `Shape`. """ + import math import warnings @@ -386,7 +387,7 @@ def get_polygon_points(self, polygon): -------- >>> poly = database.modeler.get_polygons_by_layer("GND") - >>> points = database.modeler.get_polygon_points(poly[0]) + >>> points = database.modeler.get_polygon_points(poly[0]) """ points = [] diff --git a/src/pyedb/dotnet/database/nets.py b/src/pyedb/dotnet/database/nets.py index df20282c99..af344f3e7d 100644 --- a/src/pyedb/dotnet/database/nets.py +++ b/src/pyedb/dotnet/database/nets.py @@ -574,7 +574,7 @@ def delete_nets(self, netlist): Examples -------- - >>> deleted_nets = database.nets.delete(["Net1","Net2"]) + >>> deleted_nets = database.nets.delete(["Net1", "Net2"]) """ warnings.warn("Use :func:`delete` method instead.", DeprecationWarning) return self.delete(netlist=netlist) @@ -595,7 +595,7 @@ def delete(self, netlist): Examples -------- - >>> deleted_nets = database.nets.delete(["Net1","Net2"]) + >>> deleted_nets = database.nets.delete(["Net1", "Net2"]) """ if isinstance(netlist, str): netlist = [netlist] @@ -736,7 +736,7 @@ def find_and_fix_disjoint_nets( Examples -------- - >>> renamed_nets = database.nets.find_and_fix_disjoint_nets(["GND","Net2"]) + >>> renamed_nets = database.nets.find_and_fix_disjoint_nets(["GND", "Net2"]) """ warnings.warn("Use new function :func:`edb.layout_validation.disjoint_nets` instead.", DeprecationWarning) return self._pedb.layout_validation.disjoint_nets( diff --git a/src/pyedb/dotnet/database/padstack.py b/src/pyedb/dotnet/database/padstack.py index 2ea281b541..d8cbaa501d 100644 --- a/src/pyedb/dotnet/database/padstack.py +++ b/src/pyedb/dotnet/database/padstack.py @@ -23,6 +23,7 @@ """ This module contains the `EdbPadstacks` class. """ + import math import warnings @@ -704,8 +705,9 @@ def set_all_antipad_value(self, value): ) else: # pragma no cover self._logger.error( - "Failed to reassign anti-pad value {} on Pads-stack definition {}," - " layer{}".format(str(value), padstack.edb_padstack.GetName(), layer) + "Failed to reassign anti-pad value {} on Pads-stack definition {}, layer{}".format( + str(value), padstack.edb_padstack.GetName(), layer + ) ) all_succeed = False padstack.edb_padstack.SetData(cloned_padstack_data) diff --git a/src/pyedb/dotnet/database/siwave.py b/src/pyedb/dotnet/database/siwave.py index 4cc5f6c7bf..12b56bd933 100644 --- a/src/pyedb/dotnet/database/siwave.py +++ b/src/pyedb/dotnet/database/siwave.py @@ -24,6 +24,7 @@ This module contains these classes: ``CircuitPort``, ``CurrentSource``, ``EdbSiwave``, ``PinGroup``, ``ResistorSource``, ``Source``, ``SourceType``, and ``VoltageSource``. """ + import os import time @@ -476,8 +477,8 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.siwave.create_resistor_on_pin(pins[0], pins[1],50,"res_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.siwave.create_resistor_on_pin(pins[0], pins[1], 50, "res_name") """ resistor = ResistorSource() resistor.positive_node.net = pos_pin.GetNet().GetName() @@ -618,7 +619,7 @@ def create_voltage_source_on_net( >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> edb.siwave.create_voltage_source_on_net("U2A5","V1P5_S3","U2A5","GND",3.3,0,"source_name") + >>> edb.siwave.create_voltage_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 3.3, 0, "source_name") """ if not negative_component_name: negative_component_name = positive_component_name diff --git a/src/pyedb/dotnet/database/stackup.py b/src/pyedb/dotnet/database/stackup.py index 6955facf21..9b0510bcff 100644 --- a/src/pyedb/dotnet/database/stackup.py +++ b/src/pyedb/dotnet/database/stackup.py @@ -1138,7 +1138,7 @@ def flip_design(self): Examples -------- - >>> edb = Edb(edbpath=targetfile, edbversion="2021.2") + >>> edb = Edb(edbpath=targetfile, edbversion="2021.2") >>> edb.stackup.flip_design() >>> edb.save() >>> edb.close_edb() @@ -1361,22 +1361,28 @@ def place_in_layout( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector( - ... mounted_component=mounted_cmp, - ... hosting_component=hosting_cmp, - ... mounted_component_pin1="A12", - ... mounted_component_pin2="A14", - ... hosting_component_pin1="A12", - ... hosting_component_pin2="A14") - >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x=vector[0], - ... offset_y=vector[1], flipped_stackup=False, place_on_top=True, - ... ) + ... mounted_component=mounted_cmp, + ... hosting_component=hosting_cmp, + ... mounted_component_pin1="A12", + ... mounted_component_pin2="A14", + ... hosting_component_pin1="A12", + ... hosting_component_pin2="A14", + ... ) + >>> edb2.stackup.place_in_layout( + ... edb1.active_cell, + ... angle=0.0, + ... offset_x=vector[0], + ... offset_y=vector[1], + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ # if flipped_stackup and place_on_top or (not flipped_stackup and not place_on_top): self.adjust_solder_dielectrics() @@ -1458,13 +1464,18 @@ def place_in_layout_3d_placement( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") - >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb2.stackup.place_in_layout( + ... edb1.active_cell, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ _angle = angle * math.pi / 180.0 @@ -1597,13 +1608,18 @@ def place_instance( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") - >>> edb1.stackup.place_instance(edb2, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb1.stackup.place_instance( + ... edb2, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ _angle = angle * math.pi / 180.0 @@ -1741,11 +1757,16 @@ def place_a3dcomp_3d_placement( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> a3dcomp_path = "connector.a3dcomp" - >>> edb1.stackup.place_a3dcomp_3d_placement(a3dcomp_path, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb1.stackup.place_a3dcomp_3d_placement( + ... a3dcomp_path, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ zero_data = self._edb_value(0.0) one_data = self._edb_value(1.0) @@ -1800,7 +1821,7 @@ def residual_copper_area_per_layer(self): Examples -------- - >>> edb = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb.stackup.residual_copper_area_per_layer() """ temp_data = {name: 0 for name, _ in self.signal_layers.items()} diff --git a/src/pyedb/dotnet/database/utilities/heatsink.py b/src/pyedb/dotnet/database/utilities/heatsink.py index b653faf652..df543e231b 100644 --- a/src/pyedb/dotnet/database/utilities/heatsink.py +++ b/src/pyedb/dotnet/database/utilities/heatsink.py @@ -1,5 +1,4 @@ class HeatSink: - """Heatsink model description. Parameters diff --git a/src/pyedb/dotnet/database/utilities/simulation_setup.py b/src/pyedb/dotnet/database/utilities/simulation_setup.py index 48ad455b13..6d80fee9d3 100644 --- a/src/pyedb/dotnet/database/utilities/simulation_setup.py +++ b/src/pyedb/dotnet/database/utilities/simulation_setup.py @@ -371,11 +371,13 @@ def add_frequency_sweep(self, name=None, frequency_sweep=None): Examples -------- >>> setup1 = edbapp.create_siwave_syz_setup("setup1") - >>> setup1.add_frequency_sweep(frequency_sweep=[ - ... ["linear count", "0", "1kHz", 1], - ... ["log scale", "1kHz", "0.1GHz", 10], - ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ... ]) + >>> setup1.add_frequency_sweep( + ... frequency_sweep=[ + ... ["linear count", "0", "1kHz", 1], + ... ["log scale", "1kHz", "0.1GHz", 10], + ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], + ... ] + ... ) """ warnings.warn("`create_component_from_pins` is deprecated. Use `add_sweep` method instead.", DeprecationWarning) return self.add_sweep(name, frequency_sweep) diff --git a/src/pyedb/dotnet/edb.py b/src/pyedb/dotnet/edb.py index c24154535b..1e2566f420 100644 --- a/src/pyedb/dotnet/edb.py +++ b/src/pyedb/dotnet/edb.py @@ -25,6 +25,7 @@ This module is implicitly loaded in HFSS 3D Layout when launched. """ + from itertools import combinations import os from pathlib import Path @@ -42,7 +43,6 @@ from pyedb.configuration.configuration import Configuration import pyedb.dotnet -from pyedb.dotnet.database.Variables import decompose_variable_value from pyedb.dotnet.database.cell.layout import Layout from pyedb.dotnet.database.cell.terminal.terminal import Terminal from pyedb.dotnet.database.components import Components @@ -92,6 +92,7 @@ SiwaveDCSimulationSetup, SiwaveSimulationSetup, ) +from pyedb.dotnet.database.Variables import decompose_variable_value from pyedb.generic.constants import AEDT_UNITS, SolverType, unit_converter from pyedb.generic.general_methods import ( generate_unique_name, @@ -155,19 +156,19 @@ class Edb(Database): Add a new variable named "s1" to the ``Edb`` instance. - >>> app['s1'] = "0.25 mm" - >>> app['s1'].tofloat + >>> app["s1"] = "0.25 mm" + >>> app["s1"].tofloat >>> 0.00025 - >>> app['s1'].tostring + >>> app["s1"].tostring >>> "0.25mm" or add a new parameter with description: - >>> app['s2'] = ["20um", "Spacing between traces"] - >>> app['s2'].value + >>> app["s2"] = ["20um", "Spacing between traces"] + >>> app["s2"].value >>> 1.9999999999999998e-05 - >>> app['s2'].description - >>> 'Spacing between traces' + >>> app["s2"].description + >>> "Spacing between traces" Create an ``Edb`` object and open the specified project. @@ -1959,7 +1960,7 @@ def cutout( Examples -------- >>> from pyedb import Edb - >>> edb = Edb(r'C:\\test.aedb', edbversion="2022.2") + >>> edb = Edb(r"C:\\test.aedb", edbversion="2022.2") >>> edb.logger.info_timer("Edb Opening") >>> edb.logger.reset_timer() >>> start = time.time() @@ -1969,7 +1970,7 @@ def cutout( >>> signal_list.append(net) >>> power_list = ["PGND"] >>> edb.cutout(signal_list=signal_list, reference_list=power_list, extent_type="Conforming") - >>> end_time = str((time.time() - start)/60) + >>> end_time = str((time.time() - start) / 60) >>> edb.logger.info("Total legacy cutout time in min %s", end_time) >>> edb.nets.plot(signal_list, None, color_by_net=True) >>> edb.nets.plot(power_list, None, color_by_net=True) @@ -2619,7 +2620,7 @@ def create_cutout_multithread( Examples -------- >>> from pyedb import Edb - >>> edb = Edb(r'C:\\test.aedb', edbversion="2022.2") + >>> edb = Edb(r"C:\\test.aedb", edbversion="2022.2") >>> edb.logger.info_timer("Edb Opening") >>> edb.logger.reset_timer() >>> start = time.time() @@ -2629,7 +2630,7 @@ def create_cutout_multithread( >>> signal_list.append(net) >>> power_list = ["PGND"] >>> edb.create_cutout_multithread(signal_list=signal_list, reference_list=power_list, extent_type="Conforming") - >>> end_time = str((time.time() - start)/60) + >>> end_time = str((time.time() - start) / 60) >>> edb.logger.info("Total legacy cutout time in min %s", end_time) >>> edb.nets.plot(signal_list, None, color_by_net=True) >>> edb.nets.plot(power_list, None, color_by_net=True) @@ -3024,7 +3025,7 @@ def export_hfss( >>> from pyedb import Edb >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2023.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_hfss(r"C:\temp") """ @@ -3066,7 +3067,7 @@ def export_q3d( >>> from pyedb import Edb >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2021.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_q3d(r"C:\temp") """ @@ -3118,7 +3119,7 @@ def export_maxwell( >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2021.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_maxwell(r"C:\temp") """ @@ -3278,8 +3279,8 @@ def add_project_variable(self, variable_name, variable_value, description=""): >>> from pyedb import Edb >>> edb_app = Edb() >>> boolean_1, ant_length = edb_app.add_project_variable("my_local_variable", "1cm") - >>> print(edb_app["$my_local_variable"]) #using getitem - >>> edb_app["$my_local_variable"] = "1cm" #using setitem + >>> print(edb_app["$my_local_variable"]) # using getitem + >>> edb_app["$my_local_variable"] = "1cm" # using setitem """ if not variable_name.startswith("$"): @@ -3317,8 +3318,8 @@ def add_design_variable(self, variable_name, variable_value, is_parameter=False, >>> from pyedb import Edb >>> edb_app = Edb() >>> boolean_1, ant_length = edb_app.add_design_variable("my_local_variable", "1cm") - >>> print(edb_app["my_local_variable"]) #using getitem - >>> edb_app["my_local_variable"] = "1cm" #using setitem + >>> print(edb_app["my_local_variable"]) # using getitem + >>> edb_app["my_local_variable"] = "1cm" # using setitem >>> boolean_2, para_length = edb_app.change_design_variable_value("my_parameter", "1m", is_parameter=True >>> boolean_3, project_length = edb_app.change_design_variable_value("$my_project_variable", "1m") @@ -3358,7 +3359,7 @@ def change_design_variable_value(self, variable_name, variable_value): >>> edb_app = Edb() >>> boolean, ant_length = edb_app.add_design_variable("ant_length", "1cm") >>> boolean, ant_length = edb_app.change_design_variable_value("ant_length", "1m") - >>> print(edb_app["ant_length"]) #using getitem + >>> print(edb_app["ant_length"]) # using getitem """ var_server = self.variable_exists(variable_name) if var_server[0]: @@ -3825,11 +3826,13 @@ def create_siwave_syz_setup(self, name=None, **kwargs): >>> from pyedb import Edb >>> edbapp = Edb() >>> setup1 = edbapp.create_siwave_syz_setup("setup1") - >>> setup1.add_frequency_sweep(frequency_sweep=[ - ... ["linear count", "0", "1kHz", 1], - ... ["log scale", "1kHz", "0.1GHz", 10], - ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ... ]) + >>> setup1.add_frequency_sweep( + ... frequency_sweep=[ + ... ["linear count", "0", "1kHz", 1], + ... ["log scale", "1kHz", "0.1GHz", 10], + ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], + ... ] + ... ) """ if not name: name = generate_unique_name("Siwave_SYZ") @@ -4584,8 +4587,7 @@ def create_model_for_arbitrary_wave_ports( ] if not polys: self.logger.error( - f"No polygon found with voids on layer {reference_layer} during model creation for " - f"arbitrary wave ports" + f"No polygon found with voids on layer {reference_layer} during model creation for arbitrary wave ports" ) return False void_padstacks = [] @@ -4603,7 +4605,7 @@ def create_model_for_arbitrary_wave_ports( if not void_padstacks: self.logger.error( - "No padstack instances found inside evaluated voids during model creation for arbitrary" "waveports" + "No padstack instances found inside evaluated voids during model creation for arbitrarywaveports" ) return False cloned_edb = Edb(edbpath=output_edb, edbversion=self.edbversion) diff --git a/src/pyedb/exceptions.py b/src/pyedb/exceptions.py index d355c16bab..622bd83f85 100644 --- a/src/pyedb/exceptions.py +++ b/src/pyedb/exceptions.py @@ -1,5 +1,4 @@ -""" -""" +""" """ class MaterialModelException(Exception): diff --git a/src/pyedb/generic/data_handlers.py b/src/pyedb/generic/data_handlers.py index 14ccb5b7cb..68598692ac 100644 --- a/src/pyedb/generic/data_handlers.py +++ b/src/pyedb/generic/data_handlers.py @@ -143,28 +143,28 @@ def from_rkm(code): # pragma: no cover Examples -------- - >>> from_rkm('R47') + >>> from_rkm("R47") '0.47' - >>> from_rkm('4R7') + >>> from_rkm("4R7") '4.7' - >>> from_rkm('470R') + >>> from_rkm("470R") '470' - >>> from_rkm('4K7') + >>> from_rkm("4K7") '4.7k' - >>> from_rkm('47K') + >>> from_rkm("47K") '47k' - >>> from_rkm('47K3') + >>> from_rkm("47K3") '47.3k' - >>> from_rkm('470K') + >>> from_rkm("470K") '470k' - >>> from_rkm('4M7') + >>> from_rkm("4M7") '4.7M' """ diff --git a/src/pyedb/generic/design_types.py b/src/pyedb/generic/design_types.py index bdda08115a..a72ffc982e 100644 --- a/src/pyedb/generic/design_types.py +++ b/src/pyedb/generic/design_types.py @@ -87,19 +87,19 @@ def Edb( Add a new variable named "s1" to the ``Edb`` instance. - >>> app['s1'] = "0.25 mm" - >>> app['s1'].tofloat + >>> app["s1"] = "0.25 mm" + >>> app["s1"].tofloat >>> 0.00025 - >>> app['s1'].tostring + >>> app["s1"].tostring >>> "0.25mm" or add a new parameter with description: - >>> app['s2'] = ["20um", "Spacing between traces"] - >>> app['s2'].value + >>> app["s2"] = ["20um", "Spacing between traces"] + >>> app["s2"].value >>> 1.9999999999999998e-05 - >>> app['s2'].description - >>> 'Spacing between traces' + >>> app["s2"].description + >>> "Spacing between traces" Create an ``Edb`` object and open the specified project. diff --git a/src/pyedb/grpc/database/components.py b/src/pyedb/grpc/database/components.py index 0156a5fde7..9334c2747a 100644 --- a/src/pyedb/grpc/database/components.py +++ b/src/pyedb/grpc/database/components.py @@ -20,9 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""This module contains the `Components` class. +"""This module contains the `Components` class.""" -""" import codecs import json import math @@ -30,8 +29,7 @@ import re import warnings -from ansys.edb.core.definition.die_property import DieOrientation as GrpDieOrientation -from ansys.edb.core.definition.die_property import DieType as GrpcDieType +from ansys.edb.core.definition.die_property import DieOrientation as GrpDieOrientation, DieType as GrpcDieType from ansys.edb.core.definition.solder_ball_property import ( SolderballShape as GrpcSolderballShape, ) @@ -548,16 +546,17 @@ def get_component_placement_vector( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector( - ... mounted_component=mounted_cmp, - ... hosting_component=hosting_cmp, - ... mounted_component_pin1="A12", - ... mounted_component_pin2="A14", - ... hosting_component_pin1="A12", - ... hosting_component_pin2="A14") + ... mounted_component=mounted_cmp, + ... hosting_component=hosting_cmp, + ... mounted_component_pin1="A12", + ... mounted_component_pin2="A14", + ... hosting_component_pin1="A12", + ... hosting_component_pin2="A14", + ... ) """ m_pin1_pos = [0.0, 0.0] m_pin2_pos = [0.0, 0.0] @@ -940,7 +939,7 @@ def deactivate_rlc_component(self, component=None, create_circuit_port=False, pe Examples -------- >>> from pyedb import Edb - >>> edb_file = r'C:\my_edb_file.aedb' + >>> edb_file = r"C:\my_edb_file.aedb" >>> edb = Edb(edb_file) >>> for cmp in list(edb.components.instances.keys()): >>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False) @@ -1080,8 +1079,7 @@ def _is_top_component(self, cmp): def _get_component_definition(self, name, pins): component_definition = ComponentDef.find(self._db, name) if component_definition.is_null: - from ansys.edb.core.layout.cell import Cell as GrpcCell - from ansys.edb.core.layout.cell import CellType as GrpcCellType + from ansys.edb.core.layout.cell import Cell as GrpcCell, CellType as GrpcCellType foot_print_cell = GrpcCell.create(self._pedb.active_db, GrpcCellType.FOOTPRINT_CELL, name) component_definition = ComponentDef.create(self._db, name, fp=foot_print_cell) @@ -1286,9 +1284,9 @@ def set_component_model(self, componentname, model_type="Spice", modelpath=None, >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") - >>> edbapp.components.set_component_model("A1", model_type="Spice", - ... modelpath="pathtospfile", - ... modelname="spicemodelname") + >>> edbapp.components.set_component_model( + ... "A1", model_type="Spice", modelpath="pathtospfile", modelname="spicemodelname" + ... ) """ if not modelname: @@ -1636,9 +1634,7 @@ def set_component_rlc( >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") - >>> edbapp.components.set_component_rlc( - ... "R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False - ... ) + >>> edbapp.components.set_component_rlc("R1", res_value=50, ind_value=1e-9, cap_value=1e-12, isparallel=False) """ if res_value is None and ind_value is None and cap_value is None: diff --git a/src/pyedb/grpc/database/definition/materials.py b/src/pyedb/grpc/database/definition/materials.py index 4d8ea2f9f7..730d1d9834 100644 --- a/src/pyedb/grpc/database/definition/materials.py +++ b/src/pyedb/grpc/database/definition/materials.py @@ -34,9 +34,9 @@ DjordjecvicSarkarModel as GrpcDjordjecvicSarkarModel, ) from ansys.edb.core.definition.material_def import ( + MaterialDef as GrpcMaterialDef, MaterialProperty as GrpcMaterialProperty, ) -from ansys.edb.core.definition.material_def import MaterialDef as GrpcMaterialDef from ansys.edb.core.definition.multipole_debye_model import ( MultipoleDebyeModel as GrpcMultipoleDebyeModel, ) diff --git a/src/pyedb/grpc/database/definition/package_def.py b/src/pyedb/grpc/database/definition/package_def.py index a317233e4f..e2243b8a51 100644 --- a/src/pyedb/grpc/database/definition/package_def.py +++ b/src/pyedb/grpc/database/definition/package_def.py @@ -222,9 +222,9 @@ def set_heatsink(self, fin_base_height, fin_height, fin_orientation, fin_spacing Fin thickness. """ from ansys.edb.core.utility.heat_sink import ( + HeatSink as GrpcHeatSink, HeatSinkFinOrientation as GrpcHeatSinkFinOrientation, ) - from ansys.edb.core.utility.heat_sink import HeatSink as GrpcHeatSink if fin_orientation == "x_oriented": fin_orientation = GrpcHeatSinkFinOrientation.X_ORIENTED diff --git a/src/pyedb/grpc/database/definition/padstack_def.py b/src/pyedb/grpc/database/definition/padstack_def.py index bc72622759..a310e225d5 100644 --- a/src/pyedb/grpc/database/definition/padstack_def.py +++ b/src/pyedb/grpc/database/definition/padstack_def.py @@ -25,15 +25,12 @@ from ansys.edb.core.definition.padstack_def import PadstackDef as GrpcPadstackDef from ansys.edb.core.definition.padstack_def_data import ( PadGeometryType as GrpcPadGeometryType, -) -from ansys.edb.core.definition.padstack_def_data import ( PadstackHoleRange as GrpcPadstackHoleRange, + PadType as GrpcPadType, ) -from ansys.edb.core.definition.padstack_def_data import PadType as GrpcPadType import ansys.edb.core.geometry.polygon_data from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData -from ansys.edb.core.hierarchy.structure3d import MeshClosure as GrpcMeshClosure -from ansys.edb.core.hierarchy.structure3d import Structure3D as GrpcStructure3D +from ansys.edb.core.hierarchy.structure3d import MeshClosure as GrpcMeshClosure, Structure3D as GrpcStructure3D from ansys.edb.core.primitive.circle import Circle as GrpcCircle from ansys.edb.core.utility.value import Value as GrpcValue @@ -720,7 +717,7 @@ def convert_to_3d_microvias(self, convert_only_signal_vias=True, hole_wall_angle s3d.add_member(cloned_circle2) if not self.data.material.value: self._pedb.logger.warning( - f"Padstack definution {self.name} has no material defined." f"Defaulting to copper" + f"Padstack definution {self.name} has no material defined.Defaulting to copper" ) self.data.material = "copper" s3d.set_material(self.data.material.value) diff --git a/src/pyedb/grpc/database/hfss.py b/src/pyedb/grpc/database/hfss.py index dc0e5d6395..ca3e0d0bcf 100644 --- a/src/pyedb/grpc/database/hfss.py +++ b/src/pyedb/grpc/database/hfss.py @@ -23,6 +23,7 @@ """ This module contains the ``EdbHfss`` class. """ + import math import warnings @@ -197,8 +198,8 @@ def create_voltage_source_on_pin(self, pos_pin, neg_pin, voltage_value=3.3, phas >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1],50,"source_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name") """ warnings.warn( "`create_voltage_source_on_pin` is deprecated and is now located here " @@ -238,8 +239,8 @@ def create_current_source_on_pin(self, pos_pin, neg_pin, current_value=0.1, phas >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1],50,"source_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_current_source_on_pin(pins[0], pins[1], 50, "source_name") """ warnings.warn( "`create_current_source_on_pin` is deprecated and is now located here " @@ -277,8 +278,8 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1],50,"res_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.hfss.create_resistor_on_pin(pins[0], pins[1], 50, "res_name") """ warnings.warn( "`create_resistor_on_pin` is deprecated and is now located here " @@ -1242,11 +1243,7 @@ def add_setup( ) from ansys.edb.core.simulation_setup.simulation_setup import ( Distribution as GrpcDistribution, - ) - from ansys.edb.core.simulation_setup.simulation_setup import ( FrequencyData as GrpcFrequencyData, - ) - from ansys.edb.core.simulation_setup.simulation_setup import ( SweepData as GrpcSweepData, ) diff --git a/src/pyedb/grpc/database/hierarchy/component.py b/src/pyedb/grpc/database/hierarchy/component.py index e81956d6e3..51da44fec8 100644 --- a/src/pyedb/grpc/database/hierarchy/component.py +++ b/src/pyedb/grpc/database/hierarchy/component.py @@ -28,14 +28,13 @@ from ansys.edb.core.definition.component_model import ( NPortComponentModel as GrpcNPortComponentModel, ) -from ansys.edb.core.definition.die_property import DieOrientation as GrpcDieOrientation -from ansys.edb.core.definition.die_property import DieType as GrpcDieType +from ansys.edb.core.definition.die_property import DieOrientation as GrpcDieOrientation, DieType as GrpcDieType from ansys.edb.core.definition.solder_ball_property import SolderballShape from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData from ansys.edb.core.hierarchy.component_group import ( ComponentGroup as GrpcComponentGroup, + ComponentType as GrpcComponentType, ) -from ansys.edb.core.hierarchy.component_group import ComponentType as GrpcComponentType from ansys.edb.core.hierarchy.netlist_model import NetlistModel as GrpcNetlistModel from ansys.edb.core.hierarchy.pin_pair_model import PinPairModel as GrpcPinPairModel from ansys.edb.core.hierarchy.sparameter_model import ( @@ -1087,7 +1086,7 @@ def assign_s_param_model(self, file_path, name=None, reference_net=None): return False if not reference_net: self._pedb.logger.warning( - f"No reference net provided for S parameter file {file_path}, net `GND` is " f"assigned by default" + f"No reference net provided for S parameter file {file_path}, net `GND` is assigned by default" ) reference_net = "GND" n_port_model = GrpcNPortComponentModel.find_by_name(self.component_def, name) diff --git a/src/pyedb/grpc/database/layers/layer.py b/src/pyedb/grpc/database/layers/layer.py index 234c2c2a8c..db8f072351 100644 --- a/src/pyedb/grpc/database/layers/layer.py +++ b/src/pyedb/grpc/database/layers/layer.py @@ -6,8 +6,7 @@ from __future__ import absolute_import -from ansys.edb.core.layer.layer import Layer as GrpcLayer -from ansys.edb.core.layer.layer import LayerType as GrpcLayerType +from ansys.edb.core.layer.layer import Layer as GrpcLayer, LayerType as GrpcLayerType class Layer(GrpcLayer): diff --git a/src/pyedb/grpc/database/layers/stackup_layer.py b/src/pyedb/grpc/database/layers/stackup_layer.py index aadfd6ca4c..e5d5c4aeca 100644 --- a/src/pyedb/grpc/database/layers/stackup_layer.py +++ b/src/pyedb/grpc/database/layers/stackup_layer.py @@ -23,8 +23,7 @@ from __future__ import absolute_import from ansys.edb.core.layer.layer import LayerType as GrpcLayerType -from ansys.edb.core.layer.stackup_layer import RoughnessRegion as GrpcRoughnessRegion -from ansys.edb.core.layer.stackup_layer import StackupLayer as GrpcStackupLayer +from ansys.edb.core.layer.stackup_layer import RoughnessRegion as GrpcRoughnessRegion, StackupLayer as GrpcStackupLayer from ansys.edb.core.utility.value import Value as GrpcValue diff --git a/src/pyedb/grpc/database/layout/layout.py b/src/pyedb/grpc/database/layout/layout.py index 64c628e73b..71a2350294 100644 --- a/src/pyedb/grpc/database/layout/layout.py +++ b/src/pyedb/grpc/database/layout/layout.py @@ -23,6 +23,7 @@ """ This module contains these classes: `EdbLayout` and `Shape`. """ + from typing import Union from ansys.edb.core.layout.layout import Layout as GrpcLayout diff --git a/src/pyedb/grpc/database/layout_validation.py b/src/pyedb/grpc/database/layout_validation.py index e1a11c1793..d10b663370 100644 --- a/src/pyedb/grpc/database/layout_validation.py +++ b/src/pyedb/grpc/database/layout_validation.py @@ -155,7 +155,7 @@ def disjoint_nets( Examples -------- - >>> renamed_nets = edb.layout_validation.disjoint_nets(["GND","Net2"]) + >>> renamed_nets = edb.layout_validation.disjoint_nets(["GND", "Net2"]) """ timer_start = self._pedb.logger.reset_timer() diff --git a/src/pyedb/grpc/database/modeler.py b/src/pyedb/grpc/database/modeler.py index 2b3e9f97ef..c4659b1984 100644 --- a/src/pyedb/grpc/database/modeler.py +++ b/src/pyedb/grpc/database/modeler.py @@ -23,19 +23,19 @@ """ This module contains these classes: `EdbLayout` and `Shape`. """ + import math from ansys.edb.core.geometry.arc_data import ArcData as GrpcArcData from ansys.edb.core.geometry.point_data import PointData as GrpcPointData from ansys.edb.core.geometry.polygon_data import ( + PolygonData as GrpcPolygonData, PolygonSenseType as GrpcPolygonSenseType, ) -from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData from ansys.edb.core.hierarchy.pin_group import PinGroup as GrpcPinGroup from ansys.edb.core.inner.exceptions import InvalidArgumentException from ansys.edb.core.primitive.bondwire import BondwireType as GrpcBondwireType -from ansys.edb.core.primitive.path import PathCornerType as GrpcPathCornerType -from ansys.edb.core.primitive.path import PathEndCapType as GrpcPathEndCapType +from ansys.edb.core.primitive.path import PathCornerType as GrpcPathCornerType, PathEndCapType as GrpcPathEndCapType from ansys.edb.core.primitive.rectangle import ( RectangleRepresentationType as GrpcRectangleRepresentationType, ) @@ -408,7 +408,7 @@ def get_polygon_points(polygon): -------- >>> poly = database.modeler.get_polygons_by_layer("GND") - >>> points = database.modeler.get_polygon_points(poly[0]) + >>> points = database.modeler.get_polygon_points(poly[0]) """ points = [] @@ -1244,7 +1244,7 @@ def defeature_polygon(self, poly, tolerance=0.001): new_poly = poly.polygon_data.defeature(tol=tolerance) if not new_poly.points: self._pedb.logger.error( - f"Defeaturing on polygon {poly.id} returned empty polygon, tolerance threshold " f"might too large. " + f"Defeaturing on polygon {poly.id} returned empty polygon, tolerance threshold might too large. " ) return False poly.polygon_data = new_poly diff --git a/src/pyedb/grpc/database/net/net.py b/src/pyedb/grpc/database/net/net.py index c3721062c0..85918f6380 100644 --- a/src/pyedb/grpc/database/net/net.py +++ b/src/pyedb/grpc/database/net/net.py @@ -40,8 +40,8 @@ class Net(GrpcNet): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_net = edb.nets.nets["GND"] - >>> edb_net.name # Class Property - >>> edb_net.name # EDB Object Property + >>> edb_net.name # Class Property + >>> edb_net.name # EDB Object Property """ def __init__(self, pedb, raw_net): diff --git a/src/pyedb/grpc/database/nets.py b/src/pyedb/grpc/database/nets.py index 77bf43a9ca..1add545b47 100644 --- a/src/pyedb/grpc/database/nets.py +++ b/src/pyedb/grpc/database/nets.py @@ -470,7 +470,7 @@ def delete(self, netlist): Examples -------- - >>> deleted_nets = database.nets.delete(["Net1","Net2"]) + >>> deleted_nets = database.nets.delete(["Net1", "Net2"]) """ if isinstance(netlist, str): netlist = [netlist] @@ -607,7 +607,7 @@ def find_and_fix_disjoint_nets( Examples -------- - >>> renamed_nets = database.nets.find_and_fix_disjoint_nets(["GND","Net2"]) + >>> renamed_nets = database.nets.find_and_fix_disjoint_nets(["GND", "Net2"]) """ warnings.warn("Use new function :func:`edb.layout_validation.disjoint_nets` instead.", DeprecationWarning) return self._pedb.layout_validation.disjoint_nets( diff --git a/src/pyedb/grpc/database/padstacks.py b/src/pyedb/grpc/database/padstacks.py index 9911090494..4cccb000ae 100644 --- a/src/pyedb/grpc/database/padstacks.py +++ b/src/pyedb/grpc/database/padstacks.py @@ -23,25 +23,18 @@ """ This module contains the `EdbPadstacks` class. """ + import math import warnings from ansys.edb.core.definition.padstack_def_data import ( PadGeometryType as GrpcPadGeometryType, -) -from ansys.edb.core.definition.padstack_def_data import ( PadstackDefData as GrpcPadstackDefData, -) -from ansys.edb.core.definition.padstack_def_data import ( PadstackHoleRange as GrpcPadstackHoleRange, -) -from ansys.edb.core.definition.padstack_def_data import ( + PadType as GrpcPadType, SolderballPlacement as GrpcSolderballPlacement, -) -from ansys.edb.core.definition.padstack_def_data import ( SolderballShape as GrpcSolderballShape, ) -from ansys.edb.core.definition.padstack_def_data import PadType as GrpcPadType from ansys.edb.core.geometry.point_data import PointData as GrpcPointData from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData from ansys.edb.core.utility.value import Value as GrpcValue @@ -294,7 +287,7 @@ def pingroups(self): List of all layout pin groups. """ warnings.warn( - "`pingroups` is deprecated and is now located here " "`pyedb.grpc.core.layout.pin_groups` instead.", + "`pingroups` is deprecated and is now located here `pyedb.grpc.core.layout.pin_groups` instead.", DeprecationWarning, ) return self._layout.pin_groups diff --git a/src/pyedb/grpc/database/primitive/bondwire.py b/src/pyedb/grpc/database/primitive/bondwire.py index b638f2d336..6b314ab3bf 100644 --- a/src/pyedb/grpc/database/primitive/bondwire.py +++ b/src/pyedb/grpc/database/primitive/bondwire.py @@ -21,10 +21,10 @@ # SOFTWARE. from ansys.edb.core.primitive.bondwire import ( + Bondwire as GrpcBondWire, BondwireCrossSectionType as GrpcBondwireCrossSectionType, + BondwireType as GrpcBondWireType, ) -from ansys.edb.core.primitive.bondwire import Bondwire as GrpcBondWire -from ansys.edb.core.primitive.bondwire import BondwireType as GrpcBondWireType from ansys.edb.core.utility.value import Value as GrpcValue diff --git a/src/pyedb/grpc/database/primitive/path.py b/src/pyedb/grpc/database/primitive/path.py index d19ee77448..d18bca86eb 100644 --- a/src/pyedb/grpc/database/primitive/path.py +++ b/src/pyedb/grpc/database/primitive/path.py @@ -22,8 +22,7 @@ import math from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData -from ansys.edb.core.primitive.path import Path as GrpcPath -from ansys.edb.core.primitive.path import PathCornerType as GrpcPatCornerType +from ansys.edb.core.primitive.path import Path as GrpcPath, PathCornerType as GrpcPatCornerType from ansys.edb.core.utility.value import Value as GrpcValue from pyedb.grpc.database.primitive.primitive import Primitive diff --git a/src/pyedb/grpc/database/primitive/primitive.py b/src/pyedb/grpc/database/primitive/primitive.py index 6c2486c109..2f11eda41d 100644 --- a/src/pyedb/grpc/database/primitive/primitive.py +++ b/src/pyedb/grpc/database/primitive/primitive.py @@ -38,8 +38,8 @@ class Primitive(GrpcPrimitive): >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_prim = edb.modeler.primitives[0] - >>> edb_prim.is_void # Class Property - >>> edb_prim.IsVoid() # EDB Object Property + >>> edb_prim.is_void # Class Property + >>> edb_prim.IsVoid() # EDB Object Property """ def __init__(self, pedb, edb_object): diff --git a/src/pyedb/grpc/database/primitive/rectangle.py b/src/pyedb/grpc/database/primitive/rectangle.py index c15d9c9ed2..b6bf091ed1 100644 --- a/src/pyedb/grpc/database/primitive/rectangle.py +++ b/src/pyedb/grpc/database/primitive/rectangle.py @@ -22,9 +22,9 @@ from ansys.edb.core.primitive.rectangle import ( + Rectangle as GrpcRectangle, RectangleRepresentationType as GrpcRectangleRepresentationType, ) -from ansys.edb.core.primitive.rectangle import Rectangle as GrpcRectangle from ansys.edb.core.utility.value import Value as GrpcValue from pyedb.grpc.database.primitive.primitive import Primitive diff --git a/src/pyedb/grpc/database/simulation_setup/hfss_general_settings.py b/src/pyedb/grpc/database/simulation_setup/hfss_general_settings.py index 1bd2ba7ed4..bf70f0d0d5 100644 --- a/src/pyedb/grpc/database/simulation_setup/hfss_general_settings.py +++ b/src/pyedb/grpc/database/simulation_setup/hfss_general_settings.py @@ -23,8 +23,6 @@ from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( AdaptType as GrpcAdaptType, -) -from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( HFSSGeneralSettings as GrpcHFSSGeneralSettings, ) diff --git a/src/pyedb/grpc/database/simulation_setup/hfss_settings_options.py b/src/pyedb/grpc/database/simulation_setup/hfss_settings_options.py index 16eb49985f..d56a813bcd 100644 --- a/src/pyedb/grpc/database/simulation_setup/hfss_settings_options.py +++ b/src/pyedb/grpc/database/simulation_setup/hfss_settings_options.py @@ -23,11 +23,7 @@ from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( BasisFunctionOrder as GrpcBasisFunctionOrder, -) -from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( HFSSSettingsOptions as GrpcHFSSSettingsOptions, -) -from ansys.edb.core.simulation_setup.hfss_simulation_settings import ( SolverType as GrpcSolverType, ) diff --git a/src/pyedb/grpc/database/simulation_setup/sweep_data.py b/src/pyedb/grpc/database/simulation_setup/sweep_data.py index 4a3a587b03..c94a54aeba 100644 --- a/src/pyedb/grpc/database/simulation_setup/sweep_data.py +++ b/src/pyedb/grpc/database/simulation_setup/sweep_data.py @@ -22,11 +22,9 @@ from ansys.edb.core.simulation_setup.simulation_setup import ( Distribution as GrpcDistribution, -) -from ansys.edb.core.simulation_setup.simulation_setup import ( FrequencyData as GrpcFrequencyData, + SweepData as GrpcSweepData, ) -from ansys.edb.core.simulation_setup.simulation_setup import SweepData as GrpcSweepData class SweepData(GrpcSweepData): diff --git a/src/pyedb/grpc/database/siwave.py b/src/pyedb/grpc/database/siwave.py index abde5b031f..ff9d3952cf 100644 --- a/src/pyedb/grpc/database/siwave.py +++ b/src/pyedb/grpc/database/siwave.py @@ -24,17 +24,16 @@ This module contains these classes: ``CircuitPort``, ``CurrentSource``, ``EdbSiwave``, ``PinGroup``, ``ResistorSource``, ``Source``, ``SourceType``, and ``VoltageSource``. """ + import os import warnings from ansys.edb.core.database import ProductIdType as GrpcProductIdType from ansys.edb.core.simulation_setup.simulation_setup import ( Distribution as GrpcDistribution, -) -from ansys.edb.core.simulation_setup.simulation_setup import ( FrequencyData as GrpcFrequencyData, + SweepData as GrpcSweepData, ) -from ansys.edb.core.simulation_setup.simulation_setup import SweepData as GrpcSweepData from pyedb.misc.siw_feature_config.xtalk_scan.scan_config import SiwaveScanConfig @@ -300,7 +299,7 @@ def _check_gnd(self, component_name): """ warnings.warn( - "`_check_gnd` is deprecated and is now located here " "`pyedb.grpc.core.excitations._check_gnd` instead.", + "`_check_gnd` is deprecated and is now located here `pyedb.grpc.core.excitations._check_gnd` instead.", DeprecationWarning, ) return self._pedb.source_excitation._check_gnd(component_name) diff --git a/src/pyedb/grpc/database/source_excitations.py b/src/pyedb/grpc/database/source_excitations.py index dc8c4271d4..23722d8c0e 100644 --- a/src/pyedb/grpc/database/source_excitations.py +++ b/src/pyedb/grpc/database/source_excitations.py @@ -25,8 +25,7 @@ from ansys.edb.core.database import ProductIdType as GrpcProductIdType from ansys.edb.core.geometry.point_data import PointData as GrpcPointData from ansys.edb.core.geometry.polygon_data import PolygonData as GrpcPolygonData -from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal -from ansys.edb.core.terminal.edge_terminal import PrimitiveEdge as GrpcPrimitiveEdge +from ansys.edb.core.terminal.edge_terminal import EdgeTerminal as GrpcEdgeTerminal, PrimitiveEdge as GrpcPrimitiveEdge from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType from ansys.edb.core.utility.rlc import Rlc as GrpcRlc from ansys.edb.core.utility.value import Value as GrpcValue @@ -1111,8 +1110,8 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> pins =edbapp.components.get_pin_from_component("U2A5") - >>> edbapp.excitation.create_resistor_on_pin(pins[0], pins[1],50,"res_name") + >>> pins = edbapp.components.get_pin_from_component("U2A5") + >>> edbapp.excitation.create_resistor_on_pin(pins[0], pins[1], 50, "res_name") """ if not resistor_name: resistor_name = ( @@ -1374,7 +1373,7 @@ def create_voltage_source_on_net( >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> edb.excitations.create_voltage_source_on_net("U2A5","V1P5_S3","U2A5","GND",3.3,0,"source_name") + >>> edb.excitations.create_voltage_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 3.3, 0, "source_name") """ if not negative_component_name: negative_component_name = positive_component_name @@ -1385,8 +1384,7 @@ def create_voltage_source_on_net( if not source_name: source_name = ( - f"Vsource_{positive_component_name}_{positive_net_name}_" - f"{negative_component_name}_{negative_net_name}" + f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}" ) return self.create_pin_group_terminal( positive_pins=pos_node_pins, @@ -1438,7 +1436,7 @@ def create_current_source_on_net( >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") - >>> edb.excitations.create_voltage_source_on_net("U2A5","V1P5_S3","U2A5","GND",3.3,0,"source_name") + >>> edb.excitations.create_voltage_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 3.3, 0, "source_name") """ if not negative_component_name: negative_component_name = positive_component_name @@ -1449,8 +1447,7 @@ def create_current_source_on_net( if not source_name: source_name = ( - f"Vsource_{positive_component_name}_{positive_net_name}_" - f"{negative_component_name}_{negative_net_name}" + f"Vsource_{positive_component_name}_{positive_net_name}_{negative_component_name}_{negative_net_name}" ) return self.create_pin_group_terminal( positive_pins=pos_node_pins, diff --git a/src/pyedb/grpc/database/stackup.py b/src/pyedb/grpc/database/stackup.py index 67e124b28a..bd4019fbb1 100644 --- a/src/pyedb/grpc/database/stackup.py +++ b/src/pyedb/grpc/database/stackup.py @@ -40,13 +40,12 @@ from ansys.edb.core.geometry.point3d_data import Point3DData as GrpcPoint3DData from ansys.edb.core.hierarchy.cell_instance import CellInstance as GrpcCellInstance from ansys.edb.core.hierarchy.component_group import ComponentType as GrpcComponentType -from ansys.edb.core.layer.layer import LayerType as GrpcLayerType -from ansys.edb.core.layer.layer import TopBottomAssociation as GrpcTopBottomAssociation +from ansys.edb.core.layer.layer import LayerType as GrpcLayerType, TopBottomAssociation as GrpcTopBottomAssociation from ansys.edb.core.layer.layer_collection import ( + LayerCollection as GrpcLayerCollection, LayerCollectionMode as GrpcLayerCollectionMode, + LayerTypeSet as GrpcLayerTypeSet, ) -from ansys.edb.core.layer.layer_collection import LayerCollection as GrpcLayerCollection -from ansys.edb.core.layer.layer_collection import LayerTypeSet as GrpcLayerTypeSet from ansys.edb.core.layer.stackup_layer import StackupLayer as GrpcStackupLayer from ansys.edb.core.layout.mcad_model import McadModel as GrpcMcadModel from ansys.edb.core.utility.transform3d import Transform3D as GrpcTransform3D @@ -931,7 +930,7 @@ def flip_design(self): Examples -------- - >>> edb = Edb(edbpath=targetfile, edbversion="2021.2") + >>> edb = Edb(edbpath=targetfile, edbversion="2021.2") >>> edb.stackup.flip_design() >>> edb.save() >>> edb.close_edb() @@ -1125,22 +1124,28 @@ def place_in_layout( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") >>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector( - ... mounted_component=mounted_cmp, - ... hosting_component=hosting_cmp, - ... mounted_component_pin1="A12", - ... mounted_component_pin2="A14", - ... hosting_component_pin1="A12", - ... hosting_component_pin2="A14") - >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x=vector[0], - ... offset_y=vector[1], flipped_stackup=False, place_on_top=True, - ... ) + ... mounted_component=mounted_cmp, + ... hosting_component=hosting_cmp, + ... mounted_component_pin1="A12", + ... mounted_component_pin2="A14", + ... hosting_component_pin1="A12", + ... hosting_component_pin2="A14", + ... ) + >>> edb2.stackup.place_in_layout( + ... edb1.active_cell, + ... angle=0.0, + ... offset_x=vector[0], + ... offset_y=vector[1], + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ # if flipped_stackup and place_on_top or (not flipped_stackup and not place_on_top): self.adjust_solder_dielectrics() @@ -1217,13 +1222,18 @@ def place_in_layout_3d_placement( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") - >>> edb2.stackup.place_in_layout(edb1.active_cell, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb2.stackup.place_in_layout( + ... edb1.active_cell, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ _angle = angle * math.pi / 180.0 @@ -1350,13 +1360,18 @@ def place_instance( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2") >>> hosting_cmp = edb1.components.get_component_by_name("U100") >>> mounted_cmp = edb2.components.get_component_by_name("BGA") - >>> edb1.stackup.place_instance(edb2, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb1.stackup.place_instance( + ... edb2, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ _angle = angle * math.pi / 180.0 @@ -1486,11 +1501,16 @@ def place_a3dcomp_3d_placement( Examples -------- - >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2") >>> a3dcomp_path = "connector.a3dcomp" - >>> edb1.stackup.place_a3dcomp_3d_placement(a3dcomp_path, angle=0.0, offset_x="1mm", - ... offset_y="2mm", flipped_stackup=False, place_on_top=True, - ... ) + >>> edb1.stackup.place_a3dcomp_3d_placement( + ... a3dcomp_path, + ... angle=0.0, + ... offset_x="1mm", + ... offset_y="2mm", + ... flipped_stackup=False, + ... place_on_top=True, + ... ) """ zero_data = GrpcValue(0.0) one_data = GrpcValue(1.0) @@ -1536,7 +1556,7 @@ def residual_copper_area_per_layer(self): Examples -------- - >>> edb = Edb(edbpath=targetfile1, edbversion="2021.2") + >>> edb = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb.stackup.residual_copper_area_per_layer() """ temp_data = {name: 0 for name, _ in self.signal_layers.items()} diff --git a/src/pyedb/grpc/database/terminal/bundle_terminal.py b/src/pyedb/grpc/database/terminal/bundle_terminal.py index c8dfd9d6eb..455e103c9c 100644 --- a/src/pyedb/grpc/database/terminal/bundle_terminal.py +++ b/src/pyedb/grpc/database/terminal/bundle_terminal.py @@ -22,9 +22,9 @@ from ansys.edb.core.terminal.bundle_terminal import BundleTerminal as GrpcBundleTerminal from ansys.edb.core.terminal.terminal import ( + HfssPIType as GrpcHfssPIType, SourceTermToGroundType as GrpcSourceTermToGroundType, ) -from ansys.edb.core.terminal.terminal import HfssPIType as GrpcHfssPIType from ansys.edb.core.utility.value import Value as GrpcValue from pyedb.grpc.database.hierarchy.component import Component diff --git a/src/pyedb/grpc/database/terminal/terminal.py b/src/pyedb/grpc/database/terminal/terminal.py index 94d87d9267..ada0a28615 100644 --- a/src/pyedb/grpc/database/terminal/terminal.py +++ b/src/pyedb/grpc/database/terminal/terminal.py @@ -23,9 +23,11 @@ import re from ansys.edb.core.terminal.edge_terminal import EdgeType as GrpcEdgeType -from ansys.edb.core.terminal.terminal import BoundaryType as GrpcBoundaryType -from ansys.edb.core.terminal.terminal import Terminal as GrpcTerminal -from ansys.edb.core.terminal.terminal import TerminalType as GrpcTerminalType +from ansys.edb.core.terminal.terminal import ( + BoundaryType as GrpcBoundaryType, + Terminal as GrpcTerminal, + TerminalType as GrpcTerminalType, +) from ansys.edb.core.utility.value import Value as GrpcValue from pyedb.dotnet.database.edb_data.padstacks_data import EDBPadstackInstance diff --git a/src/pyedb/grpc/database/utility/heat_sink.py b/src/pyedb/grpc/database/utility/heat_sink.py index a8aa3f1e30..b103e4c502 100644 --- a/src/pyedb/grpc/database/utility/heat_sink.py +++ b/src/pyedb/grpc/database/utility/heat_sink.py @@ -27,7 +27,6 @@ class HeatSink: - """Heatsink model description. Parameters diff --git a/src/pyedb/grpc/database/utility/hfss_extent_info.py b/src/pyedb/grpc/database/utility/hfss_extent_info.py index 6aa2e1ad85..f25b192325 100644 --- a/src/pyedb/grpc/database/utility/hfss_extent_info.py +++ b/src/pyedb/grpc/database/utility/hfss_extent_info.py @@ -21,10 +21,10 @@ # SOFTWARE. from ansys.edb.core.utility.hfss_extent_info import ( + HfssExtentInfo as GrpcHfssExtentInfo, HFSSExtentInfoType as GrpcHfssExtentInfoType, + OpenRegionType as GrpcOpenRegionType, ) -from ansys.edb.core.utility.hfss_extent_info import HfssExtentInfo as GrpcHfssExtentInfo -from ansys.edb.core.utility.hfss_extent_info import OpenRegionType as GrpcOpenRegionType from ansys.edb.core.utility.value import Value as GrpcValue diff --git a/src/pyedb/grpc/database/utility/simulation_configuration.py b/src/pyedb/grpc/database/utility/simulation_configuration.py index 8d1654e370..a4616657ef 100644 --- a/src/pyedb/grpc/database/utility/simulation_configuration.py +++ b/src/pyedb/grpc/database/utility/simulation_configuration.py @@ -2134,7 +2134,7 @@ class SimulationConfiguration(object): Defined the radiation box type, Conformal, Bounding box and ConvexHull are supported (HFSS only). - >>> sim_setup.max_num_passes= 30 + >>> sim_setup.max_num_passes = 30 Default value is 30, specify the maximum number of adaptive passes (only HFSS). Reasonable high value is recommended to force the solver reaching the convergence criteria. @@ -2149,7 +2149,7 @@ class SimulationConfiguration(object): local minima. >>> from pyedb.generic.constants import BasisOrder - >>> sim_setup.basis_order = BasisOrder.Single + >>> sim_setup.basis_order = BasisOrder.Single Select the order basis (HFSS only), Zero, Single, Double and Mixed are supported. For Signal integrity Single or Mixed should be used. @@ -2231,7 +2231,7 @@ class SimulationConfiguration(object): Activate the loop resistance usage per pin when ``True`` - >>> sim_setup.dc_via_report_path = 'C:\\temp\\via_report_file' + >>> sim_setup.dc_via_report_path = "C:\\temp\\via_report_file" Define the via report path file. diff --git a/src/pyedb/grpc/edb.py b/src/pyedb/grpc/edb.py index d3275728b1..143374accc 100644 --- a/src/pyedb/grpc/edb.py +++ b/src/pyedb/grpc/edb.py @@ -154,8 +154,8 @@ class Edb(EdbInit): Add a new variable named "s1" to the ``Edb`` instance. - >>> app['s1'] = "0.25 mm" - >>> app['s1'] + >>> app["s1"] = "0.25 mm" + >>> app["s1"] >>> 0.00025 Create an ``Edb`` object and open the specified project. @@ -633,8 +633,7 @@ def create_edb(self, restart_rpc_server=False, kill_all_instances=False): ------- bool: `True` when succeed `False` if failed. """ - from ansys.edb.core.layout.cell import Cell as GrpcCell - from ansys.edb.core.layout.cell import CellType as GrpcCellType + from ansys.edb.core.layout.cell import Cell as GrpcCell, CellType as GrpcCellType self.standalone = self.standalone n_try = 10 @@ -1207,7 +1206,7 @@ def get_connected_objects(self, layout_object_instance): continue except: self.logger.warning( - f"Failed to find connected objects on layout_obj " f"{layout_object_instance.layout_obj.id}, skipping." + f"Failed to find connected objects on layout_obj {layout_object_instance.layout_obj.id}, skipping." ) pass return temp @@ -1479,7 +1478,7 @@ def import_gds_file( command = [ anstranslator_full_path, inputGDS, - f'-o="{control_file_temp}"' f'-t="{tech_file}"', + f'-o="{control_file_temp}"-t="{tech_file}"', f'-g="{map_file}"', f'-f="{layer_filter}"', ] @@ -1827,7 +1826,7 @@ def cutout( Examples -------- >>> from pyedb import Edb - >>> edb = Edb(r'C:\\test.aedb', edbversion="2022.2") + >>> edb = Edb(r"C:\\test.aedb", edbversion="2022.2") >>> edb.logger.info_timer("Edb Opening") >>> edb.logger.reset_timer() >>> start = time.time() @@ -1837,7 +1836,7 @@ def cutout( >>> signal_list.append(net) >>> power_list = ["PGND"] >>> edb.cutout(signal_list=signal_list, reference_list=power_list, extent_type="Conforming") - >>> end_time = str((time.time() - start)/60) + >>> end_time = str((time.time() - start) / 60) >>> edb.logger.info("Total legacy cutout time in min %s", end_time) >>> edb.nets.plot(signal_list, None, color_by_net=True) >>> edb.nets.plot(power_list, None, color_by_net=True) @@ -2596,7 +2595,7 @@ def export_hfss( >>> from pyedb import Edb >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2023.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_hfss(r"C:\temp") """ @@ -2638,7 +2637,7 @@ def export_q3d( >>> from pyedb import Edb >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2021.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_q3d(r"C:\temp") """ @@ -2690,7 +2689,7 @@ def export_maxwell( >>> edb = Edb(edbpath=r"C:\temp\myproject.aedb", edbversion="2021.2") - >>> options_config = {'UNITE_NETS' : 1, 'LAUNCH_Q3D' : 0} + >>> options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0} >>> edb.write_export3d_option_config_file(r"C:\temp", options_config) >>> edb.export_maxwell(r"C:\temp") """ @@ -2841,8 +2840,8 @@ def add_project_variable(self, variable_name, variable_value): >>> from pyedb import Edb >>> edb_app = Edb() >>> boolean_1, ant_length = edb_app.add_project_variable("my_local_variable", "1cm") - >>> print(edb_app["$my_local_variable"]) #using getitem - >>> edb_app["$my_local_variable"] = "1cm" #using setitem + >>> print(edb_app["$my_local_variable"]) # using getitem + >>> edb_app["$my_local_variable"] = "1cm" # using setitem """ if not variable_name.startswith("$"): @@ -2877,8 +2876,8 @@ def add_design_variable(self, variable_name, variable_value, is_parameter=False) >>> from pyedb import Edb >>> edb_app = Edb() >>> boolean_1, ant_length = edb_app.add_design_variable("my_local_variable", "1cm") - >>> print(edb_app["my_local_variable"]) #using getitem - >>> edb_app["my_local_variable"] = "1cm" #using setitem + >>> print(edb_app["my_local_variable"]) # using getitem + >>> edb_app["my_local_variable"] = "1cm" # using setitem >>> boolean_2, para_length = edb_app.change_design_variable_value("my_parameter", "1m", is_parameter=True >>> boolean_3, project_length = edb_app.change_design_variable_value("$my_project_variable", "1m") @@ -2913,7 +2912,7 @@ def change_design_variable_value(self, variable_name, variable_value): >>> edb_app = Edb() >>> boolean, ant_length = edb_app.add_design_variable("ant_length", "1cm") >>> boolean, ant_length = edb_app.change_design_variable_value("ant_length", "1m") - >>> print(edb_app["ant_length"]) #using getitem + >>> print(edb_app["ant_length"]) # using getitem """ if self.variable_exists(variable_name): if variable_name in self.db.get_all_variable_names(): @@ -3111,7 +3110,7 @@ def create_hfss_setup(self, name=None, start_frequency="0GHz", stop_frequency="2 """ warnings.warn( - "`create_hfss_setup` is deprecated and is now located here " "`pyedb.grpc.core.hfss.add_setup` instead.", + "`create_hfss_setup` is deprecated and is now located here `pyedb.grpc.core.hfss.add_setup` instead.", DeprecationWarning, ) return self._hfss.add_setup( @@ -3194,11 +3193,13 @@ def create_siwave_syz_setup(self, name=None, **kwargs): >>> from pyedb import Edb >>> edbapp = Edb() >>> setup1 = edbapp.create_siwave_syz_setup("setup1") - >>> setup1.add_frequency_sweep(frequency_sweep=[ - ... ["linear count", "0", "1kHz", 1], - ... ["log scale", "1kHz", "0.1GHz", 10], - ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ... ]) + >>> setup1.add_frequency_sweep( + ... frequency_sweep=[ + ... ["linear count", "0", "1kHz", 1], + ... ["log scale", "1kHz", "0.1GHz", 10], + ... ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], + ... ] + ... ) """ if not name: name = generate_unique_name("Siwave_SYZ") @@ -3970,8 +3971,7 @@ def create_model_for_arbitrary_wave_ports( ] if not polys: self.logger.error( - f"No polygon found with voids on layer {reference_layer} during model creation for " - f"arbitrary wave ports" + f"No polygon found with voids on layer {reference_layer} during model creation for arbitrary wave ports" ) return False void_padstacks = [] @@ -3984,7 +3984,7 @@ def create_model_for_arbitrary_wave_ports( if not void_padstacks: self.logger.error( - "No padstack instances found inside evaluated voids during model creation for arbitrary" "waveports" + "No padstack instances found inside evaluated voids during model creation for arbitrarywaveports" ) return False cloned_edb = Edb(edbpath=output_edb, edbversion=self.edbversion, restart_rpc_server=True) diff --git a/src/pyedb/grpc/edb_init.py b/src/pyedb/grpc/edb_init.py index add7123ac1..57cee78660 100644 --- a/src/pyedb/grpc/edb_init.py +++ b/src/pyedb/grpc/edb_init.py @@ -22,6 +22,7 @@ """Database.""" + import atexit import os import signal diff --git a/src/pyedb/ipc2581/ipc2581.py b/src/pyedb/ipc2581/ipc2581.py index f59614ea7f..0b287762b2 100644 --- a/src/pyedb/ipc2581/ipc2581.py +++ b/src/pyedb/ipc2581/ipc2581.py @@ -89,9 +89,9 @@ def add_pdstack_definition(self): self.from_meter_to_units(pad.parameters_values[0], self.units) ) if not primitive_ref in self.content.standard_geometries_dict.standard_circ_dict: - self.content.standard_geometries_dict.standard_circ_dict[ - primitive_ref - ] = self.from_meter_to_units(pad.parameters_values[0], self.units) + self.content.standard_geometries_dict.standard_circ_dict[primitive_ref] = ( + self.from_meter_to_units(pad.parameters_values[0], self.units) + ) elif pad.geometry_type == 2: primitive_ref = "RECT_{}_{}".format( self.from_meter_to_units(pad.parameters_values[0], self.units), @@ -135,9 +135,9 @@ def add_pdstack_definition(self): self.from_meter_to_units(antipad.parameters_values[0], self.units) ) if not primitive_ref in self.content.standard_geometries_dict.standard_circ_dict: - self.content.standard_geometries_dict.standard_circ_dict[ - primitive_ref - ] = self.from_meter_to_units(antipad.parameters_values[0], self.units) + self.content.standard_geometries_dict.standard_circ_dict[primitive_ref] = ( + self.from_meter_to_units(antipad.parameters_values[0], self.units) + ) elif antipad.geometry_type == 2: primitive_ref = "RECT_{}_{}".format( self.from_meter_to_units(antipad.parameters_values[0], self.units), diff --git a/src/pyedb/misc/downloads.py b/src/pyedb/misc/downloads.py index da52ed8ec5..54e1932ee3 100644 --- a/src/pyedb/misc/downloads.py +++ b/src/pyedb/misc/downloads.py @@ -21,6 +21,7 @@ # SOFTWARE. """Download example datasets from https://github.com/pyansys/example-data""" + import os import shutil import tempfile diff --git a/src/pyedb/misc/misc.py b/src/pyedb/misc/misc.py index 6116e821d4..75a3b02352 100644 --- a/src/pyedb/misc/misc.py +++ b/src/pyedb/misc/misc.py @@ -21,6 +21,7 @@ # SOFTWARE. """Miscellaneous Methods for PyEDB.""" + import os import warnings diff --git a/src/pyedb/misc/utilities.py b/src/pyedb/misc/utilities.py index 52ddc13cf8..f15ed60926 100644 --- a/src/pyedb/misc/utilities.py +++ b/src/pyedb/misc/utilities.py @@ -22,7 +22,6 @@ """Module gathering utility functions for PyEDB modules.""" - import math diff --git a/src/pyedb/modeler/geometry_operators.py b/src/pyedb/modeler/geometry_operators.py index b68a47c273..60addce820 100644 --- a/src/pyedb/modeler/geometry_operators.py +++ b/src/pyedb/modeler/geometry_operators.py @@ -62,12 +62,12 @@ def parse_dim_arg(string, scale_to_unit=None, variable_manager=None): # pragma: Parse `'"2mm"'`. >>> from pyedb.modeler.geometry_operators import GeometryOperators as go - >>> go.parse_dim_arg('2mm') + >>> go.parse_dim_arg("2mm") >>> 0.002 Use the optional argument ``scale_to_unit`` to specify the destination unit. - >>> go.parse_dim_arg('2mm', scale_to_unit='mm') + >>> go.parse_dim_arg("2mm", scale_to_unit="mm") >>> 2.0 """ @@ -1457,7 +1457,7 @@ def v_angle_sign(va, vb, vn, right_handed=True): # pragma: no cover if GeometryOperators.v_norm(cross) < tol: return math.pi assert GeometryOperators.is_collinear(cross, vn), ( - "vn must be the normal to the " "plane containing va and vb." + "vn must be the normal to the plane containing va and vb." ) # pragma: no cover vnn = GeometryOperators.normalize_vector(vn) @@ -1589,6 +1589,7 @@ def are_segments_intersecting(a1, a2, b1, b2, include_collinear=True): ``True`` if the segments are intersecting. ``False`` otherwise. """ + # fmt: off def on_segment(p, q, r): # Given three collinear points p, q, r, the function checks if point q lies on line-segment 'pr' diff --git a/tests/grpc/system/conftest.py b/tests/grpc/system/conftest.py index 772923ee8b..9728102c88 100644 --- a/tests/grpc/system/conftest.py +++ b/tests/grpc/system/conftest.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -""" +""" """ import os from os.path import dirname diff --git a/tests/grpc/system/test_edb.py b/tests/grpc/system/test_edb.py index bddadd7a11..2de3664fc1 100644 --- a/tests/grpc/system/test_edb.py +++ b/tests/grpc/system/test_edb.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import os from typing import Sequence diff --git a/tests/grpc/system/test_edb_components.py b/tests/grpc/system/test_edb_components.py index ac9af2ceb0..55f286e365 100644 --- a/tests/grpc/system/test_edb_components.py +++ b/tests/grpc/system/test_edb_components.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb components -""" +"""Tests related to Edb components""" + import math import os diff --git a/tests/grpc/system/test_edb_definition.py b/tests/grpc/system/test_edb_definition.py index 89058aec68..a2e8736901 100644 --- a/tests/grpc/system/test_edb_definition.py +++ b/tests/grpc/system/test_edb_definition.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb component definitions -""" +"""Tests related to Edb component definitions""" + import os import pytest diff --git a/tests/grpc/system/test_edb_differential_pairs.py b/tests/grpc/system/test_edb_differential_pairs.py index 131430f9de..c2c047d00f 100644 --- a/tests/grpc/system/test_edb_differential_pairs.py +++ b/tests/grpc/system/test_edb_differential_pairs.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb differential pairs -""" +"""Tests related to Edb differential pairs""" import pytest diff --git a/tests/grpc/system/test_edb_extended_nets.py b/tests/grpc/system/test_edb_extended_nets.py index 80ac0d3974..ce9a86c590 100644 --- a/tests/grpc/system/test_edb_extended_nets.py +++ b/tests/grpc/system/test_edb_extended_nets.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb extended nets -""" +"""Tests related to Edb extended nets""" import pytest diff --git a/tests/grpc/system/test_edb_future_features_242.py b/tests/grpc/system/test_edb_future_features_242.py index 34744115b1..463f9629e5 100644 --- a/tests/grpc/system/test_edb_future_features_242.py +++ b/tests/grpc/system/test_edb_future_features_242.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import pytest diff --git a/tests/grpc/system/test_edb_ipc.py b/tests/grpc/system/test_edb_ipc.py index 41605c926a..0d03365188 100644 --- a/tests/grpc/system/test_edb_ipc.py +++ b/tests/grpc/system/test_edb_ipc.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to the interaction between Edb and Ipc2581 -""" +"""Tests related to the interaction between Edb and Ipc2581""" import os diff --git a/tests/grpc/system/test_edb_materials.py b/tests/grpc/system/test_edb_materials.py index bf821d8bb2..4be340527a 100644 --- a/tests/grpc/system/test_edb_materials.py +++ b/tests/grpc/system/test_edb_materials.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import os diff --git a/tests/grpc/system/test_edb_modeler.py b/tests/grpc/system/test_edb_modeler.py index 72e9591fee..8a9a553308 100644 --- a/tests/grpc/system/test_edb_modeler.py +++ b/tests/grpc/system/test_edb_modeler.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb modeler -""" +"""Tests related to Edb modeler""" import os diff --git a/tests/grpc/system/test_edb_net_classes.py b/tests/grpc/system/test_edb_net_classes.py index 93f6faef62..9ef8167715 100644 --- a/tests/grpc/system/test_edb_net_classes.py +++ b/tests/grpc/system/test_edb_net_classes.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb net classes -""" +"""Tests related to Edb net classes""" import pytest diff --git a/tests/grpc/system/test_edb_nets.py b/tests/grpc/system/test_edb_nets.py index 53e0a2c194..0c96bd4394 100644 --- a/tests/grpc/system/test_edb_nets.py +++ b/tests/grpc/system/test_edb_nets.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb nets -""" +"""Tests related to Edb nets""" import os diff --git a/tests/grpc/system/test_edb_padstacks.py b/tests/grpc/system/test_edb_padstacks.py index 18c83a9ef9..1e64ca681f 100644 --- a/tests/grpc/system/test_edb_padstacks.py +++ b/tests/grpc/system/test_edb_padstacks.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb padstacks -""" +"""Tests related to Edb padstacks""" + import os import pytest diff --git a/tests/grpc/system/test_edb_stackup.py b/tests/grpc/system/test_edb_stackup.py index cbf48aada5..e1f9d30eec 100644 --- a/tests/grpc/system/test_edb_stackup.py +++ b/tests/grpc/system/test_edb_stackup.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb stackup -""" +"""Tests related to Edb stackup""" import math import os diff --git a/tests/grpc/system/test_emi_scanner.py b/tests/grpc/system/test_emi_scanner.py index 7563391862..b80f52d8bf 100644 --- a/tests/grpc/system/test_emi_scanner.py +++ b/tests/grpc/system/test_emi_scanner.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to the interaction between Edb and Ipc2581 -""" +"""Tests related to the interaction between Edb and Ipc2581""" from pathlib import Path diff --git a/tests/grpc/system/test_siwave_features.py b/tests/grpc/system/test_siwave_features.py index 6c68fe8085..cf00e2c790 100644 --- a/tests/grpc/system/test_siwave_features.py +++ b/tests/grpc/system/test_siwave_features.py @@ -11,8 +11,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import os diff --git a/tests/grpc/unit/conftest.py b/tests/grpc/unit/conftest.py index cada8e557a..359ef1ef50 100644 --- a/tests/grpc/unit/conftest.py +++ b/tests/grpc/unit/conftest.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -""" +""" """ import csv import os diff --git a/tests/legacy/system/conftest.py b/tests/legacy/system/conftest.py index 552dd8e3e2..4c16ff30ad 100644 --- a/tests/legacy/system/conftest.py +++ b/tests/legacy/system/conftest.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -""" +""" """ import os from os.path import dirname diff --git a/tests/legacy/system/test_edb_components.py b/tests/legacy/system/test_edb_components.py index e23d1cc22d..04e8a0ee13 100644 --- a/tests/legacy/system/test_edb_components.py +++ b/tests/legacy/system/test_edb_components.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb components -""" +"""Tests related to Edb components""" + import math import os diff --git a/tests/legacy/system/test_edb_definition.py b/tests/legacy/system/test_edb_definition.py index eaebd27d66..3bd388e215 100644 --- a/tests/legacy/system/test_edb_definition.py +++ b/tests/legacy/system/test_edb_definition.py @@ -20,8 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb component definitions -""" +"""Tests related to Edb component definitions""" + import os import pytest diff --git a/tests/legacy/system/test_edb_differential_pairs.py b/tests/legacy/system/test_edb_differential_pairs.py index 7684992a37..c766f72f56 100644 --- a/tests/legacy/system/test_edb_differential_pairs.py +++ b/tests/legacy/system/test_edb_differential_pairs.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb differential pairs -""" +"""Tests related to Edb differential pairs""" import pytest diff --git a/tests/legacy/system/test_edb_extended_nets.py b/tests/legacy/system/test_edb_extended_nets.py index 58b6199aba..e172d216b0 100644 --- a/tests/legacy/system/test_edb_extended_nets.py +++ b/tests/legacy/system/test_edb_extended_nets.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb extended nets -""" +"""Tests related to Edb extended nets""" import pytest diff --git a/tests/legacy/system/test_edb_future_features_242.py b/tests/legacy/system/test_edb_future_features_242.py index 0648501b03..c2c8bb6998 100644 --- a/tests/legacy/system/test_edb_future_features_242.py +++ b/tests/legacy/system/test_edb_future_features_242.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import pytest diff --git a/tests/legacy/system/test_edb_ipc.py b/tests/legacy/system/test_edb_ipc.py index 2ae5164722..949df6415e 100644 --- a/tests/legacy/system/test_edb_ipc.py +++ b/tests/legacy/system/test_edb_ipc.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to the interaction between Edb and Ipc2581 -""" +"""Tests related to the interaction between Edb and Ipc2581""" import os diff --git a/tests/legacy/system/test_edb_materials.py b/tests/legacy/system/test_edb_materials.py index 669e1bcbad..82296400f6 100644 --- a/tests/legacy/system/test_edb_materials.py +++ b/tests/legacy/system/test_edb_materials.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import os diff --git a/tests/legacy/system/test_edb_modeler.py b/tests/legacy/system/test_edb_modeler.py index 7e2921e684..a6262da5be 100644 --- a/tests/legacy/system/test_edb_modeler.py +++ b/tests/legacy/system/test_edb_modeler.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb modeler -""" +"""Tests related to Edb modeler""" import os diff --git a/tests/legacy/system/test_edb_net_classes.py b/tests/legacy/system/test_edb_net_classes.py index 661a7cf100..84908c57e5 100644 --- a/tests/legacy/system/test_edb_net_classes.py +++ b/tests/legacy/system/test_edb_net_classes.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb net classes -""" +"""Tests related to Edb net classes""" import pytest diff --git a/tests/legacy/system/test_edb_nets.py b/tests/legacy/system/test_edb_nets.py index 0a332a6976..3ef85bcc1d 100644 --- a/tests/legacy/system/test_edb_nets.py +++ b/tests/legacy/system/test_edb_nets.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb nets -""" +"""Tests related to Edb nets""" import os diff --git a/tests/legacy/system/test_edb_padstacks.py b/tests/legacy/system/test_edb_padstacks.py index 54a123ebb2..32e0e7a44f 100644 --- a/tests/legacy/system/test_edb_padstacks.py +++ b/tests/legacy/system/test_edb_padstacks.py @@ -21,6 +21,7 @@ # SOFTWARE. """Tests related to Edb padstacks""" + import math import os from pathlib import Path @@ -546,6 +547,6 @@ def _assert_inside(rect, pad): BASE_MESSAGE = "rectangle is not inside pad as" result = rect.Intersect(pad) assert len(result) == 1, f"{BASE_MESSAGE} intersection returned more than one lump" - assert math.isclose( - result[0].Area(), rect.Area() - ), f"{BASE_MESSAGE} area of intersection is not equal to rectangle area" + assert math.isclose(result[0].Area(), rect.Area()), ( + f"{BASE_MESSAGE} area of intersection is not equal to rectangle area" + ) diff --git a/tests/legacy/system/test_edb_stackup.py b/tests/legacy/system/test_edb_stackup.py index b340035103..dcf5937696 100644 --- a/tests/legacy/system/test_edb_stackup.py +++ b/tests/legacy/system/test_edb_stackup.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb stackup -""" +"""Tests related to Edb stackup""" import math import os diff --git a/tests/legacy/system/test_emi_scanner.py b/tests/legacy/system/test_emi_scanner.py index 39efa7af5b..adfd7df79d 100644 --- a/tests/legacy/system/test_emi_scanner.py +++ b/tests/legacy/system/test_emi_scanner.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to the interaction between Edb and Ipc2581 -""" +"""Tests related to the interaction between Edb and Ipc2581""" from pathlib import Path diff --git a/tests/legacy/system/test_siwave_features.py b/tests/legacy/system/test_siwave_features.py index d70cb6e175..90aa29435d 100644 --- a/tests/legacy/system/test_siwave_features.py +++ b/tests/legacy/system/test_siwave_features.py @@ -11,8 +11,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""Tests related to Edb -""" +"""Tests related to Edb""" import os diff --git a/tests/legacy/unit/conftest.py b/tests/legacy/unit/conftest.py index cada8e557a..359ef1ef50 100644 --- a/tests/legacy/unit/conftest.py +++ b/tests/legacy/unit/conftest.py @@ -20,8 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" -""" +""" """ import csv import os