Skip to content

Commit ee5ff30

Browse files
committed
MISC: update following pre-commit
Changes include: - formatting using black, isort, flake8 - proposed changes from codespell - doc updates following blackend-docs - trim trailing whitespace
1 parent 1be6c98 commit ee5ff30

File tree

132 files changed

+805
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+805
-642
lines changed

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# Merging from the command prompt will add diff markers to the files if there
1919
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
20+
# the diff markers are never inserted). Diff markers may cause the following
2121
# file extensions to fail to load in VS. An alternative would be to treat
2222
# these files as binary and thus will always conflict and require user
2323
# intervention with every merge. To do so, just uncomment the entries below
@@ -46,9 +46,9 @@
4646

4747
###############################################################################
4848
# diff behavior for common document formats
49-
#
49+
#
5050
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
51+
# is only available from the command line. Turn it on by uncommenting the
5252
# entries below.
5353
###############################################################################
5454
#*.doc diff=astextplain

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
directory: "/" # Location of package manifests
55
schedule:
66
interval: "daily"
7-
reviewers:
7+
reviewers:
88
- "SMoraisAnsys"
99
assignees:
1010
- "pyansys-ci-bot"
@@ -18,7 +18,7 @@ updates:
1818
directory: "/"
1919
schedule:
2020
interval: "daily"
21-
reviewers:
21+
reviewers:
2222
- "SMoraisAnsys"
2323
assignees:
2424
- "pyansys-ci-bot"

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ repos:
4949
- id: requirements-txt-fixer
5050
- id: debug-statements
5151
- id: trailing-whitespace
52+
files: '(src|doc|tests)/.*'
53+
exclude: 'tests/example_models/*'
5254

5355
# # validate GitHub workflow files
5456
# - repo: https://github.com/python-jsonschema/check-jsonschema

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 ANSYS, Inc. All rights reserved.
3+
Copyright (c) 2023 ANSYS, Inc. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ start using EDB faster and easier.
116116

117117
## Example workflow
118118

119-
1.
120-
2.
119+
1.
120+
2.
121121

122122
## Connect to PyEDB from Python IDE
123123

@@ -129,10 +129,9 @@ Usage examples follow.
129129
## Explicit AEDT declaration and error management
130130

131131
``` python
132-
# Launch PyEDB 2024 R1
132+
# Launch PyEDB 2024 R1
133133

134-
from pyedb import EDB
135-
134+
from pyedb import EDB
136135
```
137136

138137
## License

