Skip to content

Commit

Permalink
MISC: pass pre-commit hooks
Browse files Browse the repository at this point in the history
Changes:
- sort imports
- format using black
- format to match flake8
- format some docstring to match pydocstyle
- trim trailing whitespace (and exclude files)
  • Loading branch information
SMoraisAnsys committed Nov 28, 2023
1 parent d173e42 commit 7fcfb7d
Show file tree
Hide file tree
Showing 66 changed files with 185 additions and 128 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repos:
- id: codespell
exclude: (?x)(^notebooks)
args: ["--ignore-words", "doc/styles/Vocab/ANSYS/accept.txt", "-w"]

- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
Expand All @@ -41,6 +42,7 @@ repos:
- id: debug-statements
- id: check-yaml
- id: trailing-whitespace
exclude: (?x)^(.*\.def)

# - repo: https://github.com/ansys/pre-commit-hooks
# rev: v0.2.2
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ For developers
Installing Pyedb in developer mode allows
you to modify the source and enhance it.

Before contributing to the project, please refer to the `PyAnsys Developer's guide`_. You will
Before contributing to the project, please refer to the `PyAnsys Developer's guide`_. You will
need to follow these steps:

1. Start by cloning this repository:
Expand Down Expand Up @@ -77,7 +77,7 @@ need to follow these steps:
4. Finally, verify your development installation by running:

.. code:: bash
tox
Expand All @@ -86,7 +86,7 @@ How to testing

This project takes advantage of `tox`_. This tool allows to automate common
development tasks (similar to Makefile) but it is oriented towards Python
development.
development.

