Skip to content

Commit

Permalink
MISC: update following pre-commit
Browse files Browse the repository at this point in the history
Changes include:
- formatting using black, isort, flake8
- proposed changes from codespell
- doc updates following blackend-docs
- trim trailing whitespace
  • Loading branch information
SMoraisAnsys committed Dec 1, 2023
1 parent 1be6c98 commit ee5ff30
Show file tree
Hide file tree
Showing 132 changed files with 805 additions and 642 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
Expand Down Expand Up @@ -46,9 +46,9 @@

###############################################################################
# diff behavior for common document formats
#
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
reviewers:
reviewers:
- "SMoraisAnsys"
assignees:
- "pyansys-ci-bot"
Expand All @@ -18,7 +18,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
reviewers:
reviewers:
- "SMoraisAnsys"
assignees:
- "pyansys-ci-bot"
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ repos:
- id: requirements-txt-fixer
- id: debug-statements
- id: trailing-whitespace
files: '(src|doc|tests)/.*'
exclude: 'tests/example_models/*'

# # validate GitHub workflow files
# - repo: https://github.com/python-jsonschema/check-jsonschema
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 ANSYS, Inc. All rights reserved.
Copyright (c) 2023 ANSYS, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ start using EDB faster and easier.

## Example workflow

1.
2.
1.
2.

## Connect to PyEDB from Python IDE

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

``` python
# Launch PyEDB 2024 R1
# Launch PyEDB 2024 R1

from pyedb import EDB

from pyedb import EDB
```