doc/print_errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Read errors output from a Sphinx build and remove duplicate groups."""
2-
import sys
32
import os
43
import pathlib
4+
import sys
55

66
sys.tracebacklimit = 0
77
my_path = pathlib.Path(__file__).parent.resolve()
@@ -26,6 +26,6 @@
2626
# There should be no errors here since sphinx will have exited
2727
print()
2828
if errors:
29-
raise Exception(f"Sphinx reported unique {len(errors)} warnings\n\n")
29+
raise Exception(f"Sphinx reported {len(errors)} warnings\n\n")
3030

3131
print(f"Sphinx Reported no warnings\n\n")

doc/source/EDBAPI/ComponentsEdb.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ The main component object is called directly from main application using the pro
66
.. code:: python
77
88
from pyedb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
11-
pins =edb.components.get_pin_from_component("U2A5")
12+
pins = edb.components.get_pin_from_component("U2A5")
1213
1314
...
1415
@@ -41,6 +42,7 @@ These classes are the containers of data management for components reference des
4142
.. code:: python
4243
4344
from pyedb.legacy.edb import EdbLegacy
45+
4446
edb = EdbLegacy(myedb, edbversion="2023.1")
4547
4648
comp = edb.components["C1"]

doc/source/EDBAPI/CoreEdb.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ It can be opened and edited using the ``Edb`` class.
2020
.. code:: python
2121
2222
from pyedb.legacy.edb import EdbLegacy
23+
2324
# this call returns the Edb class initialized on 2023 R1
2425
edb = EdbLegacy(myedb, edbversion="2023.1")
2526
@@ -57,7 +58,8 @@ to AEDB files.
5758

5859
.. code:: python
5960
60-
from from pyedb.legacy.edb_core.edb import Edb
61+
from pyedb.legacy.edb_core.edb import Edb
62+
6163
edb = Edb(myedb, edbversion="2023.1")
6264
6365
# this call returns the EdbHfss Class

doc/source/EDBAPI/LayerData.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ These classes are the containers of the layer and stackup manager of the EDB API
55

66
.. code:: python
77
8-
from from pyedb.legacy.edb_core.edb import Edb
8+
from pyedb.legacy.edb_core.edb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
1112
# this call returns the EDBLayers class

doc/source/EDBAPI/NetsEdb.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ The main component object is called directly from main application using the pro
55

66
.. code:: python
77
8-
from from pyedb.legacy.edb_core.edb import Edb
8+
from pyedb.legacy.edb_core.edb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
11-
edb.nets.plot(None,None)
12+
edb.nets.plot(None, None)
1213
1314
...
1415
@@ -40,7 +41,8 @@ The following class is the container of data management for nets, extended nets
4041

4142
.. code:: python
4243
43-
from from pyedb.legacy.edb_core.edb import Edb
44+
from pyedb.legacy.edb_core.edb import Edb
45+
4446
edb = Edb(myedb, edbversion="2023.1")
4547
4648
edb.nets["M_MA<6>"].delete()

doc/source/EDBAPI/PadstackEdb.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ The main padstack object is called directly from main application using the prop
55

66
.. code:: python
77
8-
from from pyedb.legacy.edb_core.edb import Edb
8+
from pyedb.legacy.edb_core.edb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
1112
edb.padstacks.create_padstack(
12-
padstackname="SVIA", holediam="$via_hole_size", antipaddiam="$antipaddiam", paddiam="$paddiam"
13+
padstackname="SVIA",
14+
holediam="$via_hole_size",
15+
antipaddiam="$antipaddiam",
16+
paddiam="$paddiam",
1317
)
1418
1519

doc/source/EDBAPI/PortsEdb.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ These classes are the containers of ports methods of the EDB for both HFSS and S
77

88
.. code:: python
99
10-
from from pyedb.legacy.edb_core.edb import Edb
10+
from pyedb.legacy.edb_core.edb import Edb
11+
1112
edb = Edb(myedb, edbversion="2023.1")
1213
1314
# this call returns the EDB excitations dictionary

doc/source/EDBAPI/PrimitivesEdb.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ Primitives are planes, lines, rectangles, and circles.
66

77
.. code:: python
88
9-
from from pyedb.legacy.edb_core.edb import Edb
9+
from pyedb.legacy.edb_core.edb import Edb
10+
1011
edb = Edb(myedb, edbversion="2023.1")
1112
12-
top_layer_obj = edb.modeler.create_rectangle("TOP", net_name="gnd",
13-
lower_left_point=plane_lw_pt,
14-
upper_right_point=plane_up_pt)
13+
top_layer_obj = edb.modeler.create_rectangle(
14+
"TOP", net_name="gnd", lower_left_point=plane_lw_pt, upper_right_point=plane_up_pt
15+
)
1516
1617
...
1718
@@ -42,7 +43,8 @@ These classes are the containers of data management for primitives and arcs.
4243

4344
.. code:: python
4445
45-
from from pyedb.legacy.edb_core.edb import Edb
46+
from pyedb.legacy.edb_core.edb import Edb
47+
4648
edb = Edb(myedb, edbversion="2023.1")
4749
4850
polygon = edbapp.modeler.polygons[0]

doc/source/EDBAPI/SiWave.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ accessed from PyEDB in Windows only. All setups can be implemented through EDB A
2222
.. code:: python
2323
2424
from pyedb.legacy.edb_core.siwave import EdbSiwave
25+
2526
# this call returns the Edb class initialized on 2023 R1
2627
siwave = EdbSiwave(specified_version="2023.1")
2728
siwave.open_project("pyproject.siw")

doc/source/EDBAPI/SimulationConfigurationEdb.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,23 @@ These classes are the containers of simulation configuration constructors for th
1818

1919
.. code:: python
2020
21-
from from pyedb.legacy.edb_core.edb import Edb
21+
from pyedb.legacy.edb_core.edb import Edb
22+
2223
edbapp = Edb(myedb, edbversion="2023.1")
2324
2425
sim_setup = edbapp.new_simulation_configuration()
2526
sim_setup.solver_type = sim_setup.SOLVER_TYPE.SiwaveSYZ
2627
sim_setup.batch_solve_settings.cutout_subdesign_expansion = 0.01
2728
sim_setup.batch_solve_settings.do_cutout_subdesign = True
2829
sim_setup.use_default_cutout = False
29-
sim_setup.batch_solve_settings.signal_nets = ["PCIE0_RX0_P", "PCIE0_RX0_N", "PCIE0_TX0_P_C", "PCIE0_TX0_N_C",
30-
"PCIE0_TX0_P", "PCIE0_TX0_N"]
30+
sim_setup.batch_solve_settings.signal_nets = [
31+
"PCIE0_RX0_P",
32+
"PCIE0_RX0_N",
33+
"PCIE0_TX0_P_C",
34+
"PCIE0_TX0_N_C",
35+
"PCIE0_TX0_P",
36+
"PCIE0_TX0_N",
37+
]
3138
sim_setup.batch_solve_settings.components = ["U2A5", "J2L1"]
3239
sim_setup.batch_solve_settings.power_nets = ["GND"]
3340
sim_setup.ac_settings.start_freq = "100Hz"

doc/source/EDBAPI/SimulationEdb.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ These classes are the containers of ``setup`` classes in EDB for both HFSS and S
55

66
.. code:: python
77
8-
from from pyedb.legacy.edb_core.edb import Edb
8+
from pyedb.legacy.edb_core.edb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
1112
# this call create a setup and returns the object

doc/source/EDBAPI/SourcesEdb.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ These classes are the containers of sources methods of the EDB for both HFSS and
55

66
.. code:: python
77
8-
from from pyedb.legacy.edb_core.edb import Edb
8+
from pyedb.legacy.edb_core.edb import Edb
9+
910
edb = Edb(myedb, edbversion="2023.1")
1011
1112
# this call returns the EDB excitations dictionary

doc/source/EDBAPI/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Example:
2323
.. code:: python
2424
2525
from pyaedt import Edb
26+
2627
edb = Edb("my_project.aedb", edbversion="2023.1")
2728
edb.core_components.components["R1"].r_value = 40
2829
edb.close_edb()

doc/source/Getting_started/Contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
99
with this guide, paying particular attention to `Guidelines and Best Practices
1010
<https://dev.docs.pyansys.com/how-to/index.html>`_, before attempting
1111
to contribute to PyEDB.
12-
12+
1313
The following contribution information is specific to PyEDB.
1414

1515
Clone the repository
@@ -110,7 +110,7 @@ For example:
110110
def my_method(self, var):
111111
pass
112112
113-
Every method can return a value of ``True`` when successful or
113+
Every method can return a value of ``True`` when successful or
114114
``False`` when failed. When a failure occurs, the error
115115
handler returns information about the error in both the console and
116116
log file.

doc/source/Getting_started/Installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Installation
22
============
33
PyEDB consolidates and extends all existing capital around scripting for AEDB,
4-
allowing re-use of existing code, sharing of best practices, and collaboration.
4+
allowing reuse of existing code, sharing of best practices, and collaboration.
55

66
This PyAnsys library has been tested on HFSS, Icepak, SIWave.
77

@@ -29,9 +29,9 @@ Install on CPython from PyPI
2929
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3030
You can install PyEDB on CPython 3.7 through 3.10 from PyPI:
3131

32-
.. code:: python
32+
.. code:: shell
3333
34-
pip install pyansys-edb
34+
pip install pyedb
3535
3636
3737
Linux support

doc/source/Getting_started/Quickcode.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Explicit PyEDB declaration and error management
4545
4646
from pyedb.legacy.edb_core.edb import EdbLegacy
4747
48-
edb_file = pyedb.layout_examples.ANSYS-HSD_V1.aedb
48+
edb_file = pyedb.layout_examples.ANSYS - HSD_V1.aedb
4949
edb = EdbLegacy(edbversion="2023.2", edbpath=edb_file)
5050
5151
@@ -56,7 +56,7 @@ Variables
5656
5757
from pyedb.legacy.edb_core.edb import EdbLegacy
5858
59-
edb_file = pyedb.layout_examples.ANSYS-HSD_V1.aedb
59+
edb_file = pyedb.layout_examples.ANSYS - HSD_V1.aedb
6060
edb = EdbLegacy(edbversion="2023.2", edbpath=edb_file)
61-
edb["dim"] = "1mm" # design variable
61+
edb["dim"] = "1mm" # design variable
6262
edb["$dim"] = "1mm" # project variable

doc/source/Getting_started/Troubleshooting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Here is the path to the Python 3.7 interpreter for the 2023 R1 installation:
1818

1919
.. code:: python
2020
21-
path\to\AnsysEM\v231\commonfiles\CPython\3_7\winx64\Release\python"
21+
"path\to\AnsysEM\v231\commonfiles\CPython\3_7\winx64\Release\python"
2222
2323
2424
Error installing PyEDB using pip
@@ -44,9 +44,9 @@ The wheelhouse for PyAEDT can be found `here <https://github.com/ansys/pyaedt/re
4444
After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and
4545
run the Python command:
4646

47-
.. code:: python
47+
.. code:: shell
4848
49-
>>> pip install --no-cache-dir --no-index --find-links=/path/to/pyansys-edb/wheelhouse pyansys-edb
49+
pip install --no-cache-dir --no-index --find-links=/path/to/pyansys-edb/wheelhouse pyansys-edb
5050
5151
5252
Run PyEDB with gRPC

doc/source/Getting_started/versioning.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ and files from the MAPDL service.
2525
Legacy interfaces
2626
=================
2727

28-
.NET interface
29-
--------------
28+
Working with .NET interface
29+
---------------------------
3030

3131
PyEDB supports the legacy .NET interface, enabled with the settings option.
3232

doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# Ansys release version
55
desktop_version = "2023.2"
66

7-
#download and copy the layout file from examples
7+
# download and copy the layout file from examples
88
temp_folder = pyaedt.generate_unique_folder_name()
9-
targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder)
9+
targetfile = pyaedt.downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder)
1010

1111
# loading EDB
1212
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)
@@ -27,4 +27,4 @@
2727
edbapp.save_edb()
2828
edbapp.close_edb()
2929
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
30-
hfss.release_desktop(close_desktop=False, close_projects=False)
30+
hfss.release_desktop(close_desktop=False, close_projects=False)

0 commit comments

Comments
 (0)