Using tox
^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if errorlevel 9009 (
goto end

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

Expand Down
2 changes: 1 addition & 1 deletion doc/source/_templates/sidebar-nav-bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{% else %}
{{ generate_toctree_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
{% endif %}

</div>
</nav>
2 changes: 1 addition & 1 deletion doc/source/api/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Classes
PointData
Point3DData
Triangle3DData

Enums
-----

Expand Down
16 changes: 8 additions & 8 deletions doc/source/api/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ Glossary
Connectable

The generic type for most objects in Layout.

Objects of the following types are all connectables :

.. toctree::
:maxdepth: 1

primitive
hierarchy
terminal

Zone

Multizone stackups allow a design to be divided into areas called zones.
Each zone contains a subset of layers available to the entire circuit board and is spatially defined by polygons on the Outline layer.
Multizone stackups allow a design to be divided into areas called zones.

Each zone contains a subset of layers available to the entire circuit board and is spatially defined by polygons on the Outline layer.

ValueLike

Expand Down Expand Up @@ -54,9 +54,9 @@ Glossary
:obj:`tuple`\[:class:`DCThicknessType <ansys.edb.core.layer.DCThicknessType>`, :term:`ValueLike`, :obj:`bool`\]

HFSSExtents

Extent box around the design, represented by a :obj:`dict` with the following key:values

| **dielectric**: (:obj:`float`, :obj:`bool`)
| Dielectric extent size. First parameter is the value and second parameter indicates if the value is a multiple.
| **airbox_horizontal**: (:obj:`float`, :obj:`bool`)
Expand Down
4 changes: 2 additions & 2 deletions doc/source/api/hierarchy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Object Types

.. autosummary::
:toctree: _autosummary

CellInstance
InstArray
ComponentGroup
Expand All @@ -32,6 +32,6 @@ Enums

.. autosummary::
:toctree: _autosummary

ComponentType
MeshClosure
2 changes: 1 addition & 1 deletion doc/source/api/layer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classes

.. autosummary::
:toctree: _autosummary

Layer
StackupLayer
ViaLayer
Expand Down
4 changes: 2 additions & 2 deletions doc/source/api/layout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classes

.. autosummary::
:toctree: _autosummary

Cell
Layout
McadModel
Expand All @@ -20,6 +20,6 @@ Enums

.. autosummary::
:toctree: _autosummary

CellType
DesignMode
2 changes: 1 addition & 1 deletion doc/source/api/net.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classes

.. autosummary::
:toctree: _autosummary

DifferentialPair
ExtendedNet
Net
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/terminal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Classes

.. autosummary::
:toctree: _autosummary

BoundaryType
BundleTerminal
Edge
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Choose :ref:`ref_index_api` to access a complete description of all the availabl

.. toctree::
:hidden:

installation
user_guide/user_guide
api/index
Expand Down
1 change: 0 additions & 1 deletion src/ansys/edb/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
import importlib_metadata

__version__ = importlib_metadata.version("ansys-edb-core")

22 changes: 11 additions & 11 deletions src/ansys/edb/core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
import ansys.api.edb.v1.edb_defs_pb2 as edb_defs_pb2
import google.protobuf.wrappers_pb2 as proto_wrappers

from ansys.edb.core.inner import ObjBase, variable_server
from ansys.edb.core.inner.messages import (
double_property_message,
edb_obj_collection_message,
edb_obj_name_message,
get_product_property_ids_message,
get_product_property_message,
set_product_property_message,
str_message,
)
from ansys.edb.core.inner.utils import map_list
from ansys.edb.core.definition import (
ApdBondwireDef,
BondwireDefType,
Expand All @@ -29,6 +18,17 @@
PadstackDef,
)
from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.inner import ObjBase, variable_server
from ansys.edb.core.inner.messages import (
double_property_message,
edb_obj_collection_message,
edb_obj_name_message,
get_product_property_ids_message,
get_product_property_message,
set_product_property_message,
str_message,
)
from ansys.edb.core.inner.utils import map_list
from ansys.edb.core.layout import Cell
from ansys.edb.core.session import DatabaseServiceStub, StubAccessor, StubType

Expand Down
4 changes: 3 additions & 1 deletion src/ansys/edb/core/definition/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
from ansys.edb.core.definition.ic_component_property import ICComponentProperty
from ansys.edb.core.definition.io_component_property import IOComponentProperty
from ansys.edb.core.definition.material_def import MaterialDef, MaterialProperty, ThermalModifier
from ansys.edb.core.definition.material_property_thermal_modifier import MaterialPropertyThermalModifier
from ansys.edb.core.definition.material_property_thermal_modifier import (
MaterialPropertyThermalModifier,
)
from ansys.edb.core.definition.multipole_debye_model import MultipoleDebyeModel
from ansys.edb.core.definition.package_def import PackageDef
from ansys.edb.core.definition.padstack_def import PadstackDef
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/bondwire_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from ansys.api.edb.v1 import bondwire_def_pb2_grpc
import ansys.api.edb.v1.bondwire_def_pb2 as pb

from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.session import StubAccessor, StubType
from ansys.edb.core.utility import Value

Expand Down
4 changes: 2 additions & 2 deletions src/ansys/edb/core/definition/component_def.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Component Def Definition."""
from ansys.api.edb.v1.component_def_pb2_grpc import ComponentDefServiceStub

from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.inner.utils import map_list
from ansys.edb.core.definition import component_model, component_pin
from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.inner.utils import map_list
from ansys.edb.core.layout import cell
from ansys.edb.core.session import StubAccessor, StubType

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/component_pin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Component Pin Definition."""
from ansys.api.edb.v1.component_pin_pb2_grpc import ComponentPinServiceStub

from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.definition import component_def
from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.session import StubAccessor, StubType


Expand Down
9 changes: 7 additions & 2 deletions src/ansys/edb/core/definition/component_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from ansys.api.edb.v1.component_property_pb2_grpc import ComponentPropertyServiceStub
import ansys.api.edb.v1.model_pb2 as model_pb2

from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.definition import package_def
from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.session import StubAccessor, StubType
from ansys.edb.core.utility import Value

Expand Down Expand Up @@ -55,7 +55,12 @@ def model(self):
comp_model_msg = self.__stub.GetModel(messages.edb_obj_message(self))

def get_model_obj_type():
from ansys.edb.core.hierarchy import NetlistModel, PinPairModel, SParameterModel, SPICEModel
from ansys.edb.core.hierarchy import (
NetlistModel,
PinPairModel,
SParameterModel,
SPICEModel,
)

if comp_model_msg.model_type == model_pb2.SPICE_MODEL_TYPE:
return SPICEModel
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/dataset_def.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Dataset Def Definition."""
from ansys.api.edb.v1.dataset_def_pb2_grpc import DatasetDefServiceStub

from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.inner import ObjBase
from ansys.edb.core.inner.messages import (
edb_obj_message,
Expand All @@ -9,7 +10,6 @@
string_property_message,
)
from ansys.edb.core.inner.parser import to_point_data_list
from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.session import StubAccessor, StubType


Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/debye_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from google.protobuf import empty_pb2

from ansys.edb.core import session
from ansys.edb.core.inner import messages
from ansys.edb.core.definition.dielectric_material_model import DielectricMaterialModel
from ansys.edb.core.inner import messages


class _DebyeModelQueryBuilder:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/djordjecvic_sarkar_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from google.protobuf import empty_pb2

from ansys.edb.core import session
from ansys.edb.core.inner import messages
from ansys.edb.core.definition.dielectric_material_model import DielectricMaterialModel
from ansys.edb.core.inner import messages


class DjordjecvicSarkarModel(DielectricMaterialModel):
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/ic_component_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from ansys.api.edb.v1.ic_component_property_pb2_grpc import ICComponentPropertyServiceStub
import google.protobuf.empty_pb2 as empty_pb2

from ansys.edb.core.inner import messages
from ansys.edb.core.definition import (
component_property,
die_property,
port_property,
solder_ball_property,
)
from ansys.edb.core.inner import messages
from ansys.edb.core.session import StubAccessor, StubType


Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/io_component_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from ansys.api.edb.v1.io_component_property_pb2_grpc import IOComponentPropertyServiceStub
import google.protobuf.empty_pb2 as empty_pb2

from ansys.edb.core.inner import messages
from ansys.edb.core.definition import component_property, port_property, solder_ball_property
from ansys.edb.core.inner import messages
from ansys.edb.core.session import StubAccessor, StubType


Expand Down
5 changes: 3 additions & 2 deletions src/ansys/edb/core/definition/material_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import ansys.api.edb.v1.material_def_pb2 as pb

from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.definition import DielectricMaterialModel
from ansys.edb.core.edb_defs import DefinitionObjType
from ansys.edb.core.inner import ObjBase, messages
from ansys.edb.core.session import MaterialDefServiceStub, StubAccessor, StubType
from ansys.edb.core.utility import Value

Expand Down Expand Up @@ -210,7 +210,8 @@ def name(self):

@property
def dielectric_material_model(self):
""":class:`DielectricMaterialModel <ansys.edb.core.definition.dielectric_material_model.DielectricMaterialModel>`: \
""":class:`DielectricMaterialModel \
<ansys.edb.core.definition.dielectric_material_model.DielectricMaterialModel>`: \
Dielectric material model of the material definition."""
return DielectricMaterialModel(
self.__stub.GetDielectricMaterialModel(messages.edb_obj_message(self))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def create(cls, basic_quadratic_params=None, advanced_quadratic_params=None):
@property
def quadratic_model_params(self):
""":class:`BasicQuadraticParams <ansys.edb.core.utility.BasicQuadraticParams>`, \
:class:`AdvancedQuadraticParams <ansys.edb.core.utility.AdvancedQuadraticParams>`: Quadratic model parameters of \
the thermal modifier.
:class:`AdvancedQuadraticParams <ansys.edb.core.utility.AdvancedQuadraticParams>`: \
Quadratic model parameters of the thermal modifier.
The quadratic model is of the following form:
PropVal(Temp) = PropValRef[1 + C1(Temp - TempRef) + C2(Temp - TempRef)^2]
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/edb/core/definition/multipole_debye_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from google.protobuf import empty_pb2

from ansys.edb.core import session
from ansys.edb.core.inner import messages
from ansys.edb.core.definition.dielectric_material_model import DielectricMaterialModel
from ansys.edb.core.inner import messages


class _MultipoleDebyeModelQueryBuilder:
Expand Down
Loading

0 comments on commit 7fcfb7d

Please sign in to comment.