## License
Expand Down
4 changes: 2 additions & 2 deletions doc/print_errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Read errors output from a Sphinx build and remove duplicate groups."""
import sys
import os
import pathlib
import sys

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

print(f"Sphinx Reported no warnings\n\n")
4 changes: 3 additions & 1 deletion doc/source/EDBAPI/ComponentsEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ The main component object is called directly from main application using the pro
.. code:: python
from pyedb import Edb
edb = Edb(myedb, edbversion="2023.1")
pins =edb.components.get_pin_from_component("U2A5")
pins = edb.components.get_pin_from_component("U2A5")
...
Expand Down Expand Up @@ -41,6 +42,7 @@ These classes are the containers of data management for components reference des
.. code:: python
from pyedb.legacy.edb import EdbLegacy
edb = EdbLegacy(myedb, edbversion="2023.1")
comp = edb.components["C1"]
Expand Down
4 changes: 3 additions & 1 deletion doc/source/EDBAPI/CoreEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ It can be opened and edited using the ``Edb`` class.
.. code:: python
from pyedb.legacy.edb import EdbLegacy
# this call returns the Edb class initialized on 2023 R1
edb = EdbLegacy(myedb, edbversion="2023.1")
Expand Down Expand Up @@ -57,7 +58,8 @@ to AEDB files.

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
# this call returns the EdbHfss Class
Expand Down
3 changes: 2 additions & 1 deletion doc/source/EDBAPI/LayerData.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ These classes are the containers of the layer and stackup manager of the EDB API

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
# this call returns the EDBLayers class
Expand Down
8 changes: 5 additions & 3 deletions doc/source/EDBAPI/NetsEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ The main component object is called directly from main application using the pro

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
edb.nets.plot(None,None)
edb.nets.plot(None, None)
...
Expand Down Expand Up @@ -40,7 +41,8 @@ The following class is the container of data management for nets, extended nets

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
edb.nets["M_MA<6>"].delete()
Expand Down
8 changes: 6 additions & 2 deletions doc/source/EDBAPI/PadstackEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ The main padstack object is called directly from main application using the prop

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
edb.padstacks.create_padstack(
padstackname="SVIA", holediam="$via_hole_size", antipaddiam="$antipaddiam", paddiam="$paddiam"
padstackname="SVIA",
holediam="$via_hole_size",
antipaddiam="$antipaddiam",
paddiam="$paddiam",
)
Expand Down
3 changes: 2 additions & 1 deletion doc/source/EDBAPI/PortsEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ These classes are the containers of ports methods of the EDB for both HFSS and S

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
# this call returns the EDB excitations dictionary
Expand Down
12 changes: 7 additions & 5 deletions doc/source/EDBAPI/PrimitivesEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Primitives are planes, lines, rectangles, and circles.

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
top_layer_obj = edb.modeler.create_rectangle("TOP", net_name="gnd",
lower_left_point=plane_lw_pt,
upper_right_point=plane_up_pt)
top_layer_obj = edb.modeler.create_rectangle(
"TOP", net_name="gnd", lower_left_point=plane_lw_pt, upper_right_point=plane_up_pt
)
...
Expand Down Expand Up @@ -42,7 +43,8 @@ These classes are the containers of data management for primitives and arcs.

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
polygon = edbapp.modeler.polygons[0]
Expand Down
1 change: 1 addition & 0 deletions doc/source/EDBAPI/SiWave.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ accessed from PyEDB in Windows only. All setups can be implemented through EDB A
.. code:: python
from pyedb.legacy.edb_core.siwave import EdbSiwave
# this call returns the Edb class initialized on 2023 R1
siwave = EdbSiwave(specified_version="2023.1")
siwave.open_project("pyproject.siw")
Expand Down
13 changes: 10 additions & 3 deletions doc/source/EDBAPI/SimulationConfigurationEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,23 @@ These classes are the containers of simulation configuration constructors for th

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edbapp = Edb(myedb, edbversion="2023.1")
sim_setup = edbapp.new_simulation_configuration()
sim_setup.solver_type = sim_setup.SOLVER_TYPE.SiwaveSYZ
sim_setup.batch_solve_settings.cutout_subdesign_expansion = 0.01
sim_setup.batch_solve_settings.do_cutout_subdesign = True
sim_setup.use_default_cutout = False
sim_setup.batch_solve_settings.signal_nets = ["PCIE0_RX0_P", "PCIE0_RX0_N", "PCIE0_TX0_P_C", "PCIE0_TX0_N_C",
"PCIE0_TX0_P", "PCIE0_TX0_N"]
sim_setup.batch_solve_settings.signal_nets = [
"PCIE0_RX0_P",
"PCIE0_RX0_N",
"PCIE0_TX0_P_C",
"PCIE0_TX0_N_C",
"PCIE0_TX0_P",
"PCIE0_TX0_N",
]
sim_setup.batch_solve_settings.components = ["U2A5", "J2L1"]
sim_setup.batch_solve_settings.power_nets = ["GND"]
sim_setup.ac_settings.start_freq = "100Hz"
Expand Down
3 changes: 2 additions & 1 deletion doc/source/EDBAPI/SimulationEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ These classes are the containers of ``setup`` classes in EDB for both HFSS and S

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
# this call create a setup and returns the object
Expand Down
3 changes: 2 additions & 1 deletion doc/source/EDBAPI/SourcesEdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ These classes are the containers of sources methods of the EDB for both HFSS and

.. code:: python
from from pyedb.legacy.edb_core.edb import Edb
from pyedb.legacy.edb_core.edb import Edb
edb = Edb(myedb, edbversion="2023.1")
# this call returns the EDB excitations dictionary
Expand Down
1 change: 1 addition & 0 deletions doc/source/EDBAPI/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Example:
.. code:: python
from pyaedt import Edb
edb = Edb("my_project.aedb", edbversion="2023.1")
edb.core_components.components["R1"].r_value = 40
edb.close_edb()
Expand Down
4 changes: 2 additions & 2 deletions doc/source/Getting_started/Contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with this guide, paying particular attention to `Guidelines and Best Practices
<https://dev.docs.pyansys.com/how-to/index.html>`_, before attempting
to contribute to PyEDB.

The following contribution information is specific to PyEDB.

Clone the repository
Expand Down Expand Up @@ -110,7 +110,7 @@ For example:
def my_method(self, var):
pass
Every method can return a value of ``True`` when successful or
Every method can return a value of ``True`` when successful or
``False`` when failed. When a failure occurs, the error
handler returns information about the error in both the console and
log file.
Expand Down
6 changes: 3 additions & 3 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation
============
PyEDB consolidates and extends all existing capital around scripting for AEDB,
allowing re-use of existing code, sharing of best practices, and collaboration.
allowing reuse of existing code, sharing of best practices, and collaboration.

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

Expand Down Expand Up @@ -29,9 +29,9 @@ Install on CPython from PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can install PyEDB on CPython 3.7 through 3.10 from PyPI:

.. code:: python
.. code:: shell
pip install pyansys-edb
pip install pyedb
Linux support
Expand Down
6 changes: 3 additions & 3 deletions doc/source/Getting_started/Quickcode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Explicit PyEDB declaration and error management
from pyedb.legacy.edb_core.edb import EdbLegacy
edb_file = pyedb.layout_examples.ANSYS-HSD_V1.aedb
edb_file = pyedb.layout_examples.ANSYS - HSD_V1.aedb
edb = EdbLegacy(edbversion="2023.2", edbpath=edb_file)
Expand All @@ -56,7 +56,7 @@ Variables
from pyedb.legacy.edb_core.edb import EdbLegacy
edb_file = pyedb.layout_examples.ANSYS-HSD_V1.aedb
edb_file = pyedb.layout_examples.ANSYS - HSD_V1.aedb
edb = EdbLegacy(edbversion="2023.2", edbpath=edb_file)
edb["dim"] = "1mm" # design variable
edb["dim"] = "1mm" # design variable
edb["$dim"] = "1mm" # project variable
6 changes: 3 additions & 3 deletions doc/source/Getting_started/Troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Here is the path to the Python 3.7 interpreter for the 2023 R1 installation:

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

.. code:: python
.. code:: shell
>>> pip install --no-cache-dir --no-index --find-links=/path/to/pyansys-edb/wheelhouse pyansys-edb
pip install --no-cache-dir --no-index --find-links=/path/to/pyansys-edb/wheelhouse pyansys-edb
Run PyEDB with gRPC
Expand Down
4 changes: 2 additions & 2 deletions doc/source/Getting_started/versioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ and files from the MAPDL service.
Legacy interfaces
=================

.NET interface
--------------
Working with .NET interface
---------------------------

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# Ansys release version
desktop_version = "2023.2"

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

# loading EDB
edbapp = Edb(edbpath=targetfile, edbversion=desktop_version)
Expand All @@ -27,4 +27,4 @@
edbapp.save_edb()
edbapp.close_edb()
hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version)
hfss.release_desktop(close_desktop=False, close_projects=False)
hfss.release_desktop(close_desktop=False, close_projects=False)
Loading

0 comments on commit ee5ff30

Please sign in to comment.