From 22efb505597d5c7bf5ea533ade1fc84e4bcfbee4 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 11:28:31 +0100 Subject: [PATCH 01/19] CI: fix documentation.yml --- .github/workflows/build_documentation.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml index 206f983cc9..5640954ec0 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build_documentation.yml @@ -58,9 +58,9 @@ jobs: run: | python doc/print_errors.py - - name: Upload Documentation - uses: actions/upload-artifact@v3 - with: - name: Documentation - path: doc/_build/html - retention-days: 1 \ No newline at end of file + - name: Upload Documentation + uses: actions/upload-artifact@v3 + with: + name: Documentation + path: doc/_build/html + retention-days: 1 \ No newline at end of file From 384d17780638e3401eb8b7428c64a85fed9d1d45 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 11:28:49 +0100 Subject: [PATCH 02/19] DOC: update pdf file name --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 5e72f039b0..183e09d2bc 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -33,7 +33,7 @@ phtml: pdf: @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true - (test -f $(BUILDDIR)/latex/pyaedt.pdf && echo pdf exists) || exit 1 + (test -f $(BUILDDIR)/latex/pyedb.pdf && echo pdf exists) || exit 1 # build docs like the CI build cibuild: From 1dc1aedf9b89a80305e78ff6658d360ab742bbb9 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 12:27:06 +0100 Subject: [PATCH 03/19] DOC: fix typos --- doc/source/Getting_started/About.rst | 4 ++-- doc/source/Getting_started/Quickcode.rst | 2 +- doc/source/User_guide/Edb_information_queries/edb_queries.rst | 2 +- doc/source/User_guide/Padstacks/create_padsatck_instance.rst | 2 +- .../Simulation_setup/create_dc_simulation_setup.rst | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/Getting_started/About.rst b/doc/source/Getting_started/About.rst index ed88a3a6c0..44b285552f 100644 --- a/doc/source/Getting_started/About.rst +++ b/doc/source/Getting_started/About.rst @@ -26,8 +26,8 @@ AEDB is running as stand alone API and opens aedb folder for directly querying a layout design in memory and does not require opening any User Interface (UI). Hence AEDB is the fastest and most efficient way to handle large and complex layout. -AEDB can also been parsed with and Electromagnetic simulator command line like HFSS or SIwave in bacth. -Therefore completely non graphical flows can be deployed from layout translation up to simulatiom results. +AEDB can also been parsed with and Electromagnetic simulator command line like HFSS or SIwave in batch. +Therefore completely non graphical flows can be deployed from layout translation up to simulation results. AEDB can also be imported in ANSYS AEDT with PyAEDT for example to display the project, combining 3D design or performing simulation post-processing. AEDB also supports 3D component models. diff --git a/doc/source/Getting_started/Quickcode.rst b/doc/source/Getting_started/Quickcode.rst index 33ef22df0e..259f661391 100644 --- a/doc/source/Getting_started/Quickcode.rst +++ b/doc/source/Getting_started/Quickcode.rst @@ -1,4 +1,4 @@ -Quick Code +Quick code ========== Documentation and issues diff --git a/doc/source/User_guide/Edb_information_queries/edb_queries.rst b/doc/source/User_guide/Edb_information_queries/edb_queries.rst index a4a015eae1..0491d6a0e8 100644 --- a/doc/source/User_guide/Edb_information_queries/edb_queries.rst +++ b/doc/source/User_guide/Edb_information_queries/edb_queries.rst @@ -1,4 +1,4 @@ -EDB Queries +EDB queries =========== PyEDB allows layout information queries, this section describe some basic examples: diff --git a/doc/source/User_guide/Padstacks/create_padsatck_instance.rst b/doc/source/User_guide/Padstacks/create_padsatck_instance.rst index 3da3a80869..f6c880883a 100644 --- a/doc/source/User_guide/Padstacks/create_padsatck_instance.rst +++ b/doc/source/User_guide/Padstacks/create_padsatck_instance.rst @@ -1,6 +1,6 @@ Create pad-stack instance ========================= -This section describes how create padsatck instance. +This section describes how to create a padstack instance. .. autosummary:: :toctree: _autosummary diff --git a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst index b405962f6f..c053a640e8 100644 --- a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst +++ b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst @@ -23,7 +23,7 @@ This section describes how to create DC simulation setup for Siwave using Simula # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") - # create a new simulatiom setup object + # create a new simulation setup object sim_setup = edbapp.new_simulation_configuration() # disabling cutout From 6f17f60029080a874db66711c1fc1dbfc7123cc4 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 12:27:46 +0100 Subject: [PATCH 04/19] DOC: update ansys doc styles accept.txt --- doc/styles/Vocab/ANSYS/accept.txt | 67 +++++-------------------------- 1 file changed, 11 insertions(+), 56 deletions(-) diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index 646b9f7367..ab92b44075 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,86 +1,41 @@ -2D Extractor -2D modeler -3D modeler +.NET _static +AC AEDB AEDT airbox -airgap (?i)Ansys API -autosave -busbar -busbars -Bz [Cc]ircuit codecov [Cc]om -COM interface [Cc]omponents Conda CPython -DesignXploration +DC docstring [Dd]ocstrings -doppler EDB EDT -efields -EMIT -getters -globals +GDS [Gg]gRPC HFSS -Huray Icepak IronPython [Ll]ayout -limitilines matplotlib -Maxwell 2D -Maxwell 3D -Maxwell Circuit -[Mm]echanical -multiphysics -multiplot -namespaces +Maxwell(?:\s(?:2D|3D|Circuit))? netlist -Nexxim -numpy -numpydoc -[Oo]ptimetrics -padstack -padstacks -parametrics -PMs -[Pp]olyline -polylines -Postprocessing -pwl -pyaedt -PyAEDT +padstack(?:s)? +(?i)Pyaedt (?i)PyAnsys [Pp]y[Pp][Ii] Python Python.NET -pyvista -Q2D Extractor Q3D -Q3D Extractor -RC -reusability -RF -RMXprt -scipy -setters +RLC +SimulationConfiguration Siwave -Slurm -Spyder -Stackup 3D -stackups -stripline -subcircuit -[Tt]oolkits -Twin Builder -Uncomment +SYZ +(?i)stackup(?:\s3D|s)? vias \ No newline at end of file From a9d624e7fa3fe7abda8fac7b653ee91802a31c6a Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 08:59:51 +0100 Subject: [PATCH 05/19] CI: rename workflow files --- .../{build_documentation.yml => build-documentation.yml} | 2 +- .github/workflows/{legacy_examples.yml => legacy-examples.yml} | 0 .github/workflows/{legacy_tests.yml => legacy-tests.yml} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build_documentation.yml => build-documentation.yml} (93%) rename .github/workflows/{legacy_examples.yml => legacy-examples.yml} (100%) rename .github/workflows/{legacy_tests.yml => legacy-tests.yml} (100%) diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build-documentation.yml similarity index 93% rename from .github/workflows/build_documentation.yml rename to .github/workflows/build-documentation.yml index 5640954ec0..aacdddf028 100644 --- a/.github/workflows/build_documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -38,7 +38,7 @@ jobs: - name: Retrieve pyedb version run: | - echo "Pyedb version is: $(python -c "from pyedb import __version__; print(); print(__version__)" | tail -1)" + echo "Pyedb version: $(python -c "from pyedb import __version__; print(); print(__version__)" | tail -1)" - name: Install doc build requirements run: | diff --git a/.github/workflows/legacy_examples.yml b/.github/workflows/legacy-examples.yml similarity index 100% rename from .github/workflows/legacy_examples.yml rename to .github/workflows/legacy-examples.yml diff --git a/.github/workflows/legacy_tests.yml b/.github/workflows/legacy-tests.yml similarity index 100% rename from .github/workflows/legacy_tests.yml rename to .github/workflows/legacy-tests.yml From 649d217bf88d644e59498037c31b0c9519660590 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 09:00:50 +0100 Subject: [PATCH 06/19] BUGFIX: use pyedb runtime config json file --- src/pyedb/legacy/clr_module.py | 2 +- src/pyedb/misc/pyedb.runtimeconfig.json | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/pyedb/misc/pyedb.runtimeconfig.json diff --git a/src/pyedb/legacy/clr_module.py b/src/pyedb/legacy/clr_module.py index c8e8d451e3..e717fe01a7 100644 --- a/src/pyedb/legacy/clr_module.py +++ b/src/pyedb/legacy/clr_module.py @@ -35,7 +35,7 @@ from pythonnet import load if pyedb_path is not None: - json_file = os.path.abspath(os.path.join(pyedb_path, "misc", "pyaedt.runtimeconfig.json")) + json_file = os.path.abspath(os.path.join(pyedb_path, "misc", "pyedb.runtimeconfig.json")) load("coreclr", runtime_config=json_file, dotnet_root=os.environ["DOTNET_ROOT"]) print("DotNet Core correctly loaded.") if "mono" not in os.getenv("LD_LIBRARY_PATH", ""): diff --git a/src/pyedb/misc/pyedb.runtimeconfig.json b/src/pyedb/misc/pyedb.runtimeconfig.json new file mode 100644 index 0000000000..401af73f4d --- /dev/null +++ b/src/pyedb/misc/pyedb.runtimeconfig.json @@ -0,0 +1,13 @@ +{ + "runtimeOptions": { + "tfm": "net3.1", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "3.1.23" + }, + "rollForward": "LatestPatch", + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false + } + } + } \ No newline at end of file From 1cdfb1d790c6b4b16065feefbb60310ea44db19a Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 09:01:02 +0100 Subject: [PATCH 07/19] CI: fix vale warnings --- doc/styles/Vocab/ANSYS/accept.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index ab92b44075..de382a8158 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,4 +1,4 @@ -.NET +\.NET _static AC AEDB @@ -27,6 +27,7 @@ matplotlib Maxwell(?:\s(?:2D|3D|Circuit))? netlist padstack(?:s)? +(?i)Pyedb (?i)Pyaedt (?i)PyAnsys [Pp]y[Pp][Ii] From 427486107bf4f4a2bd99ac609d9b08a0e35e7ebd Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 10:44:16 +0100 Subject: [PATCH 08/19] MISC: reference pyedb and not pyaedt --- src/pyedb/legacy/clr_module.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pyedb/legacy/clr_module.py b/src/pyedb/legacy/clr_module.py index e717fe01a7..2225cf6e11 100644 --- a/src/pyedb/legacy/clr_module.py +++ b/src/pyedb/legacy/clr_module.py @@ -39,17 +39,17 @@ load("coreclr", runtime_config=json_file, dotnet_root=os.environ["DOTNET_ROOT"]) print("DotNet Core correctly loaded.") if "mono" not in os.getenv("LD_LIBRARY_PATH", ""): - warnings.warn("LD_LIBRARY_PATH needs to be setup to use pyaedt.") + warnings.warn("LD_LIBRARY_PATH needs to be setup to use pyedb.") warnings.warn("export ANSYSEM_ROOT232=/path/to/AnsysEM/v232/Linux64") msg = "export LD_LIBRARY_PATH=" msg += "$ANSYSEM_ROOT232/common/mono/Linux64/lib64:$LD_LIBRARY_PATH" - msg += "If PyAEDT will run on AEDT<2023.2 then $ANSYSEM_ROOT222/Delcross should be added to LD_LIBRARY_PATH" + msg += "If PyEDB will run on AEDT<2023.2 then $ANSYSEM_ROOT222/Delcross should be added to LD_LIBRARY_PATH" warnings.warn(msg) is_clr = True else: print("DotNet Core not correctly loaded.") except ImportError: - msg = "pythonnet or dotnetcore not installed. Pyaedt will work only in client mode." + msg = "pythonnet or dotnetcore not installed. Pyedb will work only in client mode." warnings.warn(msg) else: try: From c4fd0d7c9b18b99f18b6b8f8eaefbb5a32c3ef16 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 10:44:30 +0100 Subject: [PATCH 09/19] DOC: fix docstring see also --- src/pyedb/legacy/edb.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pyedb/legacy/edb.py b/src/pyedb/legacy/edb.py index 43b73023dc..0254009db1 100644 --- a/src/pyedb/legacy/edb.py +++ b/src/pyedb/legacy/edb.py @@ -939,7 +939,6 @@ def hfss(self): See Also -------- :class:`legacy.edb_core.edb_data.simulation_configuration.SimulationConfiguration` - for more information on configuration options. """ if not self._hfss and self.active_db: From 73df3114cc4cdc7392a5950a463fcb4fed54b488 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 12:35:11 +0100 Subject: [PATCH 10/19] MISC: update pre-commit config Remove validate github workflow files --- .pre-commit-config.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de1572ec69..779139baa4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -50,11 +50,12 @@ repos: - id: debug-statements - id: trailing-whitespace -# validate GitHub workflow files -- repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.27.0 - hooks: - - id: check-github-workflows +# # validate GitHub workflow files +# - repo: https://github.com/python-jsonschema/check-jsonschema +# rev: 0.27.0 +# hooks: +# - id: check-github-workflows +# args: ["--verbose"] # - repo: https://github.com/numpy/numpydoc # rev: v1.6.0 From 6493f1742b6f5e3a5db69c7157fe1b4f197fbd39 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 12:36:40 +0100 Subject: [PATCH 11/19] MISC: update pyptoject.toml codespell options Skip .a3dcomp extension files and ignore specific words that are used in pyedb, e.g. rlc.REnabled --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index eefd353155..d3b116e158 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -142,8 +142,9 @@ default_section = "THIRDPARTY" src_paths = ["doc", "src", "tests"] [tool.codespell] -skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,*.cdb,*.CDB,build,./docker/mapdl/v*,./factory/*,./ansys/mapdl/core/mapdl_functions.py,PKG-INFO,*.mypy_cache/*,./docker/mapdl/*,./_unused/*' +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/*' ignore-words = "doc/styles/Vocab/ANSYS/accept.txt" +ignore-words-list = "renabled, sie, mot" enable-colors = true [tool.coverage.run] From 1be6c986fe776d3c65e7b9918ca280eb21fe5400 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 12:44:24 +0100 Subject: [PATCH 12/19] CI: remove check for warnings This should just be temporary as we want to be able to build a documentation and see how it works. However, in the long run, we should fix any warnings that might be raised by sphinx. --- .github/workflows/build-documentation.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index aacdddf028..1d76373499 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -53,10 +53,12 @@ jobs: echo $'Examples\n========' > doc/source/examples/index.rst make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N" - # Verify that sphinx generates no warnings - - name: Check for warnings - run: | - python doc/print_errors.py + # FIXME: uncomment this when the documentation built is working + # and ensure that there are no more sphinx warnings. + # # Verify that sphinx generates no warnings + # - name: Check for warnings + # run: | + # python doc/print_errors.py - name: Upload Documentation uses: actions/upload-artifact@v3 From ee5ff303f69dc5930d512e21019c01821428f749 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 13:11:24 +0100 Subject: [PATCH 13/19] MISC: update following pre-commit Changes include: - formatting using black, isort, flake8 - proposed changes from codespell - doc updates following blackend-docs - trim trailing whitespace --- .gitattributes | 6 +- .github/dependabot.yml | 4 +- .pre-commit-config.yaml | 2 + LICENSE | 2 +- README.md | 9 +- doc/print_errors.py | 4 +- doc/source/EDBAPI/ComponentsEdb.rst | 4 +- doc/source/EDBAPI/CoreEdb.rst | 4 +- doc/source/EDBAPI/LayerData.rst | 3 +- doc/source/EDBAPI/NetsEdb.rst | 8 +- doc/source/EDBAPI/PadstackEdb.rst | 8 +- doc/source/EDBAPI/PortsEdb.rst | 3 +- doc/source/EDBAPI/PrimitivesEdb.rst | 12 +- doc/source/EDBAPI/SiWave.rst | 1 + .../EDBAPI/SimulationConfigurationEdb.rst | 13 +- doc/source/EDBAPI/SimulationEdb.rst | 3 +- doc/source/EDBAPI/SourcesEdb.rst | 3 +- doc/source/EDBAPI/index.rst | 1 + doc/source/Getting_started/Contributing.rst | 4 +- doc/source/Getting_started/Installation.rst | 6 +- doc/source/Getting_started/Quickcode.rst | 6 +- .../Getting_started/Troubleshooting.rst | 6 +- doc/source/Getting_started/versioning.rst | 4 +- .../SI/create_hfss_excitation_ports.py | 6 +- .../SI/create_siwave_excitation_ports.py | 27 ++-- .../build_ac_project.rst | 6 +- .../build_signal_integrity_project.rst | 6 +- .../Build_simulation_project/cutout.rst | 19 ++- .../Components/create_resistor_on_pin.rst | 2 +- .../create_rlc_boundary_on_pins.rst | 6 +- .../Components/create_rlc_component.rst | 6 +- .../Edb_information_queries/edb_queries.rst | 6 +- .../get_layout_bounding_box.rst | 2 +- .../create_circuit_ports_on_component.rst | 8 +- .../create_coax_port_on_component.rst | 4 +- .../Excitations/create_current_source.rst | 41 +++-- .../create_edge_port_on_polygon.rst | 34 +++-- .../create_port_between_pin_and_layer.rst | 8 +- .../Excitations/create_various_ports.rst | 140 +++++++++--------- .../Layer_stackup/define_layer_stackup.rst | 16 +- .../Layer_stackup/layer_stackup.rst | 19 ++- .../Load_export_edb/export_edb_to_hfss.rst | 2 +- .../Load_export_edb/export_edb_to_maxwell.rst | 6 +- .../Load_export_edb/export_edb_to_q3d.rst | 6 +- .../Load_export_edb/import_gds_file.rst | 21 ++- .../Load_export_edb/loading_layout.rst | 2 +- .../Padstacks/create_padsatck_instance.rst | 24 ++- .../Padstacks/set_all_antipads_value.rst | 4 +- .../Parametrization/use_design_variables.rst | 2 +- .../Simulation_setup/add_siwave_analysis.rst | 6 +- .../create_ac_simulation_setup.rst | 8 +- .../create_dc_simulation_setup.rst | 34 +++-- .../create_dc_simulation_setup_2.rst | 12 +- .../Simulation_setup/define_hfss_extent.rst | 7 +- .../define_hfss_simulation_setup.rst | 35 ++--- doc/source/User_guide/index.rst | 1 + doc/styles/Vocab/ANSYS/accept.txt | 2 +- examples/legacy/00_EDB_Create_VIA.py | 9 +- examples/legacy/02_edb_to_ipc2581.py | 32 ++-- .../12_edb_sma_connector_on_board.py | 25 +++- src/pyedb/generic/data_handlers.py | 7 +- src/pyedb/generic/design_types.py | 23 +-- src/pyedb/generic/general_methods.py | 52 +++---- src/pyedb/generic/plot.py | 15 +- src/pyedb/generic/process.py | 4 +- src/pyedb/generic/settings.py | 6 +- src/pyedb/ipc2581/bom/bom_item.py | 2 +- src/pyedb/ipc2581/content/content.py | 6 +- src/pyedb/ipc2581/content/dictionary_color.py | 2 +- src/pyedb/ipc2581/content/dictionary_fill.py | 2 +- src/pyedb/ipc2581/content/dictionary_line.py | 2 +- src/pyedb/ipc2581/content/entry_color.py | 2 +- src/pyedb/ipc2581/content/fill.py | 2 +- .../ipc2581/ecad/cad_data/assembly_drawing.py | 2 +- src/pyedb/ipc2581/ecad/cad_data/cad_data.py | 2 +- src/pyedb/ipc2581/ecad/cad_data/feature.py | 2 +- .../ipc2581/ecad/cad_data/layer_feature.py | 7 +- src/pyedb/ipc2581/ecad/cad_data/outline.py | 2 +- src/pyedb/ipc2581/ecad/cad_data/package.py | 4 +- .../ipc2581/ecad/cad_data/padstack_def.py | 2 +- src/pyedb/ipc2581/ecad/cad_data/path.py | 7 +- src/pyedb/ipc2581/ecad/cad_data/polygon.py | 4 +- src/pyedb/ipc2581/ecad/cad_data/stackup.py | 2 +- .../ipc2581/ecad/cad_data/stackup_group.py | 2 +- src/pyedb/ipc2581/ecad/cad_data/step.py | 4 +- src/pyedb/ipc2581/ecad/cad_header.py | 2 +- src/pyedb/ipc2581/ecad/ecad.py | 2 +- src/pyedb/ipc2581/ipc2581.py | 4 +- src/pyedb/legacy/__init__.py | 2 +- src/pyedb/legacy/application/Variables.py | 26 ++-- src/pyedb/legacy/clr_module.py | 14 +- src/pyedb/legacy/downloads.py | 4 +- src/pyedb/legacy/edb.py | 49 +++--- src/pyedb/legacy/edb_core/__init__.py | 1 - src/pyedb/legacy/edb_core/components.py | 20 +-- src/pyedb/legacy/edb_core/dotnet/database.py | 17 ++- src/pyedb/legacy/edb_core/dotnet/primitive.py | 7 +- .../edb_core/edb_data/components_data.py | 9 +- .../legacy/edb_core/edb_data/control_file.py | 17 ++- .../edb_core/edb_data/hfss_extent_info.py | 3 +- .../edb_data/hfss_simulation_setup_data.py | 11 +- .../legacy/edb_core/edb_data/nets_data.py | 13 +- .../edb_core/edb_data/padstacks_data.py | 20 +-- src/pyedb/legacy/edb_core/edb_data/ports.py | 10 +- .../edb_core/edb_data/primitives_data.py | 19 ++- .../edb_data/simulation_configuration.py | 22 ++- .../edb_core/edb_data/simulation_setup.py | 18 ++- .../edb_data/siwave_simulation_setup_data.py | 14 +- src/pyedb/legacy/edb_core/edb_data/sources.py | 5 +- .../legacy/edb_core/edb_data/terminals.py | 9 +- src/pyedb/legacy/edb_core/general.py | 9 +- src/pyedb/legacy/edb_core/hfss.py | 25 ++-- src/pyedb/legacy/edb_core/layout.py | 18 +-- .../legacy/edb_core/layout_validation.py | 10 +- src/pyedb/legacy/edb_core/materials.py | 7 +- src/pyedb/legacy/edb_core/net_class.py | 9 +- src/pyedb/legacy/edb_core/nets.py | 13 +- src/pyedb/legacy/edb_core/padstack.py | 12 +- src/pyedb/legacy/edb_core/siwave.py | 32 ++-- src/pyedb/legacy/edb_core/stackup.py | 67 +++++---- src/pyedb/misc/aedtlib_personalib_install.py | 2 +- src/pyedb/misc/downloads.py | 4 +- src/pyedb/modeler/geometry_operators.py | 5 +- tests/__init__.py | 1 - tests/legacy/integration/__init__.py | 2 +- tests/legacy/system/__init__.py | 2 +- .../system/test_edb_differential_pairs.py | 1 + tests/legacy/system/test_edb_extended_nets.py | 1 + tests/legacy/system/test_edb_stackup.py | 10 +- tests/legacy/unit/test_edbsiwave.py | 5 +- tests/legacy/unit/test_materials.py | 7 +- tests/legacy/unit/test_padstack.py | 12 +- 132 files changed, 805 insertions(+), 642 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6cda654cc1..630cd1d97e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 @@ -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 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8abbc41143..282985731f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" - reviewers: + reviewers: - "SMoraisAnsys" assignees: - "pyansys-ci-bot" @@ -18,7 +18,7 @@ updates: directory: "/" schedule: interval: "daily" - reviewers: + reviewers: - "SMoraisAnsys" assignees: - "pyansys-ci-bot" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 779139baa4..11bf3fecdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/LICENSE b/LICENSE index 07381af77c..69af3d3e4c 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index 30aa5df868..edcb31f614 100644 --- a/README.md +++ b/README.md @@ -116,8 +116,8 @@ start using EDB faster and easier. ## Example workflow - 1. - 2. + 1. + 2. ## Connect to PyEDB from Python IDE @@ -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 diff --git a/doc/print_errors.py b/doc/print_errors.py index 3652dc22d9..81209d557e 100644 --- a/doc/print_errors.py +++ b/doc/print_errors.py @@ -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() @@ -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") diff --git a/doc/source/EDBAPI/ComponentsEdb.rst b/doc/source/EDBAPI/ComponentsEdb.rst index 6770b9248a..fcb81940a8 100644 --- a/doc/source/EDBAPI/ComponentsEdb.rst +++ b/doc/source/EDBAPI/ComponentsEdb.rst @@ -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") ... @@ -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"] diff --git a/doc/source/EDBAPI/CoreEdb.rst b/doc/source/EDBAPI/CoreEdb.rst index 851eb7ec6f..2aa1eeeeb1 100644 --- a/doc/source/EDBAPI/CoreEdb.rst +++ b/doc/source/EDBAPI/CoreEdb.rst @@ -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") @@ -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 diff --git a/doc/source/EDBAPI/LayerData.rst b/doc/source/EDBAPI/LayerData.rst index 386865aac1..d6db7d5c4c 100644 --- a/doc/source/EDBAPI/LayerData.rst +++ b/doc/source/EDBAPI/LayerData.rst @@ -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 diff --git a/doc/source/EDBAPI/NetsEdb.rst b/doc/source/EDBAPI/NetsEdb.rst index 59521f7695..e8a1544df3 100644 --- a/doc/source/EDBAPI/NetsEdb.rst +++ b/doc/source/EDBAPI/NetsEdb.rst @@ -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) ... @@ -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() diff --git a/doc/source/EDBAPI/PadstackEdb.rst b/doc/source/EDBAPI/PadstackEdb.rst index b1ce2d395b..4aab2cc03b 100644 --- a/doc/source/EDBAPI/PadstackEdb.rst +++ b/doc/source/EDBAPI/PadstackEdb.rst @@ -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", ) diff --git a/doc/source/EDBAPI/PortsEdb.rst b/doc/source/EDBAPI/PortsEdb.rst index b285d62e5e..2087468bfd 100644 --- a/doc/source/EDBAPI/PortsEdb.rst +++ b/doc/source/EDBAPI/PortsEdb.rst @@ -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 diff --git a/doc/source/EDBAPI/PrimitivesEdb.rst b/doc/source/EDBAPI/PrimitivesEdb.rst index 1ddefbcee3..8977f47bec 100644 --- a/doc/source/EDBAPI/PrimitivesEdb.rst +++ b/doc/source/EDBAPI/PrimitivesEdb.rst @@ -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 + ) ... @@ -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] diff --git a/doc/source/EDBAPI/SiWave.rst b/doc/source/EDBAPI/SiWave.rst index f50c2a2e26..c31be54464 100644 --- a/doc/source/EDBAPI/SiWave.rst +++ b/doc/source/EDBAPI/SiWave.rst @@ -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") diff --git a/doc/source/EDBAPI/SimulationConfigurationEdb.rst b/doc/source/EDBAPI/SimulationConfigurationEdb.rst index 2263693733..c3bcb0df1b 100644 --- a/doc/source/EDBAPI/SimulationConfigurationEdb.rst +++ b/doc/source/EDBAPI/SimulationConfigurationEdb.rst @@ -18,7 +18,8 @@ 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() @@ -26,8 +27,14 @@ These classes are the containers of simulation configuration constructors for th 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" diff --git a/doc/source/EDBAPI/SimulationEdb.rst b/doc/source/EDBAPI/SimulationEdb.rst index c2edb6bfc4..78bac0688c 100644 --- a/doc/source/EDBAPI/SimulationEdb.rst +++ b/doc/source/EDBAPI/SimulationEdb.rst @@ -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 diff --git a/doc/source/EDBAPI/SourcesEdb.rst b/doc/source/EDBAPI/SourcesEdb.rst index 81a6ebb3db..54a67795ad 100644 --- a/doc/source/EDBAPI/SourcesEdb.rst +++ b/doc/source/EDBAPI/SourcesEdb.rst @@ -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 diff --git a/doc/source/EDBAPI/index.rst b/doc/source/EDBAPI/index.rst index f2237385e6..7352ef00ba 100644 --- a/doc/source/EDBAPI/index.rst +++ b/doc/source/EDBAPI/index.rst @@ -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() diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst index 235965da87..1e4841f81d 100644 --- a/doc/source/Getting_started/Contributing.rst +++ b/doc/source/Getting_started/Contributing.rst @@ -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 `_, before attempting to contribute to PyEDB. - + The following contribution information is specific to PyEDB. Clone the repository @@ -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. diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst index 4b22778f9e..897fed7bb4 100644 --- a/doc/source/Getting_started/Installation.rst +++ b/doc/source/Getting_started/Installation.rst @@ -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. @@ -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 diff --git a/doc/source/Getting_started/Quickcode.rst b/doc/source/Getting_started/Quickcode.rst index 259f661391..c85c445bbd 100644 --- a/doc/source/Getting_started/Quickcode.rst +++ b/doc/source/Getting_started/Quickcode.rst @@ -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) @@ -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 diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst index 9a8b88495c..47c695beda 100644 --- a/doc/source/Getting_started/Troubleshooting.rst +++ b/doc/source/Getting_started/Troubleshooting.rst @@ -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 @@ -44,9 +44,9 @@ The wheelhouse for PyAEDT can be found `here >> 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 diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst index 928685121f..1749f714f3 100644 --- a/doc/source/Getting_started/versioning.rst +++ b/doc/source/Getting_started/versioning.rst @@ -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. diff --git a/doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py b/doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py index bb039318b8..2d73f02246 100644 --- a/doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py +++ b/doc/source/Scripts_resources/SI/create_hfss_excitation_ports.py @@ -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) @@ -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) \ No newline at end of file +hfss.release_desktop(close_desktop=False, close_projects=False) diff --git a/doc/source/Scripts_resources/SI/create_siwave_excitation_ports.py b/doc/source/Scripts_resources/SI/create_siwave_excitation_ports.py index 2e90c450bc..ef64e77353 100644 --- a/doc/source/Scripts_resources/SI/create_siwave_excitation_ports.py +++ b/doc/source/Scripts_resources/SI/create_siwave_excitation_ports.py @@ -5,9 +5,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) @@ -18,16 +18,19 @@ # processing cutout edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=0.01) -if not edbapp.components.create_port_on_component(component="U1", net_list=signal_nets, - reference_net="GND", - port_type=SourceType.CircPort, - ): +if not edbapp.components.create_port_on_component( + component="U1", + net_list=signal_nets, + reference_net="GND", + port_type=SourceType.CircPort, +): edbapp.logger.error("Failed to create ports on component U1") -if not edbapp.components.create_port_on_component(component="U15", - net_list=signal_nets, - reference_net="GND", - port_type=SourceType.CircPort, - ): +if not edbapp.components.create_port_on_component( + component="U15", + net_list=signal_nets, + reference_net="GND", + port_type=SourceType.CircPort, +): edbapp.logger.error("Failed to create port on component U15") @@ -35,4 +38,4 @@ edbapp.save_edb() edbapp.close_edb() hfss = Hfss3dLayout(projectname=targetfile, specified_version=desktop_version) -hfss.release_desktop(close_desktop=False, close_projects=False) \ No newline at end of file +hfss.release_desktop(close_desktop=False, close_projects=False) diff --git a/doc/source/User_guide/Build_simulation_project/build_ac_project.rst b/doc/source/User_guide/Build_simulation_project/build_ac_project.rst index 3a5b497db6..1aae35ba9a 100644 --- a/doc/source/User_guide/Build_simulation_project/build_ac_project.rst +++ b/doc/source/User_guide/Build_simulation_project/build_ac_project.rst @@ -17,9 +17,11 @@ This section describes how to create SYZ simulation setup for Siwave using Simul # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/Powerboard_SiC_MOSFET.tgz', destination=temp_folder) + targetfile = downloads.download_file( + "edb/Powerboard_SiC_MOSFET.tgz", destination=temp_folder + ) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") diff --git a/doc/source/User_guide/Build_simulation_project/build_signal_integrity_project.rst b/doc/source/User_guide/Build_simulation_project/build_signal_integrity_project.rst index 3586a00f98..479b37fa6a 100644 --- a/doc/source/User_guide/Build_simulation_project/build_signal_integrity_project.rst +++ b/doc/source/User_guide/Build_simulation_project/build_signal_integrity_project.rst @@ -15,9 +15,9 @@ This section shows a simple example to create HFSS coaxial port on a component. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") @@ -30,7 +30,7 @@ This section shows a simple example to create HFSS coaxial port on a component. "DDR4_A3", "DDR4_A4", "DDR4_A5", - ] + ] sim_setup.power_nets = ["GND"] sim_setup.do_cutout_subdesign = True sim_setup.components = ["U1", "U15"] diff --git a/doc/source/User_guide/Build_simulation_project/cutout.rst b/doc/source/User_guide/Build_simulation_project/cutout.rst index f034e6357e..fff0ccb858 100644 --- a/doc/source/User_guide/Build_simulation_project/cutout.rst +++ b/doc/source/User_guide/Build_simulation_project/cutout.rst @@ -19,21 +19,32 @@ how to clip a design based on nets selection. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # selecting signal nets to evaluate the extent for clipping the layout - signal_nets = ["DDR4_DQ0", "DDR4_DQ1", "DDR4_DQ2", "DDR4_DQ3", "DDR4_DQ4", "DDR4_DQ5", "DDR4_DQ6", "DDR4_DQ7"] + signal_nets = [ + "DDR4_DQ0", + "DDR4_DQ1", + "DDR4_DQ2", + "DDR4_DQ3", + "DDR4_DQ4", + "DDR4_DQ5", + "DDR4_DQ6", + "DDR4_DQ7", + ] # at least one reference net must be included. Reference nets are included in the design but clipped. reference_nets = ["GND"] # defining the expansion factor. The value gives the distance for evaluating the cutout extent. Here we define a cutout expansion = 0.01 # 1cm in this case # processing cutout - edbapp.cutout(signal_list=signal_nets, reference_list=reference_nets, expansion_size=expansion) + edbapp.cutout( + signal_list=signal_nets, reference_list=reference_nets, expansion_size=expansion + ) # save and close project edbapp.save_edb() edbapp.close_edb() diff --git a/doc/source/User_guide/Components/create_resistor_on_pin.rst b/doc/source/User_guide/Components/create_resistor_on_pin.rst index 073eb10c9a..70abbe1caf 100644 --- a/doc/source/User_guide/Components/create_resistor_on_pin.rst +++ b/doc/source/User_guide/Components/create_resistor_on_pin.rst @@ -14,7 +14,7 @@ This section describes how to create resistor on pins: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") pins = edbapp.components.get_pin_from_component("U1") diff --git a/doc/source/User_guide/Components/create_rlc_boundary_on_pins.rst b/doc/source/User_guide/Components/create_rlc_boundary_on_pins.rst index 442f60c5f2..537f07d173 100644 --- a/doc/source/User_guide/Components/create_rlc_boundary_on_pins.rst +++ b/doc/source/User_guide/Components/create_rlc_boundary_on_pins.rst @@ -15,7 +15,7 @@ This section shows how to create RLC component with EDB: # download and open EDB project temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # retrieving pins from component U1 and net 1V0 @@ -25,7 +25,9 @@ This section shows how to create RLC component with EDB: ref_pins = edbapp.components.get_pin_from_component("U1", "GND") # creating rlc boundary - edbapp.hfss.create_rlc_boundary_on_pins(pins[0], ref_pins[0], rvalue=1.05, lvalue=1.05e-12, cvalue=1.78e-13) + edbapp.hfss.create_rlc_boundary_on_pins( + pins[0], ref_pins[0], rvalue=1.05, lvalue=1.05e-12, cvalue=1.78e-13 + ) # close EDB edbapp.close() \ No newline at end of file diff --git a/doc/source/User_guide/Components/create_rlc_component.rst b/doc/source/User_guide/Components/create_rlc_component.rst index 50fb8fb8a8..d1507be23f 100644 --- a/doc/source/User_guide/Components/create_rlc_component.rst +++ b/doc/source/User_guide/Components/create_rlc_component.rst @@ -15,7 +15,7 @@ This section shows how to create RLC component with EDB: # download and open EDB project temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # retrieving pins from component U1 and net 1V0 @@ -25,5 +25,7 @@ This section shows how to create RLC component with EDB: ref_pins = edbapp.components.get_pin_from_component("U1", "GND") # create RLC network between 2 pins - edbapp.components.create([pins[0], ref_pins[0]], "test_0rlc", r_value=1.67, l_value=1e-13, c_value=1e-11) + edbapp.components.create( + [pins[0], ref_pins[0]], "test_0rlc", r_value=1.67, l_value=1e-13, c_value=1e-11 + ) edbapp.close() \ No newline at end of file diff --git a/doc/source/User_guide/Edb_information_queries/edb_queries.rst b/doc/source/User_guide/Edb_information_queries/edb_queries.rst index 0491d6a0e8..5f289ea3f9 100644 --- a/doc/source/User_guide/Edb_information_queries/edb_queries.rst +++ b/doc/source/User_guide/Edb_information_queries/edb_queries.rst @@ -16,7 +16,7 @@ PyEDB allows layout information queries, this section describe some basic exampl import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") - Getting layout statistics @@ -53,4 +53,6 @@ PyEDB allows layout information queries, this section describe some basic exampl # Getting all components nets = edbapp.components.instances # Getting pins from components connected to given net - u9_gnd_pins = [pin for pin in list(edbapp.components["U9"].pins.values()) if pin.net_name == "GND"] + u9_gnd_pins = [ + pin for pin in list(edbapp.components["U9"].pins.values()) if pin.net_name == "GND" + ] diff --git a/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst b/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst index bbc731a2af..59063accf4 100644 --- a/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst +++ b/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst @@ -14,7 +14,7 @@ This section describes how to retrieve the layout size by getting the bounding b import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") edbapp.get_bounding_box() diff --git a/doc/source/User_guide/Excitations/create_circuit_ports_on_component.rst b/doc/source/User_guide/Excitations/create_circuit_ports_on_component.rst index 83093c92a6..d11ae9ae41 100644 --- a/doc/source/User_guide/Excitations/create_circuit_ports_on_component.rst +++ b/doc/source/User_guide/Excitations/create_circuit_ports_on_component.rst @@ -14,7 +14,7 @@ This section describes how to retrieve pins and create circuit ports on componen import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") edbapp.siwave.create_circuit_port_on_net("U1", "1V0", "U1", "GND", 50, "test") @@ -23,8 +23,10 @@ This section describes how to retrieve pins and create circuit ports on componen # Creating pin groups edbapp.siwave.create_pin_group_on_net("U1", "1V0", "PG_V1P0_S0") # Creating port on pin group - edbapp.siwave.create_circuit_port_on_pin_group("PG_V1P0_S0", "PinGroup_2", impedance=50, name="test_port") + edbapp.siwave.create_circuit_port_on_pin_group( + "PG_V1P0_S0", "PinGroup_2", impedance=50, name="test_port" + ) # renaming port with property setter edbapp.excitations["test_port"].name = "test_rename" # retrieving port - created_port =(port for port in list(edbapp.excitations) if port == "test_rename") + created_port = (port for port in list(edbapp.excitations) if port == "test_rename") diff --git a/doc/source/User_guide/Excitations/create_coax_port_on_component.rst b/doc/source/User_guide/Excitations/create_coax_port_on_component.rst index efc495f774..2966dacfe5 100644 --- a/doc/source/User_guide/Excitations/create_coax_port_on_component.rst +++ b/doc/source/User_guide/Excitations/create_coax_port_on_component.rst @@ -15,9 +15,9 @@ This section shows a simple example to create HFSS coaxial port on a component. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") diff --git a/doc/source/User_guide/Excitations/create_current_source.rst b/doc/source/User_guide/Excitations/create_current_source.rst index 58e949f7af..8663b749b0 100644 --- a/doc/source/User_guide/Excitations/create_current_source.rst +++ b/doc/source/User_guide/Excitations/create_current_source.rst @@ -14,7 +14,7 @@ This section describes how to create current and voltage sources: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # create simple current source on component U1 between net USB3_D_N and GND @@ -27,29 +27,46 @@ This section describes how to create current and voltage sources: edbapp.siwave.create_current_source_on_pin(pins[301], pins[10], 0.1, 0, "I22") # creating pin group on net GND from component U1 - edbapp.siwave.create_pin_group_on_net(reference_designator="U1", net_name="GND", group_name="gnd") + edbapp.siwave.create_pin_group_on_net( + reference_designator="U1", net_name="GND", group_name="gnd" + ) # creating pin group on specific pins - edbapp.siwave.create_pin_group(reference_designator="U1", pin_numbers=["A27", "A28"], group_name="vrm_pos") + edbapp.siwave.create_pin_group( + reference_designator="U1", pin_numbers=["A27", "A28"], group_name="vrm_pos" + ) # creating current source on pin group - edbapp.siwave.create_current_source_on_pin_group(pos_pin_group_name="vrm_pos", neg_pin_group_name="gnd", - name="vrm_current_source") + edbapp.siwave.create_current_source_on_pin_group( + pos_pin_group_name="vrm_pos", neg_pin_group_name="gnd", name="vrm_current_source" + ) # creating voltage source edbapp.siwave.create_pin_group( - reference_designator="U1", pin_numbers=["R23", "P23"], group_name="sink_pos" - ) - edbapp.siwave.create_voltage_source_on_pin_group("sink_pos", "gnd", name="vrm_voltage_source") + reference_designator="U1", pin_numbers=["R23", "P23"], group_name="sink_pos" + ) + edbapp.siwave.create_voltage_source_on_pin_group( + "sink_pos", "gnd", name="vrm_voltage_source" + ) # creating voltage probe - edbapp.siwave.create_pin_group(reference_designator="U1", pin_numbers=["A27", "A28"], group_name="vp_pos") - edbapp.siwave.create_pin_group(reference_designator="U1", pin_numbers=["R23", "P23"], group_name="vp_neg") + edbapp.siwave.create_pin_group( + reference_designator="U1", pin_numbers=["A27", "A28"], group_name="vp_pos" + ) + edbapp.siwave.create_pin_group( + reference_designator="U1", pin_numbers=["R23", "P23"], group_name="vp_neg" + ) dbapp.siwave.create_voltage_probe_on_pin_group("vprobe", "vp_pos", "vp_neg") edbapp.probes["vprobe"] edbapp.siwave.place_voltage_probe( - "vprobe_2", "1V0", ["112mm", "24mm"], "1_Top", "GND", ["112mm", "27mm"], "Inner1(GND1)" - ) + "vprobe_2", + "1V0", + ["112mm", "24mm"], + "1_Top", + "GND", + ["112mm", "27mm"], + "Inner1(GND1)", + ) # retrieving voltage probes vprobe_2 = edbapp.probes["vprobe_2"] diff --git a/doc/source/User_guide/Excitations/create_edge_port_on_polygon.rst b/doc/source/User_guide/Excitations/create_edge_port_on_polygon.rst index 65afea6b64..6cdfd61894 100644 --- a/doc/source/User_guide/Excitations/create_edge_port_on_polygon.rst +++ b/doc/source/User_guide/Excitations/create_edge_port_on_polygon.rst @@ -16,15 +16,17 @@ This section describes how create edge port on polygon. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # retrieving polygon list - poly_list = [poly for poly in edbapp.layout.primitives if int(poly.GetPrimitiveType()) == 2] + poly_list = [ + poly for poly in edbapp.layout.primitives if int(poly.GetPrimitiveType()) == 2 + ] # selecting specific polygons port_poly = [poly for poly in poly_list if poly.GetId() == 17][0] @@ -36,10 +38,11 @@ This section describes how create edge port on polygon. # creating edge port edbapp.hfss.create_edge_port_on_polygon( - polygon=port_poly, - reference_polygon=ref_poly, - terminal_point=port_location, - reference_point=ref_location) + polygon=port_poly, + reference_polygon=ref_poly, + terminal_point=port_location, + reference_point=ref_location, + ) # selecting specific polygon port_poly = [poly for poly in poly_list if poly.GetId() == 23][0] @@ -51,10 +54,11 @@ This section describes how create edge port on polygon. # create port on polygon edbapp.hfss.create_edge_port_on_polygon( - polygon=port_poly, - reference_polygon=ref_poly, - terminal_point=port_location, - reference_point=ref_location) + polygon=port_poly, + reference_polygon=ref_poly, + terminal_point=port_location, + reference_point=ref_location, + ) # selecting polygon port_poly = [poly for poly in poly_list if poly.GetId() == 25][0] @@ -64,11 +68,13 @@ This section describes how create edge port on polygon. # create edge port with defining reference layer edbapp.hfss.create_edge_port_on_polygon( - polygon=port_poly, terminal_point=port_location, reference_layer="gnd" - ) + polygon=port_poly, terminal_point=port_location, reference_layer="gnd" + ) # create trace - sig = edbapp.modeler.create_trace([[0, 0], ["9mm", 0]], "TOP", "1mm", "SIG", "Flat", "Flat") + sig = edbapp.modeler.create_trace( + [[0, 0], ["9mm", 0]], "TOP", "1mm", "SIG", "Flat", "Flat" + ) # create wave port a the end of the trace sig.create_edge_port("pcb_port_1", "end", "Wave", None, 8, 8) diff --git a/doc/source/User_guide/Excitations/create_port_between_pin_and_layer.rst b/doc/source/User_guide/Excitations/create_port_between_pin_and_layer.rst index 0b7c041306..f638edbe77 100644 --- a/doc/source/User_guide/Excitations/create_port_between_pin_and_layer.rst +++ b/doc/source/User_guide/Excitations/create_port_between_pin_and_layer.rst @@ -16,16 +16,16 @@ This section describes how create port between pin and layer. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") edbapp.siwave.create_port_between_pin_and_layer( - component_name="U1", pins_name="A27", layer_name="16_Bottom", reference_net="GND" - ) + component_name="U1", pins_name="A27", layer_name="16_Bottom", reference_net="GND" + ) U7 = edbapp.components["U7"] U7.pins["G7"].create_port() port = U7.pins["F7"].create_port(reference=U7.pins["E7"]) diff --git a/doc/source/User_guide/Excitations/create_various_ports.rst b/doc/source/User_guide/Excitations/create_various_ports.rst index 52edbc3539..a471533b30 100644 --- a/doc/source/User_guide/Excitations/create_various_ports.rst +++ b/doc/source/User_guide/Excitations/create_various_ports.rst @@ -7,8 +7,6 @@ This section shows a simple example to create HFSS coaxial port on a component. .. code:: python - - from pyedb.legacy.edb import EdbLegacy from pyedb.generic.general_methods import generate_unique_folder_name import pyedb.misc.downloads as downloads @@ -16,82 +14,82 @@ This section shows a simple example to create HFSS coaxial port on a component. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") prim_1_id = [i.id for i in edb.modeler.primitives if i.net_name == "trace_2"][0] - assert edb.hfss.create_edge_port_vertical(prim_1_id, ["-66mm", "-4mm"], "port_ver") + assert edb.hfss.create_edge_port_vertical(prim_1_id, ["-66mm", "-4mm"], "port_ver") - prim_2_id = [i.id for i in edb.modeler.primitives if i.net_name == "trace_3"][0] - assert edb.hfss.create_edge_port_horizontal( - prim_1_id, ["-60mm", "-4mm"], prim_2_id, ["-59mm", "-4mm"], "port_hori", 30, "Lower" - ) - assert edb.hfss.get_ports_number() == 2 - port_ver = edb.ports["port_ver"] - assert not port_ver.is_null - assert port_ver.hfss_type == "Gap" - port_hori = edb.ports["port_hori"] - assert port_hori.ref_terminal + prim_2_id = [i.id for i in edb.modeler.primitives if i.net_name == "trace_3"][0] + assert edb.hfss.create_edge_port_horizontal( + prim_1_id, ["-60mm", "-4mm"], prim_2_id, ["-59mm", "-4mm"], "port_hori", 30, "Lower" + ) + assert edb.hfss.get_ports_number() == 2 + port_ver = edb.ports["port_ver"] + assert not port_ver.is_null + assert port_ver.hfss_type == "Gap" + port_hori = edb.ports["port_hori"] + assert port_hori.ref_terminal - args = { - "layer_name": "1_Top", - "net_name": "SIGP", - "width": "0.1mm", - "start_cap_style": "Flat", - "end_cap_style": "Flat", - } - traces = [] - trace_paths = [ - [["-40mm", "-10mm"], ["-30mm", "-10mm"]], - [["-40mm", "-10.2mm"], ["-30mm", "-10.2mm"]], - [["-40mm", "-10.4mm"], ["-30mm", "-10.4mm"]], - ] - for p in trace_paths: - t = edb.modeler.create_trace(path_list=p, **args) - traces.append(t) + args = { + "layer_name": "1_Top", + "net_name": "SIGP", + "width": "0.1mm", + "start_cap_style": "Flat", + "end_cap_style": "Flat", + } + traces = [] + trace_paths = [ + [["-40mm", "-10mm"], ["-30mm", "-10mm"]], + [["-40mm", "-10.2mm"], ["-30mm", "-10.2mm"]], + [["-40mm", "-10.4mm"], ["-30mm", "-10.4mm"]], + ] + for p in trace_paths: + t = edb.modeler.create_trace(path_list=p, **args) + traces.append(t) - assert edb.hfss.create_wave_port(traces[0].id, trace_paths[0][0], "wave_port") - wave_port = edb.ports["wave_port"] - wave_port.horizontal_extent_factor = 10 - wave_port.vertical_extent_factor = 10 - assert wave_port.horizontal_extent_factor == 10 - assert wave_port.vertical_extent_factor == 10 - wave_port.radial_extent_factor = 1 - assert wave_port.radial_extent_factor == 1 - assert wave_port.pec_launch_width - assert not wave_port.deembed - assert wave_port.deembed_length == 0.0 - assert wave_port.do_renormalize - wave_port.do_renormalize = False - assert not wave_port.do_renormalize - assert edb.hfss.create_differential_wave_port( - traces[0].id, - trace_paths[0][0], - traces[1].id, - trace_paths[1][0], - horizontal_extent_factor=8, - port_name="df_port", - ) - assert edb.ports["df_port"] - p, n = edb.ports["df_port"].terminals - assert edb.ports["df_port"].decouple() - p.couple_ports(n) + assert edb.hfss.create_wave_port(traces[0].id, trace_paths[0][0], "wave_port") + wave_port = edb.ports["wave_port"] + wave_port.horizontal_extent_factor = 10 + wave_port.vertical_extent_factor = 10 + assert wave_port.horizontal_extent_factor == 10 + assert wave_port.vertical_extent_factor == 10 + wave_port.radial_extent_factor = 1 + assert wave_port.radial_extent_factor == 1 + assert wave_port.pec_launch_width + assert not wave_port.deembed + assert wave_port.deembed_length == 0.0 + assert wave_port.do_renormalize + wave_port.do_renormalize = False + assert not wave_port.do_renormalize + assert edb.hfss.create_differential_wave_port( + traces[0].id, + trace_paths[0][0], + traces[1].id, + trace_paths[1][0], + horizontal_extent_factor=8, + port_name="df_port", + ) + assert edb.ports["df_port"] + p, n = edb.ports["df_port"].terminals + assert edb.ports["df_port"].decouple() + p.couple_ports(n) - traces_id = [i.id for i in traces] - paths = [i[1] for i in trace_paths] - _, df_port = edb.hfss.create_bundle_wave_port(traces_id, paths) - assert df_port.name - assert df_port.terminals - df_port.horizontal_extent_factor = 10 - df_port.vertical_extent_factor = 10 - df_port.deembed = True - df_port.deembed_length = "1mm" - assert df_port.horizontal_extent_factor == 10 - assert df_port.vertical_extent_factor == 10 - assert df_port.deembed - assert df_port.deembed_length == 1e-3 - edb.close() \ No newline at end of file + traces_id = [i.id for i in traces] + paths = [i[1] for i in trace_paths] + _, df_port = edb.hfss.create_bundle_wave_port(traces_id, paths) + assert df_port.name + assert df_port.terminals + df_port.horizontal_extent_factor = 10 + df_port.vertical_extent_factor = 10 + df_port.deembed = True + df_port.deembed_length = "1mm" + assert df_port.horizontal_extent_factor == 10 + assert df_port.vertical_extent_factor == 10 + assert df_port.deembed + assert df_port.deembed_length == 1e-3 + edb.close() \ No newline at end of file diff --git a/doc/source/User_guide/Layer_stackup/define_layer_stackup.rst b/doc/source/User_guide/Layer_stackup/define_layer_stackup.rst index 5954cda7ff..a098b48eaa 100644 --- a/doc/source/User_guide/Layer_stackup/define_layer_stackup.rst +++ b/doc/source/User_guide/Layer_stackup/define_layer_stackup.rst @@ -13,8 +13,16 @@ This section describes how create layer stackup. edb = EdbLegacy(edbversion=desktop_version) edb.stackup.add_layer(layer_name="gnd", fillMaterial="AIR", thickness="10um") - edb.stackup.add_layer(layer_name="diel1", fillMaterial="AIR", thickness="200um", base_layer="gnd") - edb.stackup.add_layer(layer_name="sig1", fillMaterial="AIR", thickness="10um", base_layer="diel1") - edb.stackup.add_layer(layer_name="diel2", fillMaterial="AIR", thickness="200um", base_layer="sig1") - edb.stackup.add_layer(layer_name="sig3", fillMaterial="AIR", thickness="10um", base_layer="diel2") + edb.stackup.add_layer( + layer_name="diel1", fillMaterial="AIR", thickness="200um", base_layer="gnd" + ) + edb.stackup.add_layer( + layer_name="sig1", fillMaterial="AIR", thickness="10um", base_layer="diel1" + ) + edb.stackup.add_layer( + layer_name="diel2", fillMaterial="AIR", thickness="200um", base_layer="sig1" + ) + edb.stackup.add_layer( + layer_name="sig3", fillMaterial="AIR", thickness="10um", base_layer="diel2" + ) edb.close() \ No newline at end of file diff --git a/doc/source/User_guide/Layer_stackup/layer_stackup.rst b/doc/source/User_guide/Layer_stackup/layer_stackup.rst index 4de06737f5..fa560089be 100644 --- a/doc/source/User_guide/Layer_stackup/layer_stackup.rst +++ b/doc/source/User_guide/Layer_stackup/layer_stackup.rst @@ -14,10 +14,10 @@ This section describes how to edit layer stackup: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") - # ploting layer stackup in matplotlib + # plotting layer stackup in matplotlib edbapp.stackup.plot() .. image:: ../../Resources/stackup.png @@ -43,14 +43,23 @@ This section describes how to edit layer stackup: for layer_name, layer in edbapp.stackup.signal_layers.items(): layer.thickness = "20um" - edbapp.materials.add_material(name="MyMaterial", permittivity=4.35, dielectric_loss_tangent=2e-4) + edbapp.materials.add_material( + name="MyMaterial", permittivity=4.35, dielectric_loss_tangent=2e-4 + ) edbapp.materials.add_material(name="MyMetal", conductivity=1e7) for layer in list(edbapp.stackup.dielectric_layers.values()): layer.material = "MyMaterial" for layer in list(edbapp.stackup.signal_layers.values()): layer.material = "MyMetal" - edbapp.materials.add_material(name="SolderMask", permittivity=3.8, dielectric_loss_tangent=1e-3) - edbapp.stackup.add_layer(layer_name="Solder_mask", base_layer="1_Top", thickness="200um", material="SolderMask") + edbapp.materials.add_material( + name="SolderMask", permittivity=3.8, dielectric_loss_tangent=1e-3 + ) + edbapp.stackup.add_layer( + layer_name="Solder_mask", + base_layer="1_Top", + thickness="200um", + material="SolderMask", + ) diff --git a/doc/source/User_guide/Load_export_edb/export_edb_to_hfss.rst b/doc/source/User_guide/Load_export_edb/export_edb_to_hfss.rst index 5fa714bc72..5a7765ee47 100644 --- a/doc/source/User_guide/Load_export_edb/export_edb_to_hfss.rst +++ b/doc/source/User_guide/Load_export_edb/export_edb_to_hfss.rst @@ -14,7 +14,7 @@ This section describes how to export EDB to HFSS: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # define export options diff --git a/doc/source/User_guide/Load_export_edb/export_edb_to_maxwell.rst b/doc/source/User_guide/Load_export_edb/export_edb_to_maxwell.rst index e5fd946ff8..a6ae459253 100644 --- a/doc/source/User_guide/Load_export_edb/export_edb_to_maxwell.rst +++ b/doc/source/User_guide/Load_export_edb/export_edb_to_maxwell.rst @@ -14,7 +14,7 @@ This section describes how to export EDB to Maxwell: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # define export options @@ -22,5 +22,7 @@ This section describes how to export EDB to Maxwell: edbapp.write_export3d_option_config_file(temp_folder, options_config) # export to Maxwell with given net list - edbapp.export_maxwell(temp_folder, net_list=["ANALOG_A0", "ANALOG_A1", "ANALOG_A2"], hidden=True) + edbapp.export_maxwell( + temp_folder, net_list=["ANALOG_A0", "ANALOG_A1", "ANALOG_A2"], hidden=True + ) edbapp.close() diff --git a/doc/source/User_guide/Load_export_edb/export_edb_to_q3d.rst b/doc/source/User_guide/Load_export_edb/export_edb_to_q3d.rst index 130f93dd95..f2f37e0f63 100644 --- a/doc/source/User_guide/Load_export_edb/export_edb_to_q3d.rst +++ b/doc/source/User_guide/Load_export_edb/export_edb_to_q3d.rst @@ -14,7 +14,7 @@ This section describes how to export EDB to Q3D: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # define export options @@ -22,6 +22,8 @@ This section describes how to export EDB to Q3D: edbapp.write_export3d_option_config_file(temp_folder, options_config) # export to Q3D with given net list - edbapp.export_q3d(temp_folder, net_list=["ANALOG_A0", "ANALOG_A1", "ANALOG_A2"], hidden=True) + edbapp.export_q3d( + temp_folder, net_list=["ANALOG_A0", "ANALOG_A1", "ANALOG_A2"], hidden=True + ) edbapp.close() diff --git a/doc/source/User_guide/Load_export_edb/import_gds_file.rst b/doc/source/User_guide/Load_export_edb/import_gds_file.rst index 45538321cd..655145ad1b 100644 --- a/doc/source/User_guide/Load_export_edb/import_gds_file.rst +++ b/doc/source/User_guide/Load_export_edb/import_gds_file.rst @@ -13,12 +13,19 @@ Files and location must be adapted by the user. from pyedb.legacy.edb import EdbLegacy from pyedb.legacy.edb_core.edb_data.control_file import ControlFile + c_file_in = os.path.join( - local_path, "example_models", "cad", "GDS", "sky130_fictitious_dtc_example_control_no_map.xml" - ) + local_path, + "example_models", + "cad", + "GDS", + "sky130_fictitious_dtc_example_control_no_map.xml", + ) target_location = r"C:\Temp" c_map = os.path.join(local_path, "example_models", "cad", "GDS", "dummy_layermap.map") - gds_in = os.path.join(local_path, "example_models", "cad", "GDS", "sky130_fictitious_dtc_example.gds") + gds_in = os.path.join( + local_path, "example_models", "cad", "GDS", "sky130_fictitious_dtc_example.gds" + ) gds_out = os.path.join(target_location, "sky130_fictitious_dtc_example.gds") pyedb.legacy.misc.copyfile(gds_in, gds_out) @@ -27,7 +34,9 @@ Files and location must be adapted by the user. setup.add_sweep("Sweep1", "0.01GHz", "5GHz", "0.1GHz") c.boundaries.units = "um" c.stackup.units = "um" - c.boundaries.add_port("P1", x1=223.7, y1=222.6, layer1="Metal6", x2=223.7, y2=100, layer2="Metal6") + c.boundaries.add_port( + "P1", x1=223.7, y1=222.6, layer1="Metal6", x2=223.7, y2=100, layer2="Metal6" + ) c.boundaries.add_extent() comp = c.components.add_component("B1", "BGA", "IC", "Flip chip", "Cylinder") comp.solder_diameter = "65um" @@ -41,7 +50,9 @@ Files and location must be adapted by the user. c.write_xml(os.path.join(self.local_scratch.path, "test_138.xml")) c.import_options.import_dummy_nets = True edb = EdbLegacy( - gds_out, edbversion=desktop_version, technology_file=os.path.join(self.local_scratch.path, "test_138.xml") + gds_out, + edbversion=desktop_version, + technology_file=os.path.join(self.local_scratch.path, "test_138.xml"), ) edb.close() \ No newline at end of file diff --git a/doc/source/User_guide/Load_export_edb/loading_layout.rst b/doc/source/User_guide/Load_export_edb/loading_layout.rst index 4d9ec63dfe..00b68bbeae 100644 --- a/doc/source/User_guide/Load_export_edb/loading_layout.rst +++ b/doc/source/User_guide/Load_export_edb/loading_layout.rst @@ -15,7 +15,7 @@ objects. import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") .. image:: ../../Resources/starting_load_edb.png diff --git a/doc/source/User_guide/Padstacks/create_padsatck_instance.rst b/doc/source/User_guide/Padstacks/create_padsatck_instance.rst index f6c880883a..1fe07a6d32 100644 --- a/doc/source/User_guide/Padstacks/create_padsatck_instance.rst +++ b/doc/source/User_guide/Padstacks/create_padsatck_instance.rst @@ -14,7 +14,9 @@ This section describes how to create a padstack instance. edb = EdbLegacy(edbversion=desktop_version) edb.stackup.add_layer(layer_name="1_Top", fillMaterial="AIR", thickness="30um") - edb.stackup.add_layer(layer_name="contact", fillMaterial="AIR", thickness="100um", base_layer="1_Top") + edb.stackup.add_layer( + layer_name="contact", fillMaterial="AIR", thickness="100um", base_layer="1_Top" + ) edb.padstacks.create( pad_shape="Rectangle", @@ -23,12 +25,18 @@ This section describes how to create a padstack instance. y_size="500um", holediam=0, ) - pad_instance1 = edb.padstacks.place(position=["-0.65mm", "-0.665mm"], definition_name="pad") + pad_instance1 = edb.padstacks.place( + position=["-0.65mm", "-0.665mm"], definition_name="pad" + ) pad_instance1.start_layer = "1_Top" pad_instance1.stop_layer = "1_Top" - edb.padstacks.create(pad_shape="Circle", padstackname="pad2", paddiam="350um", holediam="15um") - pad_instance2 = edb.padstacks.place(position=["-0.65mm", "-0.665mm"], definition_name="pad2") + edb.padstacks.create( + pad_shape="Circle", padstackname="pad2", paddiam="350um", holediam="15um" + ) + pad_instance2 = edb.padstacks.place( + position=["-0.65mm", "-0.665mm"], definition_name="pad2" + ) pad_instance2.start_layer = "1_Top" pad_instance2.stop_layer = "1_Top" @@ -45,11 +53,15 @@ This section describes how to create a padstack instance. stop_layer="1_Top", ) - pad_instance3 = edb.padstacks.place(position=["-1.65mm", "-1.665mm"], definition_name="test2") + pad_instance3 = edb.padstacks.place( + position=["-1.65mm", "-1.665mm"], definition_name="test2" + ) pad_instance3.dcir_equipotential_region = True pad_instance3.dcir_equipotential_region = False - trace = edb.modeler.create_trace([[0, 0], [0, 10e-3]], "1_Top", "0.1mm", "trace_with_via_fence") + trace = edb.modeler.create_trace( + [[0, 0], [0, 10e-3]], "1_Top", "0.1mm", "trace_with_via_fence" + ) edb.padstacks.create_padstack("via_0") trace.create_via_fence("1mm", "1mm", "via_0") diff --git a/doc/source/User_guide/Padstacks/set_all_antipads_value.rst b/doc/source/User_guide/Padstacks/set_all_antipads_value.rst index 0aaa9d8233..38801c8b48 100644 --- a/doc/source/User_guide/Padstacks/set_all_antipads_value.rst +++ b/doc/source/User_guide/Padstacks/set_all_antipads_value.rst @@ -16,9 +16,9 @@ This shows how to set all anti-pads value to fixed one. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") diff --git a/doc/source/User_guide/Parametrization/use_design_variables.rst b/doc/source/User_guide/Parametrization/use_design_variables.rst index 80f226f2d3..05e7a45026 100644 --- a/doc/source/User_guide/Parametrization/use_design_variables.rst +++ b/doc/source/User_guide/Parametrization/use_design_variables.rst @@ -14,7 +14,7 @@ This section shows how to use variables with EDB: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # adding design variable diff --git a/doc/source/User_guide/Simulation_setup/add_siwave_analysis.rst b/doc/source/User_guide/Simulation_setup/add_siwave_analysis.rst index 59854dc92d..d35a01f53c 100644 --- a/doc/source/User_guide/Simulation_setup/add_siwave_analysis.rst +++ b/doc/source/User_guide/Simulation_setup/add_siwave_analysis.rst @@ -14,11 +14,13 @@ This section shows how to add Siwave analysis: import pyedb.misc.downloads as downloads temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") # Adding Siwave SYZ analysis - edbapp.siwave.add_siwave_syz_analysis(start_freq="=GHz", stop_freq="10GHz", step_freq="10MHz") + edbapp.siwave.add_siwave_syz_analysis( + start_freq="=GHz", stop_freq="10GHz", step_freq="10MHz" + ) # Adding DC analysis edbapp.siwave.add_siwave_dc_analysis(name="Test_dc") diff --git a/doc/source/User_guide/Simulation_setup/create_ac_simulation_setup.rst b/doc/source/User_guide/Simulation_setup/create_ac_simulation_setup.rst index f7dcb03d57..7a70997dab 100644 --- a/doc/source/User_guide/Simulation_setup/create_ac_simulation_setup.rst +++ b/doc/source/User_guide/Simulation_setup/create_ac_simulation_setup.rst @@ -17,9 +17,11 @@ This section describes how to create AC simulation setup for Siwave. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/Powerboard_SiC_MOSFET.tgz', destination=temp_folder) + targetfile = downloads.download_file( + "edb/Powerboard_SiC_MOSFET.tgz", destination=temp_folder + ) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") @@ -57,7 +59,7 @@ This section describes how to create AC simulation setup for Siwave. ["log scale", "1kHz", "0.1GHz", 10], ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], ], - ) + ) # settings sweep options sweep.adaptive_sampling = True diff --git a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst index c053a640e8..61c783e6da 100644 --- a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst +++ b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup.rst @@ -16,9 +16,11 @@ This section describes how to create DC simulation setup for Siwave using Simula # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/Powerboard_SiC_MOSFET.tgz', destination=temp_folder) + targetfile = downloads.download_file( + "edb/Powerboard_SiC_MOSFET.tgz", destination=temp_folder + ) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") @@ -29,27 +31,31 @@ This section describes how to create DC simulation setup for Siwave using Simula # disabling cutout sim_setup.do_cutout_subdesign = False - # selectin solver type + # selecting solver type sim_setup.solver_type = SolverType.SiwaveDC - # adding volatge source + # adding voltage source sim_setup.add_voltage_source( - positive_node_component="Q3", - positive_node_net="SOURCE_HBA_PHASEA", - negative_node_component="Q3", - negative_node_net="HV_DC+") + positive_node_component="Q3", + positive_node_net="SOURCE_HBA_PHASEA", + negative_node_component="Q3", + negative_node_net="HV_DC+", + ) # adding current source sim_setup.add_current_source( - name="I25", - positive_node_component="Q5", - positive_node_net="SOURCE_HBB_PHASEB", - negative_node_component="Q5", - negative_node_net="HV_DC+") + name="I25", + positive_node_component="Q5", + positive_node_net="SOURCE_HBB_PHASEB", + negative_node_component="Q5", + negative_node_net="HV_DC+", + ) # defining out put files sim_setup.open_edb_after_build = False - sim_setup.batch_solve_settings.output_aedb = os.path.join(self.local_scratch.path, "build.aedb") + sim_setup.batch_solve_settings.output_aedb = os.path.join( + self.local_scratch.path, "build.aedb" + ) original_path = edbapp.edbpath # specifying multi-threaded cutout diff --git a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup_2.rst b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup_2.rst index 6f8b6b934d..f3f214fba6 100644 --- a/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup_2.rst +++ b/doc/source/User_guide/Simulation_setup/create_dc_simulation_setup_2.rst @@ -14,9 +14,11 @@ This section describes how to create DC simulation setup for Siwave. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/Powerboard_SiC_MOSFET.tgz', destination=temp_folder) + targetfile = downloads.download_file( + "edb/Powerboard_SiC_MOSFET.tgz", destination=temp_folder + ) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") @@ -27,7 +29,7 @@ This section describes how to create DC simulation setup for Siwave. settings = edbapp.setups["DC1"].get_configurations() for k, v in setup1.dc_settings.defaults.items(): - if k in ["compute_inductance", "plot_jv"]: + if k in ["compute_inductance", "plot_jv"]: continue settings["dc_settings"][k] == v @@ -38,6 +40,6 @@ This section describes how to create DC simulation setup for Siwave. setup1.set_dc_slider(p) settings = edbapp.setups["DC1"].get_configurations() for k, v in setup1.dc_settings.dc_defaults.items(): - settings["dc_settings"][k] == v[p] + assert settings["dc_settings"][k] == v[p] for k, v in setup1.dc_advanced_settings.dc_defaults.items(): - assert settings["dc_advanced_settings"][k] == v[p] \ No newline at end of file + assert settings["dc_advanced_settings"][k] == v[p] diff --git a/doc/source/User_guide/Simulation_setup/define_hfss_extent.rst b/doc/source/User_guide/Simulation_setup/define_hfss_extent.rst index 670816bfe7..570f78adb1 100644 --- a/doc/source/User_guide/Simulation_setup/define_hfss_extent.rst +++ b/doc/source/User_guide/Simulation_setup/define_hfss_extent.rst @@ -10,6 +10,7 @@ This section describes how define HFSS extent using SimulationConfiguration clas from pyedb.legacy.edb import EdbLegacy + # create new EDB edb = EdbLegacy() @@ -19,7 +20,9 @@ This section describes how define HFSS extent using SimulationConfiguration clas edb.stackup.add_layer(layer_name="SIGNAL", base_layer="FR4", thickness="30um") # create trace - edb.modeler.create_trace(layer_name="SIGNAL", width=0.02, net_name="net1", path_list=[[-1e3, 0, 1e-3, 0]]) + edb.modeler.create_trace( + layer_name="SIGNAL", width=0.02, net_name="net1", path_list=[[-1e3, 0, 1e-3, 0]] + ) # create primitive rectangle edb.modeler.create_rectangle( @@ -57,7 +60,7 @@ This section describes how define HFSS extent using SimulationConfiguration clas # disable cutout sim_setup.do_cutout_subdesign = False - # disbale port generation + # disable port generation sim_setup.generate_excitations = False # build project diff --git a/doc/source/User_guide/Simulation_setup/define_hfss_simulation_setup.rst b/doc/source/User_guide/Simulation_setup/define_hfss_simulation_setup.rst index 603eb95196..b4a4887c53 100644 --- a/doc/source/User_guide/Simulation_setup/define_hfss_simulation_setup.rst +++ b/doc/source/User_guide/Simulation_setup/define_hfss_simulation_setup.rst @@ -7,8 +7,6 @@ This section shows how to create HFSS simulation setup. .. code:: python - - from pyedb.legacy.edb import EdbLegacy from pyedb.generic.general_methods import generate_unique_folder_name import pyedb.misc.downloads as downloads @@ -16,9 +14,9 @@ This section shows how to create HFSS simulation setup. # Ansys release version ansys_version = "2023.2" - #download and copy the layout file from examples + # download and copy the layout file from examples temp_folder = generate_unique_folder_name() - targetfile = downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) + targetfile = downloads.download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) # loading EDB edbapp = EdbLegacy(edbpath=targetfile, edbversion="2023.2") @@ -92,10 +90,9 @@ This section shows how to create HFSS simulation setup. # enable defeaturing setup1.defeature_settings.use_defeature = False - # enable absloute length defeaturing + # enable absolute length defeaturing setup1.defeature_settings.use_defeature_abs_length = True - via settings via_settings = setup1.via_settings via_settings.via_density = 1 via_settings.via_material = "pec" @@ -133,21 +130,23 @@ This section shows how to create HFSS simulation setup. # adding frequency sweep setup1.add_frequency_sweep( - "sweep1", - frequency_sweep=[ - ["linear count", "0", "1kHz", 1], - ["log scale", "1kHz", "0.1GHz", 10], - ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ], - ) - sweep1 = setup1.frequency_sweeps["sweep1"] - sweep1.adaptive_sampling = True + "sweep1", + frequency_sweep=[ + ["linear count", "0", "1kHz", 1], + ["log scale", "1kHz", "0.1GHz", 10], + ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], + ], + ) + sweep1 = setup1.frequency_sweeps["sweep1"] + sweep1.adaptive_sampling = True # changing setup name edbapp.setups["setup1"].name = "setup1a" # adding length based mesh operation - mop = edbapp.setups["setup1a"].add_length_mesh_operation({"GND": ["1_Top", "16_Bottom"]}, "m1") + mop = edbapp.setups["setup1a"].add_length_mesh_operation( + {"GND": ["1_Top", "16_Bottom"]}, "m1" + ) mop.name = "m2" mop.max_elements = 2000 mop.restrict_max_elements = False @@ -156,7 +155,9 @@ This section shows how to create HFSS simulation setup. # adding skin depth mesh operation - mop = edbapp.setups["setup1a"].add_skin_depth_mesh_operation({"GND": ["1_Top", "16_Bottom"]}) + mop = edbapp.setups["setup1a"].add_skin_depth_mesh_operation( + {"GND": ["1_Top", "16_Bottom"]} + ) mop.skin_depth = "5um" mop.surface_triangle_length = "2mm" mop.number_of_layer_elements = "3" diff --git a/doc/source/User_guide/index.rst b/doc/source/User_guide/index.rst index a66fd25ea2..8f93983774 100644 --- a/doc/source/User_guide/index.rst +++ b/doc/source/User_guide/index.rst @@ -11,6 +11,7 @@ PyEDB is loading ANSYS EDB in memory meaning non graphically. # Load EDB from pyedb.legacy.edb_core.edb import EdbLegacy + edb_file = pyedb.layout_examples.ANSYS_HSD_v1.aedb edb = EdbLegacy(edb_file) diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index de382a8158..c8a6ce0cfb 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,4 +1,4 @@ -\.NET +.NET _static AC AEDB diff --git a/examples/legacy/00_EDB_Create_VIA.py b/examples/legacy/00_EDB_Create_VIA.py index e2c00e8345..b612d46eee 100644 --- a/examples/legacy/00_EDB_Create_VIA.py +++ b/examples/legacy/00_EDB_Create_VIA.py @@ -18,11 +18,14 @@ # Import the EDB layout object and initialize it on version 2023 R2. ###################################################################### -import time import os +import time + import pyedb -from pyedb.generic.general_methods import generate_unique_folder_name -from pyedb.generic.general_methods import generate_unique_name +from pyedb.generic.general_methods import ( + generate_unique_folder_name, + generate_unique_name, +) start = time.time() diff --git a/examples/legacy/02_edb_to_ipc2581.py b/examples/legacy/02_edb_to_ipc2581.py index d384e7fa64..034ca3d36a 100644 --- a/examples/legacy/02_edb_to_ipc2581.py +++ b/examples/legacy/02_edb_to_ipc2581.py @@ -10,10 +10,13 @@ # Perform required imports, which includes importing a section. import os + import pyedb +from pyedb.generic.general_methods import ( + generate_unique_folder_name, + generate_unique_name, +) from pyedb.legacy.downloads import download_file -from pyedb.generic.general_methods import generate_unique_folder_name -from pyedb.generic.general_methods import generate_unique_name ############################################################################### # Download file @@ -22,7 +25,7 @@ temp_folder = generate_unique_folder_name() -targetfile = download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) +targetfile = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_folder) ipc2581_file = os.path.join(temp_folder, "Ansys_Hsd.xml") @@ -43,9 +46,7 @@ # ~~~~~~~~~~~~~~~ # Parametrize a net. -edb.modeler.parametrize_trace_width( - "A0_N", parameter_name=generate_unique_name("Par"), variable_value="0.4321mm" -) +edb.modeler.parametrize_trace_width("A0_N", parameter_name=generate_unique_name("Par"), variable_value="0.4321mm") ############################################################################### # Cutout @@ -56,14 +57,17 @@ if "PCIe" in net: signal_list.append(net) power_list = ["GND"] -edb.cutout(signal_list=signal_list, reference_list=power_list, extent_type="ConvexHull", - expansion_size=0.002, - use_round_corner=False, - number_of_threads=4, - remove_single_pin_components=True, - use_pyaedt_extent_computing=True, - extent_defeature=0, - ) +edb.cutout( + signal_list=signal_list, + reference_list=power_list, + extent_type="ConvexHull", + expansion_size=0.002, + use_round_corner=False, + number_of_threads=4, + remove_single_pin_components=True, + use_pyaedt_extent_computing=True, + extent_defeature=0, +) ############################################################################### # Plot cutout diff --git a/examples/legacy/pyaedt_integration/12_edb_sma_connector_on_board.py b/examples/legacy/pyaedt_integration/12_edb_sma_connector_on_board.py index 6aa749b703..225e92f2bf 100644 --- a/examples/legacy/pyaedt_integration/12_edb_sma_connector_on_board.py +++ b/examples/legacy/pyaedt_integration/12_edb_sma_connector_on_board.py @@ -24,14 +24,17 @@ ###################################################################### import os + import numpy as np +from pyaedt import Hfss3dLayout + # import pyaedt import pyedb +from pyedb.generic.general_methods import ( + generate_unique_folder_name, + generate_unique_name, +) from pyedb.legacy.downloads import download_file -from pyaedt import Hfss3dLayout -from pyedb.generic.general_methods import generate_unique_folder_name -from pyedb.generic.general_methods import generate_unique_name - ansys_version = "2023.2" @@ -180,11 +183,19 @@ # Place 3D component # ~~~~~~~~~~~~~~~~~~ -component3d = download_file("component_3d", "SMA_RF_SURFACE_MOUNT.a3dcomp",) +component3d = download_file( + "component_3d", + "SMA_RF_SURFACE_MOUNT.a3dcomp", +) comp = h3d.modeler.place_3d_component( - component_path=component3d, number_of_terminals=1, placement_layer="TOP", component_name="my_connector", - pos_x="5mm", pos_y=0.000) + component_path=component3d, + number_of_terminals=1, + placement_layer="TOP", + component_name="my_connector", + pos_x="5mm", + pos_y=0.000, +) ########## # Analysis diff --git a/src/pyedb/generic/data_handlers.py b/src/pyedb/generic/data_handlers.py index 2712a0f801..e98b07efed 100644 --- a/src/pyedb/generic/data_handlers.py +++ b/src/pyedb/generic/data_handlers.py @@ -7,8 +7,7 @@ import re import string -from pyedb.generic.general_methods import pyedb_function_handler -from pyedb.generic.general_methods import settings +from pyedb.generic.general_methods import pyedb_function_handler, settings @pyedb_function_handler() @@ -33,7 +32,7 @@ def _tuple2dict(t, d): elif isinstance(v, list) and len(t) == 2 and not v: d[k] = None elif ( - isinstance(v, list) and isinstance(v[0], tuple) and len(t) == 2 + isinstance(v, list) and isinstance(v[0], tuple) and len(t) == 2 ): # len check is to avoid expanding the list with a 3rd element=None if k in d: if not isinstance(d[k], list): @@ -67,7 +66,7 @@ def _arg2dict(arg, dict_out): i = 1 while i < len(arg): if arg[i][0][:5] == "NAME:" and ( - isinstance(arg[i], (list, tuple)) or str(type(arg[i])) == r"" + isinstance(arg[i], (list, tuple)) or str(type(arg[i])) == r"" ): _arg2dict(list(arg[i]), dict_in) i += 1 diff --git a/src/pyedb/generic/design_types.py b/src/pyedb/generic/design_types.py index ddac9a74dc..8cb182618e 100644 --- a/src/pyedb/generic/design_types.py +++ b/src/pyedb/generic/design_types.py @@ -84,20 +84,22 @@ def Edb( # Use EDB legacy (default choice) if bool(os.getenv("PYEDB_USE_LEGACY", "1")): from pyedb.legacy.edb import EdbLegacy as app + return app( - edbpath=edbpath, - cellname=cellname, - isreadonly=isreadonly, - edbversion=edbversion, - isaedtowned=isaedtowned, - oproject=oproject, - student_version=student_version, - use_ppe=use_ppe, - technology_file=technology_file, - ) + edbpath=edbpath, + cellname=cellname, + isreadonly=isreadonly, + edbversion=edbversion, + isaedtowned=isaedtowned, + oproject=oproject, + student_version=student_version, + use_ppe=use_ppe, + technology_file=technology_file, + ) # TODO: Use EDB gRPC else: from pyedb.grpc.edb import Edb as app + return app( edbpath=edbpath, cellname=cellname, @@ -112,4 +114,3 @@ def Edb( app_map = {"EDB": Edb} - diff --git a/src/pyedb/generic/general_methods.py b/src/pyedb/generic/general_methods.py index 0bade3f549..cf118c2782 100644 --- a/src/pyedb/generic/general_methods.py +++ b/src/pyedb/generic/general_methods.py @@ -1,27 +1,27 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import -from functools import update_wrapper -import os -import sys -import time -import string -import random -from collections import OrderedDict -import inspect -import itertools -import traceback import ast import codecs +from collections import OrderedDict import csv import datetime import difflib import fnmatch +from functools import update_wrapper +import inspect +import itertools import json import logging import math +import os +import random import re +import string +import sys import tempfile +import time +import traceback from pyedb.generic.constants import CSS4_COLORS from pyedb.generic.settings import settings @@ -96,7 +96,7 @@ def _exception(ex_info, func, args, kwargs, message="Type Error"): message_to_print = "" messages = "" if "error" in messages: - message_to_print = messages[messages.index("[error]"):] + message_to_print = messages[messages.index("[error]") :] # _write_mes("{} - {} - {}.".format(ex_info[1], func.__name__, message.upper())) if message_to_print: @@ -207,7 +207,7 @@ def get_filename_without_extension(path): def _write_mes(mes_text): mes_text = str(mes_text) - parts = [mes_text[i: i + 250] for i in range(0, len(mes_text), 250)] + parts = [mes_text[i : i + 250] for i in range(0, len(mes_text), 250)] for el in parts: settings.logger.error(el) @@ -218,9 +218,9 @@ def _log_method(func, new_args, new_kwargs): if not settings.enable_debug_geometry_operator_logger and "GeometryOperators" in str(func): return if ( - not settings.enable_debug_edb_logger - and "Edb" in str(func) + str(new_args) - or "edb_core" in str(func) + str(new_args) + not settings.enable_debug_edb_logger + and "Edb" in str(func) + str(new_args) + or "edb_core" in str(func) + str(new_args) ): return line_begin = "ARGUMENTS: " @@ -501,7 +501,7 @@ def open_file(file_path, file_options="r"): if os.path.exists(file_path): return open(file_path, file_options) elif settings.remote_rpc_session and settings.remote_rpc_session.filemanager.pathexists( - file_path + file_path ): # pragma: no cover local_file = os.path.join(tempfile.gettempdir(), os.path.split(file_path)[-1]) settings.remote_rpc_session.filemanager.download_file(file_path, local_file) @@ -1300,7 +1300,7 @@ def compute_fft(time_vals, value): # pragma: no cover num_points = len(time_vals) valueFFT = np.fft.fft(value, num_points) Npoints = int(len(valueFFT) / 2) - valueFFT = valueFFT[1: Npoints + 1] + valueFFT = valueFFT[1 : Npoints + 1] valueFFT = valueFFT / len(valueFFT) n = np.arange(num_points) freq = n / deltaT @@ -1308,14 +1308,14 @@ def compute_fft(time_vals, value): # pragma: no cover def parse_excitation_file( - file_name, - is_time_domain=True, - x_scale=1, - y_scale=1, - impedance=50, - data_format="Power", - encoding="utf-8", - out_mag="Voltage", + file_name, + is_time_domain=True, + x_scale=1, + y_scale=1, + impedance=50, + data_format="Power", + encoding="utf-8", + out_mag="Voltage", ): """Parse a csv file and convert data in list that can be applied to Hfss and Hfss3dLayout sources. @@ -1600,7 +1600,7 @@ def _arg2dict(arg, dict_out): i = 1 while i < len(arg): if arg[i][0][:5] == "NAME:" and ( - isinstance(arg[i], (list, tuple)) or str(type(arg[i])) == r"" + isinstance(arg[i], (list, tuple)) or str(type(arg[i])) == r"" ): _arg2dict(list(arg[i]), dict_in) i += 1 diff --git a/src/pyedb/generic/plot.py b/src/pyedb/generic/plot.py index 6a1356970b..daa59ad0fb 100644 --- a/src/pyedb/generic/plot.py +++ b/src/pyedb/generic/plot.py @@ -8,11 +8,12 @@ import time import warnings -from pyedb.generic.general_methods import pyedb_function_handler -from pyedb.generic.constants import AEDT_UNITS -from pyedb.generic.constants import CSS4_COLORS -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import open_file +from pyedb.generic.constants import AEDT_UNITS, CSS4_COLORS +from pyedb.generic.general_methods import ( + is_ironpython, + open_file, + pyedb_function_handler, +) if not is_ironpython: try: @@ -36,10 +37,12 @@ try: from matplotlib.patches import PathPatch from matplotlib.path import Path + # Use matplotlib agg backend (non-interactive) when the CI is running. if bool(int(os.getenv("PYEDB_CI_NO_DISPLAY", "0"))): import matplotlib - matplotlib.use('Agg') + + matplotlib.use("Agg") import matplotlib.pyplot as plt except ImportError: diff --git a/src/pyedb/generic/process.py b/src/pyedb/generic/process.py index 7817d7901f..4bd06edb24 100644 --- a/src/pyedb/generic/process.py +++ b/src/pyedb/generic/process.py @@ -1,8 +1,6 @@ import os.path -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import env_path +from pyedb.generic.general_methods import env_path, is_ironpython, is_linux if is_linux and is_ironpython: import subprocessdotnet as subprocess diff --git a/src/pyedb/generic/settings.py b/src/pyedb/generic/settings.py index 81e21a84e5..b706c2c3cb 100644 --- a/src/pyedb/generic/settings.py +++ b/src/pyedb/generic/settings.py @@ -13,7 +13,7 @@ def __init__(self): self._edb_dll_path = None # Remove this if LoadAEDTFile.py is not kept self._aedt_version = None - # + # self._enable_logger = True self._enable_file_logs = True self.pyedb_server_path = "" @@ -203,7 +203,7 @@ def enable_debug_logger(self): def enable_debug_logger(self, val): self._enable_debug_logger = val - # TODO: Not sure if neede, see with Simon + # TODO: Not sure if needed, see with Simon @property def enable_screen_logs(self): """Flag for enabling and disabling the logging to STDOUT.""" @@ -213,7 +213,7 @@ def enable_screen_logs(self): def enable_screen_logs(self, val): self._enable_screen_logs = val - # TODO: Not sure if neede, see with Simon + # TODO: Not sure if needed, see with Simon @property def edb_dll_path(self): """Optional path for the EDB DLL file.""" diff --git a/src/pyedb/ipc2581/bom/bom_item.py b/src/pyedb/ipc2581/bom/bom_item.py index 40c464dc7c..581b0cb958 100644 --- a/src/pyedb/ipc2581/bom/bom_item.py +++ b/src/pyedb/ipc2581/bom/bom_item.py @@ -1,6 +1,6 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.bom.characteristics import Characteristics from pyedb.ipc2581.bom.refdes import RefDes -from pyedb.generic.general_methods import ET class BomItem(object): diff --git a/src/pyedb/ipc2581/content/content.py b/src/pyedb/ipc2581/content/content.py index ca0de875bb..3f3cf509af 100644 --- a/src/pyedb/ipc2581/content/content.py +++ b/src/pyedb/ipc2581/content/content.py @@ -1,8 +1,10 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.content.dictionary_color import DictionaryColor from pyedb.ipc2581.content.dictionary_line import DictionaryLine from pyedb.ipc2581.content.layer_ref import LayerRef -from pyedb.ipc2581.content.standard_geometries_dictionary import StandardGeometriesDictionary -from pyedb.generic.general_methods import ET +from pyedb.ipc2581.content.standard_geometries_dictionary import ( + StandardGeometriesDictionary, +) class Content(object): diff --git a/src/pyedb/ipc2581/content/dictionary_color.py b/src/pyedb/ipc2581/content/dictionary_color.py index cc81e7b25e..d69dbe1dc0 100644 --- a/src/pyedb/ipc2581/content/dictionary_color.py +++ b/src/pyedb/ipc2581/content/dictionary_color.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.content.entry_color import EntryColor from pyedb.generic.general_methods import ET +from pyedb.ipc2581.content.entry_color import EntryColor class DictionaryColor(object): diff --git a/src/pyedb/ipc2581/content/dictionary_fill.py b/src/pyedb/ipc2581/content/dictionary_fill.py index 109281837b..c483b77e90 100644 --- a/src/pyedb/ipc2581/content/dictionary_fill.py +++ b/src/pyedb/ipc2581/content/dictionary_fill.py @@ -1,6 +1,6 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.content.content import Content from pyedb.ipc2581.content.fill import FillDesc -from pyedb.generic.general_methods import ET class DictionaryFill(Content): diff --git a/src/pyedb/ipc2581/content/dictionary_line.py b/src/pyedb/ipc2581/content/dictionary_line.py index 0434c09fbc..1a49c5b36a 100644 --- a/src/pyedb/ipc2581/content/dictionary_line.py +++ b/src/pyedb/ipc2581/content/dictionary_line.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.content.entry_line import EntryLine from pyedb.generic.general_methods import ET +from pyedb.ipc2581.content.entry_line import EntryLine class DictionaryLine(object): diff --git a/src/pyedb/ipc2581/content/entry_color.py b/src/pyedb/ipc2581/content/entry_color.py index eb1fe5e56a..6762b78c2f 100644 --- a/src/pyedb/ipc2581/content/entry_color.py +++ b/src/pyedb/ipc2581/content/entry_color.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.content.color import Color from pyedb.generic.general_methods import ET +from pyedb.ipc2581.content.color import Color class EntryColor(object): diff --git a/src/pyedb/ipc2581/content/fill.py b/src/pyedb/ipc2581/content/fill.py index bf4a5c2e80..6887d17df4 100644 --- a/src/pyedb/ipc2581/content/fill.py +++ b/src/pyedb/ipc2581/content/fill.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.content.content import Content from pyedb.generic.general_methods import ET +from pyedb.ipc2581.content.content import Content class FillDesc(Content): diff --git a/src/pyedb/ipc2581/ecad/cad_data/assembly_drawing.py b/src/pyedb/ipc2581/ecad/cad_data/assembly_drawing.py index fb06776103..a9a18dcb83 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +++ b/src/pyedb/ipc2581/ecad/cad_data/assembly_drawing.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.ecad.cad_data.polygon import Polygon from pyedb.generic.general_methods import ET +from pyedb.ipc2581.ecad.cad_data.polygon import Polygon class AssemblyDrawing(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/cad_data.py b/src/pyedb/ipc2581/ecad/cad_data/cad_data.py index 78f40091cd..edcf49f919 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/cad_data.py +++ b/src/pyedb/ipc2581/ecad/cad_data/cad_data.py @@ -1,7 +1,7 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.ecad.cad_data.layer import Layer from pyedb.ipc2581.ecad.cad_data.stackup import Stackup from pyedb.ipc2581.ecad.cad_data.step import Step -from pyedb.generic.general_methods import ET class CadData(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/feature.py b/src/pyedb/ipc2581/ecad/cad_data/feature.py index a4640114ee..42b7377929 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/feature.py +++ b/src/pyedb/ipc2581/ecad/cad_data/feature.py @@ -1,8 +1,8 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.ecad.cad_data.drill import Drill from pyedb.ipc2581.ecad.cad_data.padstack_instance import PadstackInstance from pyedb.ipc2581.ecad.cad_data.path import Path from pyedb.ipc2581.ecad.cad_data.polygon import Polygon -from pyedb.generic.general_methods import ET class Feature(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/layer_feature.py b/src/pyedb/ipc2581/ecad/cad_data/layer_feature.py index 641b35779b..5f63a9477b 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/layer_feature.py +++ b/src/pyedb/ipc2581/ecad/cad_data/layer_feature.py @@ -1,10 +1,7 @@ import math -from pyedb.ipc2581.ecad.cad_data.feature import Feature -from pyedb.ipc2581.ecad.cad_data.feature import FeatureType -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.generic.general_methods import ET, pyedb_function_handler +from pyedb.ipc2581.ecad.cad_data.feature import Feature, FeatureType class LayerFeature(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/outline.py b/src/pyedb/ipc2581/ecad/cad_data/outline.py index ecbba2b0db..c5c440d283 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/outline.py +++ b/src/pyedb/ipc2581/ecad/cad_data/outline.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.ecad.cad_data.polygon import Polygon from pyedb.generic.general_methods import ET +from pyedb.ipc2581.ecad.cad_data.polygon import Polygon class Outline: diff --git a/src/pyedb/ipc2581/ecad/cad_data/package.py b/src/pyedb/ipc2581/ecad/cad_data/package.py index 55e554b12b..66fad20fcf 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/package.py +++ b/src/pyedb/ipc2581/ecad/cad_data/package.py @@ -1,13 +1,11 @@ import math +from pyedb.generic.general_methods import ET, pyedb_function_handler from pyedb.ipc2581.content.entry_line import EntryLine from pyedb.ipc2581.ecad.cad_data.assembly_drawing import AssemblyDrawing from pyedb.ipc2581.ecad.cad_data.outline import Outline from pyedb.ipc2581.ecad.cad_data.pin import Pin from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - class Package(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/padstack_def.py b/src/pyedb/ipc2581/ecad/cad_data/padstack_def.py index aec0a6ff0c..89da5f1caf 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/padstack_def.py +++ b/src/pyedb/ipc2581/ecad/cad_data/padstack_def.py @@ -1,6 +1,6 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.ecad.cad_data.padstack_hole_def import PadstackHoleDef from pyedb.ipc2581.ecad.cad_data.padstack_pad_def import PadstackPadDef -from pyedb.generic.general_methods import ET class PadstackDef(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/path.py b/src/pyedb/ipc2581/ecad/cad_data/path.py index 189b289262..e3cf4db8e1 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/path.py +++ b/src/pyedb/ipc2581/ecad/cad_data/path.py @@ -1,9 +1,6 @@ +from pyedb.generic.general_methods import ET, pyedb_function_handler from pyedb.ipc2581.content.entry_line import EntryLine -from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep -from pyedb.ipc2581.ecad.cad_data.polygon import PolyType -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.ipc2581.ecad.cad_data.polygon import PolyStep, PolyType class Path(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/polygon.py b/src/pyedb/ipc2581/ecad/cad_data/polygon.py index cfa0bf74e7..0d83c7a6f6 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/polygon.py +++ b/src/pyedb/ipc2581/ecad/cad_data/polygon.py @@ -1,8 +1,6 @@ import math -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.generic.general_methods import ET, pyedb_function_handler class Polygon(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/stackup.py b/src/pyedb/ipc2581/ecad/cad_data/stackup.py index 0515b124b5..178736f4c0 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/stackup.py +++ b/src/pyedb/ipc2581/ecad/cad_data/stackup.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.ecad.cad_data.stackup_group import StackupGroup from pyedb.generic.general_methods import ET +from pyedb.ipc2581.ecad.cad_data.stackup_group import StackupGroup class Stackup(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/stackup_group.py b/src/pyedb/ipc2581/ecad/cad_data/stackup_group.py index 100bf0d4bf..8325fe40a8 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/stackup_group.py +++ b/src/pyedb/ipc2581/ecad/cad_data/stackup_group.py @@ -1,6 +1,6 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.ecad.cad_data.layer import Layer from pyedb.ipc2581.ecad.cad_data.stackup_layer import StackupLayer -from pyedb.generic.general_methods import ET class StackupGroup(object): diff --git a/src/pyedb/ipc2581/ecad/cad_data/step.py b/src/pyedb/ipc2581/ecad/cad_data/step.py index c1a0d05d7c..9f5e9a4890 100644 --- a/src/pyedb/ipc2581/ecad/cad_data/step.py +++ b/src/pyedb/ipc2581/ecad/cad_data/step.py @@ -1,5 +1,6 @@ import math +from pyedb.generic.general_methods import ET, pyedb_function_handler from pyedb.ipc2581.ecad.cad_data.component import Component from pyedb.ipc2581.ecad.cad_data.layer_feature import LayerFeature from pyedb.ipc2581.ecad.cad_data.logical_net import LogicalNet @@ -7,9 +8,6 @@ from pyedb.ipc2581.ecad.cad_data.padstack_def import PadstackDef from pyedb.ipc2581.ecad.cad_data.phy_net import PhyNet from pyedb.ipc2581.ecad.cad_data.profile import Profile -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - class Step(object): diff --git a/src/pyedb/ipc2581/ecad/cad_header.py b/src/pyedb/ipc2581/ecad/cad_header.py index 3ee96506e8..175f89f92a 100644 --- a/src/pyedb/ipc2581/ecad/cad_header.py +++ b/src/pyedb/ipc2581/ecad/cad_header.py @@ -1,5 +1,5 @@ -from pyedb.ipc2581.ecad.spec import Spec from pyedb.generic.general_methods import ET +from pyedb.ipc2581.ecad.spec import Spec class CadHeader(object): diff --git a/src/pyedb/ipc2581/ecad/ecad.py b/src/pyedb/ipc2581/ecad/ecad.py index 34dc601426..f5a103fdf9 100644 --- a/src/pyedb/ipc2581/ecad/ecad.py +++ b/src/pyedb/ipc2581/ecad/ecad.py @@ -1,6 +1,6 @@ +from pyedb.generic.general_methods import ET from pyedb.ipc2581.ecad.cad_data.cad_data import CadData from pyedb.ipc2581.ecad.cad_header import CadHeader -from pyedb.generic.general_methods import ET class Ecad(object): diff --git a/src/pyedb/ipc2581/ipc2581.py b/src/pyedb/ipc2581/ipc2581.py index bd16dcb796..16ea4c5b68 100644 --- a/src/pyedb/ipc2581/ipc2581.py +++ b/src/pyedb/ipc2581/ipc2581.py @@ -1,5 +1,6 @@ import os.path +from pyedb.generic.general_methods import ET, pyedb_function_handler from pyedb.ipc2581.bom.bom import Bom from pyedb.ipc2581.bom.bom_item import BomItem from pyedb.ipc2581.content.content import Content @@ -7,9 +8,6 @@ from pyedb.ipc2581.ecad.ecad import Ecad from pyedb.ipc2581.history_record import HistoryRecord from pyedb.ipc2581.logistic_header import LogisticHeader -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import pyedb_function_handler - class Ipc2581(object): diff --git a/src/pyedb/legacy/__init__.py b/src/pyedb/legacy/__init__.py index 33948ec105..38d215866a 100644 --- a/src/pyedb/legacy/__init__.py +++ b/src/pyedb/legacy/__init__.py @@ -1,2 +1,2 @@ """Legacy code. -""" \ No newline at end of file +""" diff --git a/src/pyedb/legacy/application/Variables.py b/src/pyedb/legacy/application/Variables.py index 2d183fd78b..cad746e7ba 100644 --- a/src/pyedb/legacy/application/Variables.py +++ b/src/pyedb/legacy/application/Variables.py @@ -20,16 +20,20 @@ import re import types -from pyedb.generic.general_methods import pyedb_function_handler -from pyedb.generic.constants import AEDT_UNITS -from pyedb.generic.constants import SI_UNITS -from pyedb.generic.constants import _resolve_unit_system -from pyedb.generic.constants import unit_system -from pyedb.generic.general_methods import GrpcApiError -from pyedb.generic.general_methods import check_numeric_equivalence -from pyedb.generic.general_methods import is_array -from pyedb.generic.general_methods import is_number -from pyedb.generic.general_methods import open_file +from pyedb.generic.constants import ( + AEDT_UNITS, + SI_UNITS, + _resolve_unit_system, + unit_system, +) +from pyedb.generic.general_methods import ( + GrpcApiError, + check_numeric_equivalence, + is_array, + is_number, + open_file, + pyedb_function_handler, +) class CSVDataset: @@ -338,6 +342,7 @@ def generate_validation_errors(property_names, expected_settings, actual_setting ] return validation_errors + # TODO: See how we handle this (totally removed / reworked ) ? class VariableManager(object): """Manages design properties and project variables. @@ -1261,6 +1266,7 @@ def _get_var_list_from_aedt(self, desktop_object): var_list += [i for i in list(self._app.oproject.GetArrayVariables()) if i not in var_list] return var_list + # TODO: See how we handle this (totally removed / reworked ) ? class Variable(object): """Stores design properties and project variables and provides operations to perform on them. diff --git a/src/pyedb/legacy/clr_module.py b/src/pyedb/legacy/clr_module.py index 2225cf6e11..9def9f708a 100644 --- a/src/pyedb/legacy/clr_module.py +++ b/src/pyedb/legacy/clr_module.py @@ -11,6 +11,7 @@ try: import pyedb + pyedb_path = os.path.dirname(os.path.abspath(pyedb.__file__)) sys.path.append(os.path.join(pyedb_path, "dlls", "PDFReport")) except ImportError: @@ -43,7 +44,9 @@ warnings.warn("export ANSYSEM_ROOT232=/path/to/AnsysEM/v232/Linux64") msg = "export LD_LIBRARY_PATH=" msg += "$ANSYSEM_ROOT232/common/mono/Linux64/lib64:$LD_LIBRARY_PATH" - msg += "If PyEDB will run on AEDT<2023.2 then $ANSYSEM_ROOT222/Delcross should be added to LD_LIBRARY_PATH" + msg += ( + "If PyEDB will run on AEDT<2023.2 then $ANSYSEM_ROOT222/Delcross should be added to LD_LIBRARY_PATH" + ) warnings.warn(msg) is_clr = True else: @@ -68,13 +71,8 @@ from System.Globalization import CultureInfo as _CultureInfo _CultureInfo.DefaultThreadCurrentCulture = _CultureInfo.InvariantCulture - from System import Array - from System import Convert - from System import Double - from System import String - from System import Tuple - from System.Collections.Generic import Dictionary - from System.Collections.Generic import List + from System import Array, Convert, Double, String, Tuple + from System.Collections.Generic import Dictionary, List edb_initialized = True diff --git a/src/pyedb/legacy/downloads.py b/src/pyedb/legacy/downloads.py index 29a314be34..6140450a5e 100644 --- a/src/pyedb/legacy/downloads.py +++ b/src/pyedb/legacy/downloads.py @@ -4,9 +4,7 @@ import tempfile import zipfile -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import settings +from pyedb.generic.general_methods import is_ironpython, is_linux, settings from pyedb.misc.misc import list_installed_ansysem if is_ironpython: diff --git a/src/pyedb/legacy/edb.py b/src/pyedb/legacy/edb.py index 0254009db1..7acbe62dec 100644 --- a/src/pyedb/legacy/edb.py +++ b/src/pyedb/legacy/edb.py @@ -446,7 +446,7 @@ def sources(self): @property def probes(self): - """Get all layout sources.""" + """Get all layout probes.""" temp = {} for name, val in self.terminals.items(): if val.boundary_type == "kVoltageProbe": @@ -3867,23 +3867,27 @@ def _get_connected_ports_from_multizone_cutout(self, terminal_info_dict): @pyedb_function_handler def create_port(self, terminal, ref_terminal=None, is_circuit_port=False): """Create a port. + Parameters ---------- terminal : class:`pyedb.legacy.edb_core.edb_data.terminals.EdgeTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, + class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Positive terminal of the port. ref_terminal : class:`pyedb.legacy.edb_core.edb_data.terminals.EdgeTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, - class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, - optional + class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, + class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + optional Negative terminal of the port. is_circuit_port : bool, optional Whether it is a circuit port. The default is ``False``. + Returns ------- + [:class:`pyedb.legacy.edb_core.edb_data.ports.GapPort`, + :class:`pyedb.legacy.edb_core.edb_data.ports.WavePort`,] """ terminal.boundary_type = "PortBoundary" @@ -3898,20 +3902,23 @@ def create_port(self, terminal, ref_terminal=None, is_circuit_port=False): @pyedb_function_handler def create_voltage_probe(self, terminal, ref_terminal): """Create a voltage probe. + Parameters ---------- terminal : :class:`pyedb.legacy.edb_core.edb_data.terminals.EdgeTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Positive terminal of the port. ref_terminal : :class:`pyedb.legacy.edb_core.edb_data.terminals.EdgeTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, - :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, + :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Negative terminal of the probe. + Returns ------- + pyedb.legacy.edb_core.edb_data.terminals.Terminal """ term = Terminal(self, terminal._edb_object) term.boundary_type = "kVoltageProbe" @@ -3953,18 +3960,20 @@ def create_voltage_source(self, terminal, ref_terminal): @pyedb_function_handler def create_current_source(self, terminal, ref_terminal): """Create a current source. + Parameters ---------- terminal : :class:`legacy.edb_core.edb_data.terminals.EdgeTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PointTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PointTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Positive terminal of the port. ref_terminal : class:`legacy.edb_core.edb_data.terminals.EdgeTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PointTerminal`, - :class:`legacy.edb_core.edb_data.terminals.PinGroupTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PadstackInstanceTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PointTerminal`, + :class:`legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Negative terminal of the source. + Returns ------- :class:`legacy.edb_core.edb_data.ports.ExcitationSources` diff --git a/src/pyedb/legacy/edb_core/__init__.py b/src/pyedb/legacy/edb_core/__init__.py index c028867691..b95c82c0b3 100644 --- a/src/pyedb/legacy/edb_core/__init__.py +++ b/src/pyedb/legacy/edb_core/__init__.py @@ -1,2 +1 @@ from __future__ import absolute_import # noreorder - diff --git a/src/pyedb/legacy/edb_core/components.py b/src/pyedb/legacy/edb_core/components.py index a4f51db047..83f95a1032 100644 --- a/src/pyedb/legacy/edb_core/components.py +++ b/src/pyedb/legacy/edb_core/components.py @@ -7,21 +7,17 @@ import re import warnings - -from pyedb.legacy.edb_core.edb_data.components_data import EDBComponent -from pyedb.legacy.edb_core.edb_data.components_data import EDBComponentDef +from pyedb.generic.general_methods import ( + _retry_ntimes, + get_filename_without_extension, + pyedb_function_handler, +) +from pyedb.legacy.clr_module import String +from pyedb.legacy.edb_core.edb_data.components_data import EDBComponent, EDBComponentDef from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance -from pyedb.legacy.edb_core.edb_data.sources import Source -from pyedb.legacy.edb_core.edb_data.sources import SourceType +from pyedb.legacy.edb_core.edb_data.sources import Source, SourceType from pyedb.legacy.edb_core.general import convert_py_list_to_net_list from pyedb.legacy.edb_core.padstack import EdbPadstacks -from pyedb.legacy.clr_module import String -from pyedb.legacy.clr_module import _clr -from pyedb.generic.general_methods import get_filename_without_extension -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import pyedb_function_handler -from pyedb.generic.general_methods import _retry_ntimes - from pyedb.modeler.geometry_operators import GeometryOperators diff --git a/src/pyedb/legacy/edb_core/dotnet/database.py b/src/pyedb/legacy/edb_core/dotnet/database.py index c2111979ec..2547ee52f2 100644 --- a/src/pyedb/legacy/edb_core/dotnet/database.py +++ b/src/pyedb/legacy/edb_core/dotnet/database.py @@ -5,13 +5,15 @@ from pyedb import __version__ from pyedb.edb_logger import pyedb_logger +from pyedb.generic.general_methods import ( + env_path, + env_path_student, + env_value, + is_ironpython, + is_linux, + settings, +) from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.general_methods import env_path -from pyedb.generic.general_methods import env_path_student -from pyedb.generic.general_methods import env_value -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import settings from pyedb.misc.misc import list_installed_ansysem @@ -693,8 +695,7 @@ def __init__(self, edbversion, student_version=False): self.edbversion = edbversion self.student_version = student_version """Initialize DLLs.""" - from pyedb.legacy.clr_module import _clr - from pyedb.legacy.clr_module import edb_initialized + from pyedb.legacy.clr_module import _clr, edb_initialized if settings.enable_screen_logs: self._logger.enable_stdout_log() diff --git a/src/pyedb/legacy/edb_core/dotnet/primitive.py b/src/pyedb/legacy/edb_core/dotnet/primitive.py index 1b8d88f307..c5ab0d53b0 100644 --- a/src/pyedb/legacy/edb_core/dotnet/primitive.py +++ b/src/pyedb/legacy/edb_core/dotnet/primitive.py @@ -1,6 +1,5 @@ """Primitive.""" -from pyedb.legacy.edb_core.dotnet.database import NetDotNet -from pyedb.legacy.edb_core.dotnet.database import PolygonDataDotNet +from pyedb.legacy.edb_core.dotnet.database import NetDotNet, PolygonDataDotNet from pyedb.legacy.edb_core.general import convert_py_list_to_net_list from pyedb.modeler.geometry_operators import GeometryOperators @@ -123,8 +122,8 @@ def add_void(self, point_list): Parameters ---------- - point_list : list or :class:`pyedb.legacy.edb_core.edb_data.primitives_data.EDBPrimitives` or EDB Primitive Object - Point list in the format of `[[x1,y1], [x2,y2],..,[xn,yn]]`. + point_list : list or :class:`pyedb.legacy.edb_core.edb_data.primitives_data.EDBPrimitives` \ + or EDB Primitive Object. Point list in the format of `[[x1,y1], [x2,y2],..,[xn,yn]]`. Returns ------- diff --git a/src/pyedb/legacy/edb_core/edb_data/components_data.py b/src/pyedb/legacy/edb_core/edb_data/components_data.py index d91e237a82..fa65af6f27 100644 --- a/src/pyedb/legacy/edb_core/edb_data/components_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/components_data.py @@ -2,8 +2,8 @@ import re import warnings -from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance from pyedb.generic.general_methods import is_ironpython +from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance if not is_ironpython: try: @@ -13,9 +13,10 @@ "The NumPy module is required to run some functionalities of EDB.\n" "Install with \n\npip install numpy\n\nRequires CPython." ) -from pyedb.generic.general_methods import get_filename_without_extension -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.generic.general_methods import ( + get_filename_without_extension, + pyedb_function_handler, +) class EDBComponentDef(object): diff --git a/src/pyedb/legacy/edb_core/edb_data/control_file.py b/src/pyedb/legacy/edb_core/edb_data/control_file.py index b90edb5c07..84e04f9438 100644 --- a/src/pyedb/legacy/edb_core/edb_data/control_file.py +++ b/src/pyedb/legacy/edb_core/edb_data/control_file.py @@ -4,15 +4,16 @@ import sys from pyedb.edb_logger import pyedb_logger -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import env_path -from pyedb.generic.general_methods import env_value -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import pyedb_function_handler - -from pyedb.misc.misc import list_installed_ansysem +from pyedb.generic.general_methods import ( + ET, + env_path, + env_value, + is_ironpython, + is_linux, + pyedb_function_handler, +) from pyedb.misc.aedtlib_personalib_install import write_pretty_xml +from pyedb.misc.misc import list_installed_ansysem if is_linux and is_ironpython: import subprocessdotnet as subprocess diff --git a/src/pyedb/legacy/edb_core/edb_data/hfss_extent_info.py b/src/pyedb/legacy/edb_core/edb_data/hfss_extent_info.py index fbae9514e1..eea84ea1c3 100644 --- a/src/pyedb/legacy/edb_core/edb_data/hfss_extent_info.py +++ b/src/pyedb/legacy/edb_core/edb_data/hfss_extent_info.py @@ -1,8 +1,7 @@ +from pyedb.generic.general_methods import pyedb_function_handler from pyedb.legacy.edb_core.edb_data.edbvalue import EdbValue from pyedb.legacy.edb_core.edb_data.primitives_data import cast from pyedb.legacy.edb_core.general import convert_pytuple_to_nettuple -from pyedb.generic.general_methods import pyedb_function_handler - class HfssExtentInfo: diff --git a/src/pyedb/legacy/edb_core/edb_data/hfss_simulation_setup_data.py b/src/pyedb/legacy/edb_core/edb_data/hfss_simulation_setup_data.py index 64c5095093..6c630a5134 100644 --- a/src/pyedb/legacy/edb_core/edb_data/hfss_simulation_setup_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/hfss_simulation_setup_data.py @@ -1,9 +1,10 @@ -from pyedb.legacy.edb_core.edb_data.simulation_setup import BaseSimulationSetup -from pyedb.legacy.edb_core.edb_data.simulation_setup import EdbFrequencySweep -from pyedb.legacy.edb_core.general import convert_py_list_to_net_list +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler from pyedb.legacy.clr_module import Tuple -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.legacy.edb_core.edb_data.simulation_setup import ( + BaseSimulationSetup, + EdbFrequencySweep, +) +from pyedb.legacy.edb_core.general import convert_py_list_to_net_list class MeshOperation(object): diff --git a/src/pyedb/legacy/edb_core/edb_data/nets_data.py b/src/pyedb/legacy/edb_core/edb_data/nets_data.py index 4f4eef256d..e81d9123f9 100644 --- a/src/pyedb/legacy/edb_core/edb_data/nets_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/nets_data.py @@ -1,11 +1,12 @@ -from pyedb.legacy.edb_core.dotnet.database import DifferentialPairDotNet -from pyedb.legacy.edb_core.dotnet.database import ExtendedNetDotNet -from pyedb.legacy.edb_core.dotnet.database import NetClassDotNet -from pyedb.legacy.edb_core.dotnet.database import NetDotNet +from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.legacy.edb_core.dotnet.database import ( + DifferentialPairDotNet, + ExtendedNetDotNet, + NetClassDotNet, + NetDotNet, +) from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance from pyedb.legacy.edb_core.edb_data.primitives_data import cast -from pyedb.generic.general_methods import pyedb_function_handler - class EDBNetsData(NetDotNet): diff --git a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py index 83f5fe197c..3d192a5c65 100644 --- a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py @@ -3,17 +3,16 @@ import re import warnings -from pyedb.generic.general_methods import is_ironpython +from pyedb.generic.general_methods import ( + generate_unique_name, + is_ironpython, + pyedb_function_handler, +) +from pyedb.legacy.clr_module import String, _clr from pyedb.legacy.edb_core.dotnet.database import PolygonDataDotNet from pyedb.legacy.edb_core.edb_data.edbvalue import EdbValue from pyedb.legacy.edb_core.edb_data.primitives_data import EDBPrimitivesMain -from pyedb.legacy.edb_core.general import PadGeometryTpe -from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.legacy.clr_module import String -from pyedb.legacy.clr_module import _clr -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.general import PadGeometryTpe, convert_py_list_to_net_list from pyedb.modeler.geometry_operators import GeometryOperators @@ -1015,7 +1014,9 @@ def get_terminal(self, name=None, create_new_terminal=False): if create_new_terminal: term = self._create_terminal(name) else: - from pyedb.legacy.edb_core.edb_data.terminals import PadstackInstanceTerminal + from pyedb.legacy.edb_core.edb_data.terminals import ( + PadstackInstanceTerminal, + ) term = PadstackInstanceTerminal(self._pedb, self._edb_object.GetPadstackInstanceTerminal()) if not term.is_null: @@ -1060,6 +1061,7 @@ def create_port(self, name=None, reference=None, is_circuit_port=False): ref_terminal = None return self._pedb.create_port(terminal, ref_terminal, is_circuit_port) + @property def _em_properties(self): """Get EM properties.""" diff --git a/src/pyedb/legacy/edb_core/edb_data/ports.py b/src/pyedb/legacy/edb_core/edb_data/ports.py index 6715e98cea..8963929a5f 100644 --- a/src/pyedb/legacy/edb_core/edb_data/ports.py +++ b/src/pyedb/legacy/edb_core/edb_data/ports.py @@ -1,7 +1,9 @@ -from pyedb.legacy.edb_core.edb_data.terminals import BundleTerminal -from pyedb.legacy.edb_core.edb_data.terminals import EdgeTerminal -from pyedb.legacy.edb_core.edb_data.terminals import PadstackInstanceTerminal -from pyedb.legacy.edb_core.edb_data.terminals import Terminal +from pyedb.legacy.edb_core.edb_data.terminals import ( + BundleTerminal, + EdgeTerminal, + PadstackInstanceTerminal, + Terminal, +) class GapPort(EdgeTerminal): diff --git a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py index 12c5b2c2e7..7f1988f8c7 100644 --- a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py @@ -1,16 +1,18 @@ import math +from pyedb.generic.general_methods import pyedb_function_handler from pyedb.legacy.edb_core.dotnet.database import NetDotNet -from pyedb.legacy.edb_core.dotnet.primitive import BondwireDotNet -from pyedb.legacy.edb_core.dotnet.primitive import CircleDotNet -from pyedb.legacy.edb_core.dotnet.primitive import PathDotNet -from pyedb.legacy.edb_core.dotnet.primitive import PolygonDataDotNet -from pyedb.legacy.edb_core.dotnet.primitive import PolygonDotNet -from pyedb.legacy.edb_core.dotnet.primitive import RectangleDotNet -from pyedb.legacy.edb_core.dotnet.primitive import TextDotNet +from pyedb.legacy.edb_core.dotnet.primitive import ( + BondwireDotNet, + CircleDotNet, + PathDotNet, + PolygonDataDotNet, + PolygonDotNet, + RectangleDotNet, + TextDotNet, +) from pyedb.legacy.edb_core.edb_data.connectable import Connectable from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.general_methods import pyedb_function_handler from pyedb.modeler.geometry_operators import GeometryOperators @@ -953,6 +955,7 @@ def getParalletLines(pts, distance): # pragma: no cover for x, y in getLocations(rightline, gap) + getLocations(leftline, gap): self._pedb.padstacks.place([x, y], padstack_name) + class EdbRectangle(EDBPrimitives, RectangleDotNet): def __init__(self, raw_primitive, core_app): EDBPrimitives.__init__(self, raw_primitive, core_app) diff --git a/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py b/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py index dd44c0f636..48cef5e867 100644 --- a/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py +++ b/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py @@ -2,18 +2,17 @@ import json import os -from pyedb.generic.general_methods import generate_unique_name -from pyedb.legacy.edb_core.edb_data.sources import Source -from pyedb.legacy.edb_core.edb_data.sources import SourceType +from pyedb.generic.constants import ( + BasisOrder, + CutoutSubdesignType, + RadiationBoxType, + SolverType, + SweepType, + validate_enum_class_value, +) +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler from pyedb.legacy.clr_module import Dictionary -from pyedb.generic.constants import BasisOrder -from pyedb.generic.constants import CutoutSubdesignType -from pyedb.generic.constants import RadiationBoxType -from pyedb.generic.constants import SolverType -from pyedb.generic.constants import SweepType -from pyedb.generic.constants import validate_enum_class_value -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.edb_data.sources import Source, SourceType class SimulationConfigurationBatch(object): @@ -604,7 +603,6 @@ def add_frequency_sweep(self): ------- bool ``True`` frequency sweep is created, ``False`` skip sweep adding. Default value is ``True``. - """ return self._add_frequency_sweep diff --git a/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py b/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py index bb90c0456c..c11aff8c03 100644 --- a/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py +++ b/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py @@ -1,5 +1,4 @@ -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler class BaseSimulationSetup(object): @@ -186,23 +185,26 @@ def delete_frequency_sweep(self, sweep_data): @pyedb_function_handler() def add_frequency_sweep(self, name=None, frequency_sweep=None): """Add frequency sweep. + Parameters ---------- name : str, optional Name of the frequency sweep. The default is ``None``. frequency_sweep : list, optional List of frequency points. The default is ``None``. + Returns ------- :class:`pyedb.legacy.edb_core.edb_data.simulation_setup_data.EdbFrequencySweep` + 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"], - ... ]) + ... ["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 @@ -612,7 +614,7 @@ def set_frequencies_linear_count(self, start="1kHz", stop="0.1GHz", count=10): ---------- start : str, float, optional Start frequency. The default is ``"1kHz"``. - stop : str, float, optinal + stop : str, float, optional Stop frequency. The default is ``"0.1GHz"``. count : int, optional Step frequency. The default is ``10``. @@ -683,4 +685,4 @@ def set_frequencies(self, frequency_list=None, update=True): for i in temp: self._edb_sweep_data.Frequencies.Add(i) if update: - return self._update_sweep() \ No newline at end of file + return self._update_sweep() diff --git a/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py b/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py index faa0aa9ca5..6fe5a2aed5 100644 --- a/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py @@ -1,10 +1,11 @@ import warnings +from pyedb.generic.general_methods import is_linux, pyedb_function_handler from pyedb.legacy.edb_core.edb_data.simulation_setup import BaseSimulationSetup -from pyedb.legacy.edb_core.general import convert_netdict_to_pydict -from pyedb.legacy.edb_core.general import convert_pydict_to_netdict -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.legacy.edb_core.general import ( + convert_netdict_to_pydict, + convert_pydict_to_netdict, +) def _parse_value(v): @@ -29,6 +30,7 @@ def _parse_value(v): pv = v return pv + class SettingsBase(object): """Provide base settings.""" @@ -515,7 +517,6 @@ def __init__(self, parent): "dc_slider_position": [0, 1, 2], } - @property def compute_inductance(self): """Whether to compute Inductance. @@ -1085,6 +1086,7 @@ def use_si_settings(self, value): self._edb_object = self._set_edb_setup_info(edb_setup_info) self._update_setup() + class SiwaveDCSimulationSetup(SiwaveSYZSimulationSetup): """Manages EDB methods for SIwave DC simulation setup. Parameters @@ -1116,7 +1118,7 @@ def create(self, name=None): @pyedb_function_handler def get_configurations(self): """Get SIwave DC simulation settings. - + Returns ------- dict diff --git a/src/pyedb/legacy/edb_core/edb_data/sources.py b/src/pyedb/legacy/edb_core/edb_data/sources.py index 86fcb6a82a..149b1085df 100644 --- a/src/pyedb/legacy/edb_core/edb_data/sources.py +++ b/src/pyedb/legacy/edb_core/edb_data/sources.py @@ -1,6 +1,5 @@ -from pyedb.generic.general_methods import pyedb_function_handler, generate_unique_name -from pyedb.generic.constants import NodeType -from pyedb.generic.constants import SourceType +from pyedb.generic.constants import NodeType, SourceType +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler class Node(object): diff --git a/src/pyedb/legacy/edb_core/edb_data/terminals.py b/src/pyedb/legacy/edb_core/edb_data/terminals.py index f6a54ec8b1..222ae172cc 100644 --- a/src/pyedb/legacy/edb_core/edb_data/terminals.py +++ b/src/pyedb/legacy/edb_core/edb_data/terminals.py @@ -1,11 +1,10 @@ import re -from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler from pyedb.legacy.edb_core.edb_data.connectable import Connectable from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance from pyedb.legacy.edb_core.edb_data.primitives_data import cast from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.general_methods import generate_unique_name class Terminal(Connectable): @@ -389,7 +388,7 @@ def _get_closest_pin(self, ref_pin, pin_list, gnd_net=None): else: power_ground_net_names = [net for net in self._pedb.nets.power_nets.keys()] comp_ref_pins = [i for i in pin_list if i.GetNet().GetName() in power_ground_net_names] - if len(comp_ref_pins) == 0: # pragma: no cover + if len(comp_ref_pins) == 0: # pragma: no cover self._pedb.logger.error( "Terminal with PadStack Instance Name {} component has no reference pins.".format(ref_pin.GetName()) ) @@ -519,7 +518,6 @@ def create(self, padstack_instance, name=None, layer=None, is_ref=False): return terminal if not terminal.is_null else False - class PointTerminal(Terminal): """Manages point terminal properties.""" @@ -562,7 +560,7 @@ def location(self): layer = list(self._pedb.stackup.layers.values())[0]._edb_layer _, point_data, _ = self._edb_object.GetParameters(None, layer) return [point_data.X.ToDouble(), point_data.Y.ToDouble()] - + @location.setter def location(self, value): layer = self.layer @@ -589,7 +587,6 @@ class PinGroupTerminal(Terminal): def __init__(self, pedb, edb_object=None): super().__init__(pedb, edb_object) - @pyedb_function_handler def create(self, name, net_name, pin_group_name, is_ref=False): """Create a pin group terminal. diff --git a/src/pyedb/legacy/edb_core/general.py b/src/pyedb/legacy/edb_core/general.py index c4975578a2..f722602720 100644 --- a/src/pyedb/legacy/edb_core/general.py +++ b/src/pyedb/legacy/edb_core/general.py @@ -7,12 +7,8 @@ import logging -from pyedb.generic.general_methods import is_ironpython -from pyedb.legacy.clr_module import Dictionary -from pyedb.legacy.clr_module import List -from pyedb.legacy.clr_module import Tuple -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.generic.general_methods import is_ironpython, pyedb_function_handler +from pyedb.legacy.clr_module import Dictionary, List, Tuple if not is_ironpython: # pragma: no cover try: @@ -151,6 +147,7 @@ class DielectricExtentType(Enum): ConvexHull = 2 Polygon = 3 + class Primitives(Enum): Rectangle = 0 Circle = 1 diff --git a/src/pyedb/legacy/edb_core/hfss.py b/src/pyedb/legacy/edb_core/hfss.py index 824d94587f..b99a6b66bb 100644 --- a/src/pyedb/legacy/edb_core/hfss.py +++ b/src/pyedb/legacy/edb_core/hfss.py @@ -3,19 +3,22 @@ """ import math +from pyedb.generic.constants import RadiationBoxType, SweepType +from pyedb.generic.general_methods import ( + generate_unique_name, + is_ironpython, + pyedb_function_handler, +) from pyedb.legacy.edb_core.edb_data.hfss_extent_info import HfssExtentInfo -from pyedb.legacy.edb_core.edb_data.ports import BundleWavePort -from pyedb.legacy.edb_core.edb_data.ports import WavePort +from pyedb.legacy.edb_core.edb_data.ports import BundleWavePort, WavePort from pyedb.legacy.edb_core.edb_data.primitives_data import EDBPrimitives -from pyedb.legacy.edb_core.edb_data.simulation_configuration import SimulationConfiguration -from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.legacy.edb_core.general import convert_pytuple_to_nettuple -from pyedb.generic.constants import RadiationBoxType -from pyedb.generic.constants import SweepType -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.edb_data.simulation_configuration import ( + SimulationConfiguration, +) +from pyedb.legacy.edb_core.general import ( + convert_py_list_to_net_list, + convert_pytuple_to_nettuple, +) from pyedb.modeler.geometry_operators import GeometryOperators diff --git a/src/pyedb/legacy/edb_core/layout.py b/src/pyedb/legacy/edb_core/layout.py index 73d0da2cf7..a6d6e02761 100644 --- a/src/pyedb/legacy/edb_core/layout.py +++ b/src/pyedb/legacy/edb_core/layout.py @@ -4,17 +4,17 @@ import math import warnings -from pyedb.legacy.edb_core.dotnet.primitive import BondwireDotNet -from pyedb.legacy.edb_core.dotnet.primitive import CircleDotNet -from pyedb.legacy.edb_core.dotnet.primitive import PathDotNet -from pyedb.legacy.edb_core.dotnet.primitive import PolygonDotNet -from pyedb.legacy.edb_core.dotnet.primitive import RectangleDotNet -from pyedb.legacy.edb_core.edb_data.primitives_data import EDBPrimitives -from pyedb.legacy.edb_core.edb_data.primitives_data import cast +from pyedb.generic.general_methods import pyedb_function_handler +from pyedb.legacy.edb_core.dotnet.primitive import ( + BondwireDotNet, + CircleDotNet, + PathDotNet, + PolygonDotNet, + RectangleDotNet, +) +from pyedb.legacy.edb_core.edb_data.primitives_data import EDBPrimitives, cast from pyedb.legacy.edb_core.edb_data.utilities import EDBStatistics from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.general_methods import pyedb_function_handler - class EdbLayout(object): diff --git a/src/pyedb/legacy/edb_core/layout_validation.py b/src/pyedb/legacy/edb_core/layout_validation.py index 5d4fb0fb5f..282befbd1f 100644 --- a/src/pyedb/legacy/edb_core/layout_validation.py +++ b/src/pyedb/legacy/edb_core/layout_validation.py @@ -1,10 +1,8 @@ import re +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance from pyedb.legacy.edb_core.edb_data.primitives_data import EDBPrimitives -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler - class LayoutValidation: @@ -107,7 +105,7 @@ def disjoint_nets( clean_disjoints_less_than=0.0, order_by_area=False, keep_disjoint_pins=False, - ): + ): """Find and fix disjoint nets from a given netlist. Parameters @@ -237,7 +235,6 @@ def area_calc(elem): return new_nets - def illegal_net_names(self, fix=False): """Find and fix illegal net names.""" pattern = r"[\(\)\\\/:;*?<>\'\"|`~$]" @@ -255,7 +252,6 @@ def illegal_net_names(self, fix=False): self._pedb._logger.info("Found {} illegal net names.".format(len(renamed_nets))) return - def illegal_rlc_values(self, fix=False): """Find and fix RLC illegal values.""" inductors = self._pedb.components.inductors @@ -272,4 +268,4 @@ def illegal_rlc_values(self, fix=False): v.rlc_values = [0, 1, 0] self._pedb._logger.info("Found {} inductors have no value.".format(len(temp))) - return \ No newline at end of file + return diff --git a/src/pyedb/legacy/edb_core/materials.py b/src/pyedb/legacy/edb_core/materials.py index 57455772bc..396c8f2936 100644 --- a/src/pyedb/legacy/edb_core/materials.py +++ b/src/pyedb/legacy/edb_core/materials.py @@ -6,11 +6,9 @@ import re import warnings -from pyedb.generic.general_methods import is_ironpython -from pyedb.legacy.edb_core.general import convert_py_list_to_net_list +from pyedb.generic.general_methods import is_ironpython, pyedb_function_handler from pyedb.legacy.clr_module import _clr -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.general import convert_py_list_to_net_list logger = logging.getLogger(__name__) @@ -359,6 +357,7 @@ def _load(self, input_dict): if self._edb_material_def.GetDielectricMaterialModel(): self._edb_material_def.SetDielectricMaterialModel(self._edb_value(None)) + # TODO: Cleanup class Materials(object): """Manages EDB methods for material management accessible from `Edb.materials` property.""" diff --git a/src/pyedb/legacy/edb_core/net_class.py b/src/pyedb/legacy/edb_core/net_class.py index 30fb5d8601..54b768876f 100644 --- a/src/pyedb/legacy/edb_core/net_class.py +++ b/src/pyedb/legacy/edb_core/net_class.py @@ -2,11 +2,12 @@ import re -from pyedb.legacy.edb_core.edb_data.nets_data import EDBDifferentialPairData -from pyedb.legacy.edb_core.edb_data.nets_data import EDBExtendedNetData -from pyedb.legacy.edb_core.edb_data.nets_data import EDBNetClassData from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.edb_data.nets_data import ( + EDBDifferentialPairData, + EDBExtendedNetData, + EDBNetClassData, +) class EdbCommon: diff --git a/src/pyedb/legacy/edb_core/nets.py b/src/pyedb/legacy/edb_core/nets.py index 5647aedede..a3c3c0cdbd 100644 --- a/src/pyedb/legacy/edb_core/nets.py +++ b/src/pyedb/legacy/edb_core/nets.py @@ -5,13 +5,14 @@ import time import warnings +from pyedb.generic.constants import CSS4_COLORS +from pyedb.generic.general_methods import ( + generate_unique_name, + is_ironpython, + pyedb_function_handler, +) from pyedb.legacy.edb_core.edb_data.nets_data import EDBNetsData from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.constants import CSS4_COLORS -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import pyedb_function_handler - from pyedb.modeler.geometry_operators import GeometryOperators @@ -106,7 +107,7 @@ def nets(self): temp = {} for net in self._layout.nets: - temp[net.name] = EDBNetsData(net.api_object, self._pedb) + temp[net.name] = EDBNetsData(net.api_object, self._pedb) return temp @property diff --git a/src/pyedb/legacy/edb_core/padstack.py b/src/pyedb/legacy/edb_core/padstack.py index bdc4942da9..74c8b511c3 100644 --- a/src/pyedb/legacy/edb_core/padstack.py +++ b/src/pyedb/legacy/edb_core/padstack.py @@ -4,13 +4,13 @@ import math import warnings -from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstack -from pyedb.legacy.edb_core.edb_data.padstacks_data import EDBPadstackInstance -from pyedb.legacy.edb_core.general import convert_py_list_to_net_list +from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler from pyedb.legacy.clr_module import Array -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler - +from pyedb.legacy.edb_core.edb_data.padstacks_data import ( + EDBPadstack, + EDBPadstackInstance, +) +from pyedb.legacy.edb_core.general import convert_py_list_to_net_list from pyedb.modeler.geometry_operators import GeometryOperators diff --git a/src/pyedb/legacy/edb_core/siwave.py b/src/pyedb/legacy/edb_core/siwave.py index 59cec825a7..28338ab034 100644 --- a/src/pyedb/legacy/edb_core/siwave.py +++ b/src/pyedb/legacy/edb_core/siwave.py @@ -5,21 +5,25 @@ import os import time -from pyedb.legacy.edb_core.edb_data.simulation_configuration import SimulationConfiguration -from pyedb.legacy.edb_core.edb_data.simulation_configuration import SourceType -from pyedb.legacy.edb_core.edb_data.sources import CircuitPort -from pyedb.legacy.edb_core.edb_data.sources import CurrentSource -from pyedb.legacy.edb_core.edb_data.sources import DCTerminal -from pyedb.legacy.edb_core.edb_data.sources import PinGroup -from pyedb.legacy.edb_core.edb_data.sources import ResistorSource -from pyedb.legacy.edb_core.edb_data.sources import VoltageSource +from pyedb.generic.constants import SolverType, SweepType +from pyedb.generic.general_methods import ( + _retry_ntimes, + generate_unique_name, + pyedb_function_handler, +) +from pyedb.legacy.edb_core.edb_data.simulation_configuration import ( + SimulationConfiguration, + SourceType, +) +from pyedb.legacy.edb_core.edb_data.sources import ( + CircuitPort, + CurrentSource, + DCTerminal, + PinGroup, + ResistorSource, + VoltageSource, +) from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.constants import SolverType -from pyedb.generic.constants import SweepType -from pyedb.generic.general_methods import _retry_ntimes -from pyedb.generic.general_methods import generate_unique_name -from pyedb.generic.general_methods import pyedb_function_handler - from pyedb.modeler.geometry_operators import GeometryOperators diff --git a/src/pyedb/legacy/edb_core/stackup.py b/src/pyedb/legacy/edb_core/stackup.py index 924a6b8298..ce0d3e44d4 100644 --- a/src/pyedb/legacy/edb_core/stackup.py +++ b/src/pyedb/legacy/edb_core/stackup.py @@ -12,14 +12,17 @@ import re import warnings -from pyedb.generic.general_methods import generate_unique_name -from pyedb.legacy.edb_core.edb_data.layer_data import LayerEdbClass -from pyedb.legacy.edb_core.edb_data.layer_data import StackupLayerEdbClass +from pyedb.generic.general_methods import ( + ET, + generate_unique_name, + is_ironpython, + pyedb_function_handler, +) +from pyedb.legacy.edb_core.edb_data.layer_data import ( + LayerEdbClass, + StackupLayerEdbClass, +) from pyedb.legacy.edb_core.general import convert_py_list_to_net_list -from pyedb.generic.general_methods import ET -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import pyedb_function_handler - from pyedb.misc.aedtlib_personalib_install import write_pretty_xml pd = None @@ -2337,19 +2340,19 @@ def _convert_elevation(el): # create patch x = [0, 0, 1, 1] if ly[3] > 0: - le = ly[1] # lower elevation - ue = ly[2] # upper elevation - y = [le, ue, ue, le] + lower_elevation = ly[1] + upper_elevation = ly[2] + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] plot_data.insert(0, [x, y, color, label, signal_alpha, "fill"]) else: - le = ly[1] - min_thickness * 0.1 # make the zero thickness layers more visible - ue = ly[2] + min_thickness * 0.1 - y = [le, ue, ue, le] + lower_elevation = ly[1] - min_thickness * 0.1 # make the zero thickness layers more visible + upper_elevation = ly[2] + min_thickness * 0.1 + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] # put the zero thickness layers on top plot_data.append([x, y, color, label, zero_thickness_alpha, "fill"]) # create annotation - y_pos = (le + ue) / 2 + y_pos = (lower_elevation + upper_elevation) / 2 if layer.type == "dielectric": x_pos = -annotation_x_margin annotations.append( @@ -2373,14 +2376,14 @@ def _convert_elevation(el): min_thickness = min([i[3] for i in signal_layers if i[3] != 0]) columns = [] # first column is x=[0,1], second column is x=[1,2] and so on... for ly in signal_layers: - le = ly[1] # lower elevation + lower_elevation = ly[1] # lower elevation t = ly[3] # thickness put_in_column = 0 cell_position = 0 for c in columns: uep = c[-1][0][2] # upper elevation of the last entry of that column tp = c[-1][0][3] # thickness of the last entry of that column - if le < uep or (abs(le - uep) < 1e-15 and tp == 0 and t == 0): + if lower_elevation < uep or (abs(lower_elevation - uep) < 1e-15 and tp == 0 and t == 0): put_in_column += 1 cell_position = len(c) else: @@ -2427,20 +2430,20 @@ def _convert_elevation(el): ) if ly[3] > 0: - le = ly[1] # lower elevation - ue = ly[2] # upper elevation - y = [le, ue, ue, le] + lower_elevation = ly[1] + upper_elevation = ly[2] + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] plot_data.insert(0, [x, y, color, label, signal_alpha, "fill"]) else: - le = ly[1] - min_thickness * 0.1 # make the zero thickness layers more visible - ue = ly[2] + min_thickness * 0.1 - y = [le, ue, ue, le] + lower_elevation = ly[1] - min_thickness * 0.1 # make the zero thickness layers more visible + upper_elevation = ly[2] + min_thickness * 0.1 + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] # put the zero thickness layers on top plot_data.append([x, y, color, label, zero_thickness_alpha, "fill"]) # create annotation x_pos = 1.0 - y_pos = (le + ue) / 2 + y_pos = (lower_elevation + upper_elevation) / 2 annotations.append([x_pos, y_pos, layer.name, {"fontsize": annotation_fontsize}]) # order the annotations based on y_pos (it is necessary later to move them to avoid text overlapping) @@ -2460,15 +2463,15 @@ def _convert_elevation(el): layer.name, layer.material, layer.thickness * 1e6, layer.lower_elevation * 1e6 ) # create the patch - le = ly[1] # lower elevation - ue = ly[2] # upper elevation - y = [le, ue, ue, le] + lower_elevation = ly[1] + upper_elevation = ly[2] + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] x = [0, 0, width, width] plot_data.insert(0, [x, y, color, label, diel_alpha, "fill"]) # create annotation x_pos = -annotation_x_margin * width - y_pos = (le + ue) / 2 + y_pos = (lower_elevation + upper_elevation) / 2 annotations.append( [x_pos, y_pos, layer.name, {"fontsize": annotation_fontsize, "horizontalalignment": "right"}] ) @@ -2575,17 +2578,17 @@ def _convert_elevation(el): x_start + pad_size / 2 * scaling_f_pad, x_start + pad_size / 2 * scaling_f_pad, ] - le = [e[1] for e in layers_data if e[0].name == layer or layer == "Default"][0] - ue = [e[2] for e in layers_data if e[0].name == layer or layer == "Default"][0] - y = [le, ue, ue, le] + lower_elevation = [e[1] for e in layers_data if e[0].name == layer or layer == "Default"][0] + upper_elevation = [e[2] for e in layers_data if e[0].name == layer or layer == "Default"][0] + y = [lower_elevation, upper_elevation, upper_elevation, lower_elevation] # create the patch for that signal layer plot_data.append([x, y, color_keys[color_index], None, 1.0, "fill"]) elif stackup_mode == "Overlapping": # here evaluate the x based on the column evaluated before and the pad size pass - min_le = min(le, min_le) - max_ue = max(ue, max_ue) + min_le = min(lower_elevation, min_le) + max_ue = max(upper_elevation, max_ue) if definition.hole_properties: # create patch for the hole hole_radius = definition.hole_properties[0] / 2 * scaling_f_pad diff --git a/src/pyedb/misc/aedtlib_personalib_install.py b/src/pyedb/misc/aedtlib_personalib_install.py index ee8ef16a89..9c4a3845c3 100644 --- a/src/pyedb/misc/aedtlib_personalib_install.py +++ b/src/pyedb/misc/aedtlib_personalib_install.py @@ -11,4 +11,4 @@ def write_pretty_xml(root, file_path): xml_str = "\n".join(lines) with open(file_path, "w") as f: - f.write(xml_str) \ No newline at end of file + f.write(xml_str) diff --git a/src/pyedb/misc/downloads.py b/src/pyedb/misc/downloads.py index f94aa4c796..0e478cf8e5 100644 --- a/src/pyedb/misc/downloads.py +++ b/src/pyedb/misc/downloads.py @@ -4,9 +4,7 @@ import tempfile import zipfile -from pyedb.generic.general_methods import is_ironpython -from pyedb.generic.general_methods import is_linux -from pyedb.generic.general_methods import settings +from pyedb.generic.general_methods import is_ironpython, is_linux, settings from pyedb.misc.misc import list_installed_ansysem if is_ironpython: diff --git a/src/pyedb/modeler/geometry_operators.py b/src/pyedb/modeler/geometry_operators.py index 826a069496..c6a277d1b6 100644 --- a/src/pyedb/modeler/geometry_operators.py +++ b/src/pyedb/modeler/geometry_operators.py @@ -3,10 +3,7 @@ import re import sys -from pyedb.generic.constants import AXIS -from pyedb.generic.constants import PLANE -from pyedb.generic.constants import SWEEPDRAFT -from pyedb.generic.constants import scale_units +from pyedb.generic.constants import AXIS, PLANE, SWEEPDRAFT, scale_units from pyedb.generic.general_methods import pyedb_function_handler diff --git a/tests/__init__.py b/tests/__init__.py index 3772a42a74..ab4e2cb5fe 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -16,4 +16,3 @@ } """ - diff --git a/tests/legacy/integration/__init__.py b/tests/legacy/integration/__init__.py index 6e10663507..ac2de6d4ad 100644 --- a/tests/legacy/integration/__init__.py +++ b/tests/legacy/integration/__init__.py @@ -1,3 +1,3 @@ """Tests related to the interaction of multiple classes from PyEDB, e.g. Edb and Ipc2581, ... -""" \ No newline at end of file +""" diff --git a/tests/legacy/system/__init__.py b/tests/legacy/system/__init__.py index 2194fa96e2..98b5beab7c 100644 --- a/tests/legacy/system/__init__.py +++ b/tests/legacy/system/__init__.py @@ -1,3 +1,3 @@ """Tests related to testing the system as a whole, e.g. exporting the data of an aedb file to ipc2581, ... -""" \ No newline at end of file +""" diff --git a/tests/legacy/system/test_edb_differential_pairs.py b/tests/legacy/system/test_edb_differential_pairs.py index 2bcb2b5dce..77f3a75763 100644 --- a/tests/legacy/system/test_edb_differential_pairs.py +++ b/tests/legacy/system/test_edb_differential_pairs.py @@ -5,6 +5,7 @@ pytestmark = [pytest.mark.system, pytest.mark.legacy] + class TestClass: @pytest.fixture(autouse=True) def init(self, legacy_edb_app, local_scratch, target_path, target_path2, target_path4): diff --git a/tests/legacy/system/test_edb_extended_nets.py b/tests/legacy/system/test_edb_extended_nets.py index c9b16452a5..57fc7fac6d 100644 --- a/tests/legacy/system/test_edb_extended_nets.py +++ b/tests/legacy/system/test_edb_extended_nets.py @@ -5,6 +5,7 @@ pytestmark = [pytest.mark.system, pytest.mark.legacy] + class TestClass: @pytest.fixture(autouse=True) def init(self, legacy_edb_app, local_scratch, target_path, target_path2, target_path4): diff --git a/tests/legacy/system/test_edb_stackup.py b/tests/legacy/system/test_edb_stackup.py index 6b90578ac4..b4620bedcb 100644 --- a/tests/legacy/system/test_edb_stackup.py +++ b/tests/legacy/system/test_edb_stackup.py @@ -1,16 +1,18 @@ """Tests related to Edb stackup """ -import os import math +import os + import pytest + from pyedb.legacy.edb import EdbLegacy -from tests.conftest import desktop_version -from tests.conftest import local_path +from tests.conftest import desktop_version, local_path from tests.legacy.system.conftest import test_subfolder pytestmark = [pytest.mark.system, pytest.mark.legacy] + class TestClass: @pytest.fixture(autouse=True) def init(self, legacy_edb_app, local_scratch, target_path, target_path2, target_path4): @@ -303,6 +305,7 @@ def test_stackup_layer_properties(self): def test_stackup_load(self): """Import stackup from a file.""" import json + fpath = os.path.join(local_path, "example_models", test_subfolder, "stackup.json") stackup_json = json.load(open(fpath, "r")) @@ -978,6 +981,7 @@ def validate_material(pedb_materials, material, delta): else: assert pedb_mat.permittivity_at_frequency == material["permittivity_at_frequency"] return 0 + import json target_path = os.path.join(local_path, "example_models", test_subfolder, "ANSYS-HSD_V1.aedb") diff --git a/tests/legacy/unit/test_edbsiwave.py b/tests/legacy/unit/test_edbsiwave.py index 47da89f113..225b087656 100644 --- a/tests/legacy/unit/test_edbsiwave.py +++ b/tests/legacy/unit/test_edbsiwave.py @@ -1,10 +1,13 @@ import os -import pytest + from mock import Mock +import pytest + from pyedb.legacy.edb_core.siwave import EdbSiwave pytestmark = [pytest.mark.unit, pytest.mark.no_licence, pytest.mark.legacy] + class TestClass: @pytest.fixture(autouse=True) def init(self): diff --git a/tests/legacy/unit/test_materials.py b/tests/legacy/unit/test_materials.py index 7671d646e0..226fd58905 100644 --- a/tests/legacy/unit/test_materials.py +++ b/tests/legacy/unit/test_materials.py @@ -1,9 +1,9 @@ import builtins from unittest.mock import mock_open + +from mock import MagicMock, PropertyMock, patch import pytest -from mock import MagicMock -from mock import PropertyMock -from mock import patch + from pyedb.legacy.edb_core.materials import Materials pytestmark = [pytest.mark.unit, pytest.mark.no_licence, pytest.mark.legacy] @@ -61,6 +61,7 @@ $end 'Water(@360K)' """ + class TestClass: @pytest.fixture(autouse=True) def init(self): diff --git a/tests/legacy/unit/test_padstack.py b/tests/legacy/unit/test_padstack.py index 12ed7b29b9..0b342f9cc1 100644 --- a/tests/legacy/unit/test_padstack.py +++ b/tests/legacy/unit/test_padstack.py @@ -1,9 +1,11 @@ +from mock import MagicMock, PropertyMock, patch import pytest -from mock import PropertyMock, patch, MagicMock + from pyedb.legacy.edb_core.padstack import EdbPadstacks pytestmark = [pytest.mark.unit, pytest.mark.no_licence, pytest.mark.legacy] + class TestClass: @pytest.fixture(autouse=True) def init(self): @@ -17,14 +19,14 @@ def init(self): # ) # def test_132_via_plating_ratio_check(self): # assert self.edbapp.padstacks.check_and_fix_via_plating() - # minimum_value_to_replace=0.0, default_plating_ratio=0.2 + # minimum_value_to_replace=0.0, default_plating_ratio=0.2 - @patch('pyedb.legacy.edb_core.padstack.EdbPadstacks.definitions', new_callable=PropertyMock) + @patch("pyedb.legacy.edb_core.padstack.EdbPadstacks.definitions", new_callable=PropertyMock) def test_padstack_plating_ratio_fixing(self, mock_definitions): """Fix hole plating ratio.""" mock_definitions.return_value = { - "definition_0": MagicMock(hole_plating_ratio = -0.1), - "definition_1": MagicMock(hole_plating_ratio = 0.3) + "definition_0": MagicMock(hole_plating_ratio=-0.1), + "definition_1": MagicMock(hole_plating_ratio=0.3), } assert self.padstacks["definition_0"].hole_plating_ratio == -0.1 self.padstacks.check_and_fix_via_plating() From f87d0bf1a25239974888da142c2e10800af4aefe Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 14:25:23 +0100 Subject: [PATCH 14/19] CI: fix vale warning --- doc/source/Getting_started/versioning.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst index 1749f714f3..2e43d02d6f 100644 --- a/doc/source/Getting_started/versioning.rst +++ b/doc/source/Getting_started/versioning.rst @@ -25,8 +25,8 @@ and files from the MAPDL service. Legacy interfaces ================= -Working with .NET interface ---------------------------- +Microsoft development framework interface +----------------------------------------- PyEDB supports the legacy .NET interface, enabled with the settings option. From 1c7e57018849fe68bef0226fcc25a0f8425ad3de Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 16:05:14 +0100 Subject: [PATCH 15/19] DOC: fix docstring Edb import --- src/pyedb/legacy/edb_core/components.py | 62 +++++++++---------- .../legacy/edb_core/edb_data/nets_data.py | 10 +-- .../edb_core/edb_data/padstacks_data.py | 10 +-- src/pyedb/legacy/edb_core/edb_data/ports.py | 6 +- .../edb_core/edb_data/primitives_data.py | 6 +- .../edb_data/simulation_configuration.py | 4 +- .../legacy/edb_core/edb_data/variables.py | 2 +- src/pyedb/legacy/edb_core/hfss.py | 16 ++--- src/pyedb/legacy/edb_core/layout.py | 2 +- src/pyedb/legacy/edb_core/materials.py | 6 +- src/pyedb/legacy/edb_core/net_class.py | 12 ++-- src/pyedb/legacy/edb_core/nets.py | 2 +- src/pyedb/legacy/edb_core/padstack.py | 2 +- src/pyedb/legacy/edb_core/siwave.py | 20 +++--- src/pyedb/legacy/edb_core/stackup.py | 8 +-- 15 files changed, 84 insertions(+), 84 deletions(-) diff --git a/src/pyedb/legacy/edb_core/components.py b/src/pyedb/legacy/edb_core/components.py index 83f95a1032..629dce467e 100644 --- a/src/pyedb/legacy/edb_core/components.py +++ b/src/pyedb/legacy/edb_core/components.py @@ -56,7 +56,7 @@ class Components(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components """ @@ -305,7 +305,7 @@ def resistors(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.resistors """ @@ -327,7 +327,7 @@ def capacitors(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.capacitors """ @@ -349,7 +349,7 @@ def inductors(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.inductors @@ -372,7 +372,7 @@ def ICs(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.ICs @@ -395,7 +395,7 @@ def IOs(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.IOs @@ -418,7 +418,7 @@ def Others(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.others @@ -441,7 +441,7 @@ def components_by_partname(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.components_by_partname @@ -738,7 +738,7 @@ def create_port_on_pins(self, refdes, pins, reference_pins, impedance=50.0, port EDB terminal created, or False if failed to create. Example: - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(path_to_edb_file) >>> pin = "AJ6" >>> ref_pins = ["AM7", "AM4"] @@ -854,7 +854,7 @@ def create_port_on_component( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> net_list = ["M_DQ<1>", "M_DQ<2>", "M_DQ<3>", "M_DQ<4>", "M_DQ<5>"] >>> edbapp.components.create_port_on_component(cmp="U2A5", net_list=net_list, @@ -1055,7 +1055,7 @@ def replace_rlc_by_gap_boundaries(self, component=None): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(edb_file) >>> for refdes, cmp in edb.components.capacitors.items(): >>> edb.components.replace_rlc_by_gap_boundaries(refdes) @@ -1100,7 +1100,7 @@ def deactivate_rlc_component(self, component=None, create_circuit_port=False): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb_file = r'C:\my_edb_file.aedb' >>> edb = Edb(edb_file) >>> for cmp in list(edb.components.instances.keys()): @@ -1425,7 +1425,7 @@ def create( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> pins = edbapp.components.get_pin_from_component("A1") >>> edbapp.components.create(pins, "A1New") @@ -1523,7 +1523,7 @@ def create_component_from_pins( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> pins = edbapp.components.get_pin_from_component("A1") >>> edbapp.components.create(pins, "A1New") @@ -1562,7 +1562,7 @@ def set_component_model(self, componentname, model_type="Spice", modelpath=None, Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.set_component_model("A1", model_type="Spice", ... modelpath="pathtospfile", @@ -1646,7 +1646,7 @@ def create_pingroup_from_pins(self, pins, group_name=None): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.create_pingroup_from_pins(gndpinlist, "MyGNDPingroup") @@ -1716,7 +1716,7 @@ def delete_single_pin_rlc(self, deactivate_only=False): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> list_of_deleted_rlcs = edbapp.components.delete_single_pin_rlc() >>> print(list_of_deleted_rlcs) @@ -1757,7 +1757,7 @@ def delete_component(self, component_name): # pragma: no cover Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.delete("A1") @@ -1782,7 +1782,7 @@ def delete(self, component_name): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.delete("A1") @@ -1812,7 +1812,7 @@ def disable_rlc_component(self, component_name): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.disable_rlc_component("A1") @@ -1880,7 +1880,7 @@ def set_solder_ball( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.set_solder_ball("A1") @@ -1970,7 +1970,7 @@ def set_component_rlc( Examples -------- - >>> from legacy import Edb + >>> 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 @@ -2238,7 +2238,7 @@ def get_pin_from_component(self, component, netName=None, pinName=None): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_pin_from_component("R1", refdes) @@ -2287,7 +2287,7 @@ def get_aedt_pin_name(self, pin): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_aedt_pin_name(pin) @@ -2316,7 +2316,7 @@ def get_pin_position(self, pin): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_pin_position(pin) @@ -2352,7 +2352,7 @@ def get_pins_name_from_net(self, pin_list, net_name): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_pins_name_from_net(pin_list, net_name) @@ -2380,7 +2380,7 @@ def get_nets_from_pin_list(self, PinList): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_nets_from_pin_list(pinlist) @@ -2407,7 +2407,7 @@ def get_component_net_connection_info(self, refdes): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_component_net_connection_info(refdes) @@ -2435,7 +2435,7 @@ def get_rats(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_rats() @@ -2462,7 +2462,7 @@ def get_through_resistor_list(self, threshold=1): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.components.get_through_resistor_list() @@ -2501,7 +2501,7 @@ def short_component_pins(self, component_name, pins_to_short=None, width=1e-3): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components.short_component_pins("J4A2", ["G4", "9", "3"]) diff --git a/src/pyedb/legacy/edb_core/edb_data/nets_data.py b/src/pyedb/legacy/edb_core/edb_data/nets_data.py index e81d9123f9..42e8e129a7 100644 --- a/src/pyedb/legacy/edb_core/edb_data/nets_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/nets_data.py @@ -15,7 +15,7 @@ class EDBNetsData(NetDotNet): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_net = edb.nets.nets["GND"] >>> edb_net.name # Class Property @@ -155,7 +155,7 @@ def extended_net(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> app = Edb() >>> app.nets["BST_V3P3_S5"].extended_net """ @@ -174,7 +174,7 @@ class EDBNetClassData(NetClassDotNet): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb.net_classes """ @@ -198,7 +198,7 @@ class EDBExtendedNetData(ExtendedNetDotNet): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_extended_net = edb.nets.extended_nets["GND"] >>> edb_extended_net.name # Class Property @@ -253,7 +253,7 @@ class EDBDifferentialPairData(DifferentialPairDotNet): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> diff_pair = edb.differential_pairs["DQ4"] >>> diff_pair.positive_net diff --git a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py index 3d192a5c65..2b48531244 100644 --- a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py @@ -32,7 +32,7 @@ class EDBPadProperties(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_pad_properties = edb.padstacks.definitions["MyPad"].pad_by_layer["TOP"] """ @@ -379,7 +379,7 @@ class EDBPadstack(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_padstack = edb.padstacks.definitions["MyPad"] """ @@ -985,7 +985,7 @@ class EDBPadstackInstance(EDBPrimitivesMain): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_padstack_instance = edb.padstacks.instances[0] """ @@ -1559,7 +1559,7 @@ def aedt_name(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.padstacks.instances[111].get_aedt_pin_name() @@ -1727,7 +1727,7 @@ def create_rectangle_in_pad(self, layer_name, return_points=False, partition_max Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_layout = edbapp.modeler >>> list_of_padstack_instances = list(edbapp.padstacks.instances.values()) diff --git a/src/pyedb/legacy/edb_core/edb_data/ports.py b/src/pyedb/legacy/edb_core/edb_data/ports.py index 8963929a5f..fd0b6f7316 100644 --- a/src/pyedb/legacy/edb_core/edb_data/ports.py +++ b/src/pyedb/legacy/edb_core/edb_data/ports.py @@ -19,7 +19,7 @@ class GapPort(EdgeTerminal): Examples -------- This example shows how to access the ``GapPort`` class. - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb("myaedb.aedb") >>> gap_port = edb.ports["gap_port"] """ @@ -87,7 +87,7 @@ class WavePort(EdgeTerminal): -------- This example shows how to access the ``WavePort`` class. - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb("myaedb.aedb") >>> exc = edb.ports """ @@ -166,7 +166,7 @@ class ExcitationSources(Terminal): Examples -------- This example shows how to access this class. - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb("myaedb.aedb") >>> all_sources = edb.sources >>> print(all_sources["VSource1"].name) diff --git a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py index 7f1988f8c7..cc5b04593a 100644 --- a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py @@ -62,7 +62,7 @@ class EDBPrimitivesMain(Connectable): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_prim = edb.modeler.primitives[0] >>> edb_prim.is_void # Class Property @@ -180,7 +180,7 @@ class EDBPrimitives(EDBPrimitivesMain): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> edb_prim = edb.modeler.primitives[0] >>> edb_prim.is_void # Class Property @@ -1082,7 +1082,7 @@ class EDBArcs(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb(myedb, edbversion="2021.2") >>> prim_arcs = edb.modeler.primitives[0].arcs >>> prim_arcs.center # arc center diff --git a/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py b/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py index 48cef5e867..0a51932d19 100644 --- a/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py +++ b/src/pyedb/legacy/edb_core/edb_data/simulation_configuration.py @@ -1897,7 +1897,7 @@ class SimulationConfiguration(object): The class is instantiated from an open edb: - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> sim_setup = edb.new_simulation_configuration() @@ -2390,7 +2390,7 @@ def _read_cfg(self): # pragma: no cover Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> from legacy.edb_core.edb_data.simulation_configuration import SimulationConfiguration >>> config_file = path_configuration_file >>> source_file = path_to_edb_folder diff --git a/src/pyedb/legacy/edb_core/edb_data/variables.py b/src/pyedb/legacy/edb_core/edb_data/variables.py index da68a28010..3a83455674 100644 --- a/src/pyedb/legacy/edb_core/edb_data/variables.py +++ b/src/pyedb/legacy/edb_core/edb_data/variables.py @@ -84,7 +84,7 @@ def delete(self): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> edb.design_variables["new_variable"].delete() """ diff --git a/src/pyedb/legacy/edb_core/hfss.py b/src/pyedb/legacy/edb_core/hfss.py index b99a6b66bb..b5521aaee5 100644 --- a/src/pyedb/legacy/edb_core/hfss.py +++ b/src/pyedb/legacy/edb_core/hfss.py @@ -27,7 +27,7 @@ class EdbHfss(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edb_hfss = edb_3dedbapp.hfss """ @@ -156,7 +156,7 @@ def create_circuit_port_on_pin(self, pos_pin, neg_pin, impedance=50, port_name=N port_name : str, optional Port Name - >>> from legacy import Edb + >>> 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") @@ -194,7 +194,7 @@ def create_voltage_source_on_pin(self, pos_pin, neg_pin, voltage_value=3.3, phas Examples -------- - >>> from legacy import Edb + >>> 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") @@ -226,7 +226,7 @@ def create_current_source_on_pin(self, pos_pin, neg_pin, current_value=0.1, phas Examples -------- - >>> from legacy import Edb + >>> 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") @@ -257,7 +257,7 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): Examples -------- - >>> from legacy import Edb + >>> 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") @@ -300,7 +300,7 @@ def create_circuit_port_on_net( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.hfss.create_circuit_port_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 50, "port_name") """ @@ -352,7 +352,7 @@ def create_voltage_source_on_net( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edb.hfss.create_voltage_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 3.3, 0, "source_name") """ @@ -405,7 +405,7 @@ def create_current_source_on_net( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edb.hfss.create_current_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 0.1, 0, "source_name") """ diff --git a/src/pyedb/legacy/edb_core/layout.py b/src/pyedb/legacy/edb_core/layout.py index a6d6e02761..61af13103b 100644 --- a/src/pyedb/legacy/edb_core/layout.py +++ b/src/pyedb/legacy/edb_core/layout.py @@ -22,7 +22,7 @@ class EdbLayout(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_layout = edbapp.modeler """ diff --git a/src/pyedb/legacy/edb_core/materials.py b/src/pyedb/legacy/edb_core/materials.py index 396c8f2936..29b46ed644 100644 --- a/src/pyedb/legacy/edb_core/materials.py +++ b/src/pyedb/legacy/edb_core/materials.py @@ -625,7 +625,7 @@ def add_multipole_debye_material( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> freq = [0, 2, 3, 4, 5, 6] >>> rel_perm = [1e9, 1.1e9, 1.2e9, 1.3e9, 1.5e9, 1.6e9] @@ -673,7 +673,7 @@ def duplicate(self, material_name, new_material_name): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb_app = Edb() >>> my_material = edb_app.materials.duplicate("copper", "my_new_copper") @@ -791,7 +791,7 @@ def get_property_by_material_name(self, property_name, material_name): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb_app = Edb() >>> returned_tuple = edb_app.materials.get_property_by_material_name("conductivity", "copper") >>> edb_value = returned_tuple[0] diff --git a/src/pyedb/legacy/edb_core/net_class.py b/src/pyedb/legacy/edb_core/net_class.py index 54b768876f..dc0a0218e7 100644 --- a/src/pyedb/legacy/edb_core/net_class.py +++ b/src/pyedb/legacy/edb_core/net_class.py @@ -53,7 +53,7 @@ class EdbNetClasses(EdbCommon, object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_nets = edbapp.net_classes """ @@ -110,7 +110,7 @@ class EdbExtendedNets(EdbCommon, object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_nets = edbapp.extended_nets """ @@ -188,7 +188,7 @@ def auto_identify_signal(self, resistor_below=10, inductor_below=1, capacitor_ab Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> app = Edb() >>> app.extended_nets.auto_identify_signal() """ @@ -223,7 +223,7 @@ def auto_identify_power(self, resistor_below=10, inductor_below=1, capacitor_abo Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> app = Edb() >>> app.extended_nets.auto_identify_power() """ @@ -237,7 +237,7 @@ class EdbDifferentialPairs(EdbCommon, object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_nets = edbapp.differential_pairs.items >>> edb_nets = edbapp.differential_pairs["DQ4"] @@ -304,7 +304,7 @@ def auto_identify(self, positive_differentiator="_P", negative_differentiator="_ A list containing identified differential pair names. Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2023.1") >>> edb_nets = edbapp.differential_pairs.auto_identify() """ diff --git a/src/pyedb/legacy/edb_core/nets.py b/src/pyedb/legacy/edb_core/nets.py index a3c3c0cdbd..e5cf5b5b6b 100644 --- a/src/pyedb/legacy/edb_core/nets.py +++ b/src/pyedb/legacy/edb_core/nets.py @@ -273,7 +273,7 @@ def generate_extended_nets( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> app = Edb() >>> app.nets.get_extended_nets() """ diff --git a/src/pyedb/legacy/edb_core/padstack.py b/src/pyedb/legacy/edb_core/padstack.py index 74c8b511c3..4691793299 100644 --- a/src/pyedb/legacy/edb_core/padstack.py +++ b/src/pyedb/legacy/edb_core/padstack.py @@ -19,7 +19,7 @@ class EdbPadstacks(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_padstacks = edbapp.padstacks """ diff --git a/src/pyedb/legacy/edb_core/siwave.py b/src/pyedb/legacy/edb_core/siwave.py index 28338ab034..3b23a3ec9e 100644 --- a/src/pyedb/legacy/edb_core/siwave.py +++ b/src/pyedb/legacy/edb_core/siwave.py @@ -37,7 +37,7 @@ class EdbSiwave(object): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", edbversion="2021.2") >>> edb_siwave = edbapp.siwave """ @@ -227,7 +227,7 @@ def create_circuit_port_on_pin(self, pos_pin, neg_pin, impedance=50, port_name=N Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> pins = edbapp.components.get_pin_from_component("U2A5") >>> edbapp.siwave.create_circuit_port_on_pin(pins[0], pins[1], 50, "port_name") @@ -352,7 +352,7 @@ def create_voltage_source_on_pin(self, pos_pin, neg_pin, voltage_value=3.3, phas Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> pins = edbapp.components.get_pin_from_component("U2A5") >>> edbapp.siwave.create_voltage_source_on_pin(pins[0], pins[1], 50, "source_name") @@ -402,7 +402,7 @@ def create_current_source_on_pin(self, pos_pin, neg_pin, current_value=0.1, phas Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> pins = edbapp.components.get_pin_from_component("U2A5") >>> edbapp.siwave.create_current_source_on_pin(pins[0], pins[1], 50, "source_name") @@ -449,7 +449,7 @@ def create_resistor_on_pin(self, pos_pin, neg_pin, rvalue=1, resistor_name=""): Examples -------- - >>> from legacy import Edb + >>> 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") @@ -525,7 +525,7 @@ def create_circuit_port_on_net( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edbapp.siwave.create_circuit_port_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 50, "port_name") """ @@ -594,7 +594,7 @@ def create_voltage_source_on_net( Examples -------- - >>> from legacy import Edb + >>> 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") """ @@ -665,7 +665,7 @@ def create_current_source_on_net( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edb.siwave.create_current_source_on_net("U2A5", "V1P5_S3", "U2A5", "GND", 0.1, 0, "source_name") """ @@ -724,7 +724,7 @@ def create_dc_terminal( Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder", "project name", "release version") >>> edb.siwave.create_dc_terminal("U2A5", "V1P5_S3", "source_name") """ @@ -876,7 +876,7 @@ def add_siwave_dc_analysis(self, name=None): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb("pathtoaedb", edbversion="2021.2") >>> edb.siwave.add_siwave_ac_analysis() >>> edb.siwave.add_siwave_dc_analysis2("my_setup") diff --git a/src/pyedb/legacy/edb_core/stackup.py b/src/pyedb/legacy/edb_core/stackup.py index ce0d3e44d4..f7673f30e9 100644 --- a/src/pyedb/legacy/edb_core/stackup.py +++ b/src/pyedb/legacy/edb_core/stackup.py @@ -748,7 +748,7 @@ def export(self, fpath, file_format="xml", include_material_with_layer=False): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.export("stackup.xml") """ @@ -788,7 +788,7 @@ def export_stackup(self, fpath, file_format="xml", include_material_with_layer=F Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.export_stackup("stackup.xml") """ @@ -2129,7 +2129,7 @@ def load(self, file_path): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.load("stackup.xml") """ @@ -2163,7 +2163,7 @@ def import_stackup(self, file_path): Examples -------- - >>> from legacy import Edb + >>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.import_stackup("stackup.xml") """ From 1861c3b6a250740b2241a2f0b45130633489c232 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 16:15:09 +0100 Subject: [PATCH 16/19] DOC: remoe pyaedt related content --- doc/source/Getting_started/versioning.rst | 69 +---------------------- 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/doc/source/Getting_started/versioning.rst b/doc/source/Getting_started/versioning.rst index 2e43d02d6f..b3ac254530 100644 --- a/doc/source/Getting_started/versioning.rst +++ b/doc/source/Getting_started/versioning.rst @@ -8,71 +8,4 @@ The PyEDB project attempts to maintain compatibility with legacy versions of EDB while allowing for support of faster and better interfaces with the latest versions of EDB. -There are two interfaces PyEDB can use to connect to EDB. -You can see a table with the AEDT version and the supported interfaces -in `Table of supported versions `_ - - -gRPC interface -============== - -This is the default and preferred interface to connect to AEDT. -Ansys 2024 R2 and later support the latest gRPC interface, allowing -for remote management of MAPDL with rapid streaming of mesh, results, -and files from the MAPDL service. - - -Legacy interfaces -================= - -Microsoft development framework interface ------------------------------------------ - -PyEDB supports the legacy .NET interface, enabled with the settings option. - -This interface works both on Windows and Linux. - - -.. code:: python - - - from pyaedt import settings - - settings.use_grpc_api = False - - - -Compatibility between AEDT and interfaces -========================================= - -The following table shows the supported versions of Ansys EDT and the recommended interface for each one of them in PyAEDT. - - -**Table of supported versions** - -.. _table_versions: - -+---------------------------+------------------------+-----------------------------------------------+ -| Ansys Version | Recommended interface | Support | -| | +-----------------------+-----------------------+ -| | | gRPC | .NET | -+===========================+========================+=======================+=======================+ -| AnsysEM 2024 R1 | gRPC | YES | YES* | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R2 | .NET | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2023 R1 | .NET | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R2 | .NET | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2022 R1 | .NET | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ -| AnsysEM 2021 R2 | .NET | NO | YES | -+---------------------------+------------------------+-----------------------+-----------------------+ - -Where: - -* YES means that the interface is supported and recommended. -* YES* means that the interface is supported, but not recommended. Their support might be dropped in the future. -* NO means that the interface is not supported. -* NO* means that the interface is still supported but it is deprecated. +Currently, there is only one interface PyEDB can use to connect to EDB. From 695866738e0fc93391fe1e1ffa83ea9218365bb1 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Fri, 1 Dec 2023 16:45:46 +0100 Subject: [PATCH 17/19] MISC: remove pyaedt typos --- doc/source/EDBAPI/index.rst | 4 +-- doc/source/Getting_started/Contributing.rst | 2 +- doc/source/Getting_started/Quickcode.rst | 2 +- .../Getting_started/Troubleshooting.rst | 5 ++-- doc/source/conf.py | 28 ++++++------------- doc/source/index.rst | 2 +- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/doc/source/EDBAPI/index.rst b/doc/source/EDBAPI/index.rst index 7352ef00ba..15a85bdbf9 100644 --- a/doc/source/EDBAPI/index.rst +++ b/doc/source/EDBAPI/index.rst @@ -2,7 +2,7 @@ EDB API ======= -This section describes PyAEDT EDB classes, methods, and functions +This section describes EDB classes, methods, and functions for EDB apps and modules. Use the search feature or click links to view API documentation. @@ -22,7 +22,7 @@ Example: .. code:: python - from pyaedt import Edb + from pyedb import Edb edb = Edb("my_project.aedb", edbversion="2023.1") edb.core_components.components["R1"].r_value = 40 diff --git a/doc/source/Getting_started/Contributing.rst b/doc/source/Getting_started/Contributing.rst index 1e4841f81d..0e37a50f09 100644 --- a/doc/source/Getting_started/Contributing.rst +++ b/doc/source/Getting_started/Contributing.rst @@ -26,7 +26,7 @@ development mode, run: Post issues ----------- -Use the `PyAEDT Issues `_ +Use the `PyEDB Issues `_ page to submit questions, report bugs, and request new features. To reach the product support team, email `pyansys.core@ansys.com `_. diff --git a/doc/source/Getting_started/Quickcode.rst b/doc/source/Getting_started/Quickcode.rst index c85c445bbd..a97fb4efe1 100644 --- a/doc/source/Getting_started/Quickcode.rst +++ b/doc/source/Getting_started/Quickcode.rst @@ -16,7 +16,7 @@ providing syntax rules and commands for using the PyEDB API and PyEDB API: - `View PyEDB cheat sheet `_ or `download PyEDB cheat sheet `_ the - PyAEDT API cheat sheet. + PyEDB API cheat sheet. On the `PyEDB Issues `_ page, you can diff --git a/doc/source/Getting_started/Troubleshooting.rst b/doc/source/Getting_started/Troubleshooting.rst index 47c695beda..52d858f971 100644 --- a/doc/source/Getting_started/Troubleshooting.rst +++ b/doc/source/Getting_started/Troubleshooting.rst @@ -38,9 +38,9 @@ Error installing PyEDB using pip If downloads from `pypi `_ are not allowed, you may use a `wheelhouse `_. -The wheelhouse file contains all dependencies for PyAEDT and allows full installation without a need to +The wheelhouse file contains all dependencies for PyEDB and allows full installation without a need to download additional files. -The wheelhouse for PyAEDT can be found `here `_. +The wheelhouse for PyEDB can be found `here `_. After downloading the wheelhouse for your distribution and Python release, unzip the file to a folder and run the Python command: @@ -65,5 +65,4 @@ Starting from 2024R1 the EDB-core API has replaced the .NET interface with a gRP - > 2024 R1 * - Only ``Python.NET`` - | ``Python.NET``: *Default* - | Enable gRPC: ``pyaedt.settings.use_grpc_api = True`` - | gRPC: *Default* \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index d5df216cec..2ba1fe0c90 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -92,7 +92,7 @@ def setup(app): sys.path.append(os.path.join(root_path)) from pyedb import __version__ -project = "PyAEDT" +project = "PyEDB" copyright = f"(c) {datetime.datetime.now().year} ANSYS, Inc. All rights reserved" author = "Ansys Inc." cname = os.getenv("DOCUMENTATION_CNAME", "nocname.com") @@ -107,13 +107,10 @@ def setup(app): release = version = __version__ -os.environ["PYAEDT_NON_GRAPHICAL"] = "1" -os.environ["PYAEDT_DOC_GENERATION"] = "1" - # -- General configuration --------------------------------------------------- -# Add any Sphinx_PyAEDT extension module names here as strings. They can be -# extensions coming with Sphinx_PyAEDT (named 'sphinx.ext.*') or your custom +# Add any Sphinx_PyEDB extension module names here as strings. They can be +# extensions coming with Sphinx_PyEDB (named 'sphinx.ext.*') or your custom # ones. extensions = [ "sphinx.ext.intersphinx", @@ -174,28 +171,22 @@ def setup(app): # separating the parameter name and type", } -numpydoc_validation_exclude = { # set of regex - r"\.AEDTMessageManager.add_message$", # bad SS05 - r"\.Modeler3D\.create_choke$", # bad RT05 - r"HistoryProps.", # bad RT05 because of the base class named OrderedDict -} - # Favicon html_favicon = ansys_favicon # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] -# disable generating the sphinx nested documentation -if "PYAEDT_CI_NO_AUTODOC" in os.environ: - templates_path.clear() +# # disable generating the sphinx nested documentation +# if "PYEDB_CI_NO_AUTODOC" in os.environ: +# templates_path.clear() # Copy button customization --------------------------------------------------- # exclude traditional Python prompts from the copied code copybutton_prompt_text = r">>> ?|\.\.\. " copybutton_prompt_is_regexp = True -# The language for content autogenerated by Sphinx_PyAEDT. Refer to documentation +# The language for content autogenerated by Sphinx_PyEDB. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. @@ -245,8 +236,8 @@ def setup(app): if not os.path.exists(pyvista.FIGURE_PATH): os.makedirs(pyvista.FIGURE_PATH) -# gallery build requires AEDT install -if os.name != "posix" and "PYAEDT_CI_NO_EXAMPLES" not in os.environ: +# gallery build requires EDB install +if os.name != "posix" and "PYEDB_CI_NO_EXAMPLES" not in os.environ: # suppress annoying matplotlib bug warnings.filterwarnings( "ignore", @@ -340,7 +331,6 @@ def setup(app): "use_meilisearch": { "api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""), "index_uids": { - f"legacy-v{get_version_match(__version__).replace('.', '-')}": "PyAEDT", f"legacy-v{get_version_match(__version__).replace('.', '-')}": "EDB API", }, }, diff --git a/doc/source/index.rst b/doc/source/index.rst index 3dc9662d91..0b71fac45b 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -90,7 +90,7 @@ PyEDB is a Python library that interacts directly with the EDB-core API to make Contribute ^^^^^^^^^^ - Learn how to contribute to the PyAEDT codebase + Learn how to contribute to the pyEDB codebase or documentation. +++ From bf40361969f3a7526f911b32a7c24a2327fa548e Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 4 Dec 2023 11:57:30 +0100 Subject: [PATCH 18/19] DOC: fix sphinx warnings --- doc/source/Getting_started/Installation.rst | 2 +- doc/source/Getting_started/index.rst | 2 +- .../build_ac_project.rst | 2 +- .../get_layout_bounding_box.rst | 2 -- src/pyedb/generic/plot.py | 1 + src/pyedb/generic/process.py | 1 + src/pyedb/legacy/application/Variables.py | 1 + src/pyedb/legacy/edb.py | 18 ++++++----- src/pyedb/legacy/edb_core/components.py | 1 + src/pyedb/legacy/edb_core/dotnet/database.py | 3 ++ .../edb_core/edb_data/components_data.py | 3 ++ .../legacy/edb_core/edb_data/control_file.py | 1 + .../legacy/edb_core/edb_data/layer_data.py | 1 + .../legacy/edb_core/edb_data/nets_data.py | 1 + .../edb_core/edb_data/padstacks_data.py | 6 ++-- .../edb_core/edb_data/primitives_data.py | 6 ++++ .../edb_core/edb_data/simulation_setup.py | 31 +++++++++++++++++-- .../edb_data/siwave_simulation_setup_data.py | 12 +++++-- src/pyedb/legacy/edb_core/edb_data/sources.py | 2 ++ .../legacy/edb_core/edb_data/terminals.py | 5 +++ src/pyedb/legacy/edb_core/hfss.py | 6 +++- .../legacy/edb_core/layout_validation.py | 1 + src/pyedb/legacy/edb_core/materials.py | 2 ++ src/pyedb/legacy/edb_core/nets.py | 10 +++--- src/pyedb/legacy/edb_core/padstack.py | 4 +++ src/pyedb/legacy/edb_core/siwave.py | 1 + src/pyedb/legacy/edb_core/stackup.py | 8 +++++ 27 files changed, 109 insertions(+), 24 deletions(-) diff --git a/doc/source/Getting_started/Installation.rst b/doc/source/Getting_started/Installation.rst index 897fed7bb4..4843a2fc92 100644 --- a/doc/source/Getting_started/Installation.rst +++ b/doc/source/Getting_started/Installation.rst @@ -50,7 +50,7 @@ Install offline from a wheelhouse ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using a wheelhouse can be helpful if you work for a company that restricts access to external networks. Wheelhouses for CPython 3.7, 3.8, and 3.9 are available in the releases for PyEDB v1.0 -and later for both Windows and Linux. From the `Releases `_ +and later for both Windows and Linux. From the `Releases `_ page in the PyEDB repository, you can find the wheelhouses for a particular release in its assets and download the wheelhouse specific to your setup. diff --git a/doc/source/Getting_started/index.rst b/doc/source/Getting_started/index.rst index 3c9a3fad86..1cf92dd67a 100644 --- a/doc/source/Getting_started/index.rst +++ b/doc/source/Getting_started/index.rst @@ -64,7 +64,7 @@ Desktop (AEDT) installed. :alt: AEDT Applications :target: https://www.ansys.com/products/electronics -For more information, see `Ansys Electronics `_ +For more information, see `Ansys Electronics `_ on the Ansys website. diff --git a/doc/source/User_guide/Build_simulation_project/build_ac_project.rst b/doc/source/User_guide/Build_simulation_project/build_ac_project.rst index 1aae35ba9a..52d5e071a5 100644 --- a/doc/source/User_guide/Build_simulation_project/build_ac_project.rst +++ b/doc/source/User_guide/Build_simulation_project/build_ac_project.rst @@ -1,5 +1,5 @@ Create SYZ project (SimulationConfiguration) -=========================================== +============================================ This section describes how to create SYZ simulation setup for Siwave using SimulationConfiguration class. .. autosummary:: diff --git a/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst b/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst index 59063accf4..bf53a4dc00 100644 --- a/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst +++ b/doc/source/User_guide/Edb_information_queries/get_layout_bounding_box.rst @@ -7,8 +7,6 @@ This section describes how to retrieve the layout size by getting the bounding b .. code:: python - - from pyedb.legacy.edb import EdbLegacy from pyedb.generic.general_methods import generate_unique_folder_name import pyedb.misc.downloads as downloads diff --git a/src/pyedb/generic/plot.py b/src/pyedb/generic/plot.py index daa59ad0fb..a7dd9eb937 100644 --- a/src/pyedb/generic/plot.py +++ b/src/pyedb/generic/plot.py @@ -1240,6 +1240,7 @@ def add_frames_from_file( Delauny tolerance value used for interpolating points. header_lines : int Number of lines to of the file containing header info that has to be removed. + Returns ------- bool diff --git a/src/pyedb/generic/process.py b/src/pyedb/generic/process.py index 4bd06edb24..147017c63b 100644 --- a/src/pyedb/generic/process.py +++ b/src/pyedb/generic/process.py @@ -198,6 +198,7 @@ def export_dc_report( Either if generate or not power tree image. Default is `True`. loop_res : bool, optional Either if generate or not loop resistance report. Default is `True`. + Returns ------- list diff --git a/src/pyedb/legacy/application/Variables.py b/src/pyedb/legacy/application/Variables.py index cad746e7ba..edd3507861 100644 --- a/src/pyedb/legacy/application/Variables.py +++ b/src/pyedb/legacy/application/Variables.py @@ -970,6 +970,7 @@ def set_variable( circuit_parameter : bool, optional Whether to define a parameter in a circuit design or a local parameter. The default is ``True``, in which case a circuit variable is created as a parameter default. + Returns ------- bool diff --git a/src/pyedb/legacy/edb.py b/src/pyedb/legacy/edb.py index 7acbe62dec..0cdfb3edd0 100644 --- a/src/pyedb/legacy/edb.py +++ b/src/pyedb/legacy/edb.py @@ -307,6 +307,7 @@ def _init_objects(self): @property def cell_names(self): """Cell name container. + Returns ------- list of cell names : List[str] @@ -928,6 +929,10 @@ def hfss(self): ------- :class:`pyedb.legacy.edb_core.hfss.EdbHfss` + See Also + -------- + :class:`legacy.edb_core.edb_data.simulation_configuration.SimulationConfiguration` + Examples -------- >>> from pyedb.legacy.edb import EdbLegacy @@ -935,11 +940,6 @@ def hfss(self): >>> sim_config = edbapp.new_simulation_configuration() >>> sim_config.mesh_freq = "10Ghz" >>> edbapp.hfss.configure_hfss_analysis_setup(sim_config) - - See Also - -------- - :class:`legacy.edb_core.edb_data.simulation_configuration.SimulationConfiguration` - """ if not self._hfss and self.active_db: self._hfss = EdbHfss(self) @@ -3886,8 +3886,8 @@ def create_port(self, terminal, ref_terminal=None, is_circuit_port=False): Returns ------- - [:class:`pyedb.legacy.edb_core.edb_data.ports.GapPort`, - :class:`pyedb.legacy.edb_core.edb_data.ports.WavePort`,] + list: [:class:`pyedb.legacy.edb_core.edb_data.ports.GapPort`, + :class:`pyedb.legacy.edb_core.edb_data.ports.WavePort`,]. """ terminal.boundary_type = "PortBoundary" @@ -3932,6 +3932,7 @@ def create_voltage_probe(self, terminal, ref_terminal): @pyedb_function_handler def create_voltage_source(self, terminal, ref_terminal): """Create a voltage source. + Parameters ---------- terminal : :class:`pyedb.legacy.edb_core.edb_data.terminals.EdgeTerminal`, @@ -3944,6 +3945,7 @@ def create_voltage_source(self, terminal, ref_terminal): :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal`, :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal`, Negative terminal of the source. + Returns ------- class:`legacy.edb_core.edb_data.ports.ExcitationSources` @@ -3990,6 +3992,7 @@ def create_current_source(self, terminal, ref_terminal): @pyedb_function_handler def get_point_terminal(self, name, net_name, location, layer): """Place a voltage probe between two points. + Parameters ---------- name : str, @@ -4000,6 +4003,7 @@ def get_point_terminal(self, name, net_name, location, layer): Location of the terminal. layer : str, Layer of the terminal. + Returns ------- :class:`legacy.edb_core.edb_data.terminals.PointTerminal` diff --git a/src/pyedb/legacy/edb_core/components.py b/src/pyedb/legacy/edb_core/components.py index 629dce467e..64fc3d5f10 100644 --- a/src/pyedb/legacy/edb_core/components.py +++ b/src/pyedb/legacy/edb_core/components.py @@ -240,6 +240,7 @@ def export_definition(self, file_path): ---------- file_path : str File path of json file. + Returns ------- diff --git a/src/pyedb/legacy/edb_core/dotnet/database.py b/src/pyedb/legacy/edb_core/dotnet/database.py index 2547ee52f2..b6a490a335 100644 --- a/src/pyedb/legacy/edb_core/dotnet/database.py +++ b/src/pyedb/legacy/edb_core/dotnet/database.py @@ -84,6 +84,7 @@ def arcs(self): # pragma: no cover def get_points(self): """Get all points in polygon. + Returns ------- list[list[edb_value]] @@ -93,6 +94,7 @@ def get_points(self): def add_point(self, x, y, incremental=False): """Add a point at the end of the point list of the polygon. + Parameters ---------- x: str, int, float @@ -102,6 +104,7 @@ def add_point(self, x, y, incremental=False): incremental: bool Whether to add the point incrementally. The default value is ``False``. When ``True``, the coordinates of the added point are incremental to the last point. + Returns ------- bool diff --git a/src/pyedb/legacy/edb_core/edb_data/components_data.py b/src/pyedb/legacy/edb_core/edb_data/components_data.py index fa65af6f27..067b032415 100644 --- a/src/pyedb/legacy/edb_core/edb_data/components_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/components_data.py @@ -114,6 +114,7 @@ def assign_s_param_model(self, file_path, model_name=None, reference_net=None): File path of the S-parameter model. name : str, optional Name of the S-parameter model. + Returns ------- @@ -132,6 +133,7 @@ def assign_spice_model(self, file_path, model_name=None): File path of the Spice model. name : str, optional Name of the Spice model. + Returns ------- @@ -963,6 +965,7 @@ def create_clearance_on_component(self, extra_soldermask_clearance=1e-4): ---------- extra_soldermask_clearance : float, optional Extra Soldermask value in meter to be applied on component bounding box. + Returns ------- bool diff --git a/src/pyedb/legacy/edb_core/edb_data/control_file.py b/src/pyedb/legacy/edb_core/edb_data/control_file.py index 84e04f9438..af1c81b820 100644 --- a/src/pyedb/legacy/edb_core/edb_data/control_file.py +++ b/src/pyedb/legacy/edb_core/edb_data/control_file.py @@ -1241,6 +1241,7 @@ def write_xml(self, xml_output): ---------- xml_output : str Path to the output xml file. + Returns ------- bool diff --git a/src/pyedb/legacy/edb_core/edb_data/layer_data.py b/src/pyedb/legacy/edb_core/edb_data/layer_data.py index 7a4e16c1ec..7c1919221d 100644 --- a/src/pyedb/legacy/edb_core/edb_data/layer_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/layer_data.py @@ -460,6 +460,7 @@ def assign_roughness_model( apply_on_surface : str, optional. Where to assign roughness model. The default is ``"all"``. Options are ``"top"``, ``"bottom"``, ``"side"``. + Returns ------- diff --git a/src/pyedb/legacy/edb_core/edb_data/nets_data.py b/src/pyedb/legacy/edb_core/edb_data/nets_data.py index 42e8e129a7..a5973bfaba 100644 --- a/src/pyedb/legacy/edb_core/edb_data/nets_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/nets_data.py @@ -85,6 +85,7 @@ def find_dc_short(self, fix=False): fix : bool, optional If `True`, rename all the nets. (default) If `False`, only report dc shorts. + Returns ------- List[List[str, str]] diff --git a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py index 2b48531244..78abc81027 100644 --- a/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/padstacks_data.py @@ -999,13 +999,15 @@ def __init__(self, edb_padstackinstance, _pedb): self._pdef = None def get_terminal(self, name=None, create_new_terminal=False): - """Return PadstackInstanceTerminal object. + """Get PadstackInstanceTerminal object. + Parameters ---------- name : str, optional Name of the terminal. Only applicable when create_new_terminal is True. create_new_terminal : bool, optional Whether to create a new terminal. + Returns ------- :class:`pyedb.legacy.edb_core.edb_data.terminals` @@ -1454,7 +1456,7 @@ def position(self): Returns ------- list - List of ``[x, y]``` coordinates for the padstack instance position. + List of ``[x, y]`` coordinates for the padstack instance position. """ self._position = [] out = self._edb_padstackinstance.GetPositionAndRotationValue() diff --git a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py index cc5b04593a..8544d3e584 100644 --- a/src/pyedb/legacy/edb_core/edb_data/primitives_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/primitives_data.py @@ -199,6 +199,7 @@ def area(self, include_voids=True): include_voids : bool, optional Either if the voids have to be included in computation. The default value is ``True``. + Returns ------- float @@ -737,6 +738,7 @@ def length(self): @pyedb_function_handler() def add_point(self, x, y, incremental=False): """Add a point at the end of the path. + Parameters ---------- x: str, int, float @@ -746,6 +748,7 @@ def add_point(self, x, y, incremental=False): incremental: bool Add point incrementally. If True, coordinates of the added point is incremental to the last point. The default value is ``False``. + Returns ------- bool @@ -762,6 +765,7 @@ def get_center_line(self, to_string=False): ---------- to_string : bool, optional Type of return. The default is ``"False"``. + Returns ------- list @@ -855,6 +859,7 @@ def create_edge_port( @pyedb_function_handler() def create_via_fence(self, distance, gap, padstack_name): """Create via fences on both sides of the trace. + Parameters ---------- distance: str, float @@ -863,6 +868,7 @@ def create_via_fence(self, distance, gap, padstack_name): Gap between vias. padstack_name: str Name of the via padstack. + Returns ------- """ diff --git a/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py b/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py index c11aff8c03..88a1664edc 100644 --- a/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py +++ b/src/pyedb/legacy/edb_core/edb_data/simulation_setup.py @@ -147,6 +147,7 @@ def frequency_sweeps(self): @pyedb_function_handler def _add_frequency_sweep(self, sweep_data): """Add a frequency sweep. + Parameters ---------- sweep_data: EdbFrequencySweep @@ -164,9 +165,10 @@ def _add_frequency_sweep(self, sweep_data): @pyedb_function_handler def delete_frequency_sweep(self, sweep_data): """Delete a frequency sweep. + Parameters ---------- - sweep_data : EdbFrequencySweep + sweep_data : EdbFrequencySweep. """ name = sweep_data.name if name in self._sweep_list: @@ -286,6 +288,7 @@ def frequencies(self): @property def adaptive_sampling(self): """Flag indicating if adaptive sampling is turned on. + Returns ------- bool @@ -296,6 +299,7 @@ def adaptive_sampling(self): @property def adv_dc_extrapolation(self): """Flag indicating if advanced DC extrapolation is turned on. + Returns ------- bool @@ -321,6 +325,7 @@ def auto_s_mat_only_solve(self): @property def enforce_causality(self): """Flag indicating if causality is enforced. + Returns ------- bool @@ -331,6 +336,7 @@ def enforce_causality(self): @property def enforce_dc_and_causality(self): """Flag indicating if DC point and causality are enforced. + Returns ------- bool @@ -341,6 +347,7 @@ def enforce_dc_and_causality(self): @property def enforce_passivity(self): """Flag indicating if passivity is enforced. + Returns ------- bool @@ -350,10 +357,13 @@ def enforce_passivity(self): @property def freq_sweep_type(self): - """Sweep type. Options are. + """Sweep type. + + Options are: - ``"kInterpolatingSweep"`` - ``"kDiscreteSweep"`` - ``"kBroadbandFastSweep"`` + Returns ------- str @@ -364,6 +374,7 @@ def freq_sweep_type(self): @property def interpolation_use_full_basis(self): """Flag indicating if full-basis elements is used. + Returns ------- bool @@ -374,6 +385,7 @@ def interpolation_use_full_basis(self): @property def interpolation_use_port_impedance(self): """Flag indicating if port impedance interpolation is turned on. + Returns ------- bool @@ -384,6 +396,7 @@ def interpolation_use_port_impedance(self): @property def interpolation_use_prop_const(self): """Flag indicating if propagation constants are used. + Returns ------- bool @@ -394,6 +407,7 @@ def interpolation_use_prop_const(self): @property def interpolation_use_s_matrix(self): """Flag indicating if the S matrix is used. + Returns ------- bool @@ -404,6 +418,7 @@ def interpolation_use_s_matrix(self): @property def max_solutions(self): """Number of maximum solutions. + Returns ------- int @@ -413,6 +428,7 @@ def max_solutions(self): @property def min_freq_s_mat_only_solve(self): """Minimum frequency SMatrix only solve. + Returns ------- str @@ -434,6 +450,7 @@ def min_solved_freq(self): @property def passivity_tolerance(self): """Tolerance for passivity enforcement. + Returns ------- float @@ -453,6 +470,7 @@ def relative_s_error(self): @property def save_fields(self): """Flag indicating if the extraction of surface current data is turned on. + Returns ------- bool @@ -463,6 +481,7 @@ def save_fields(self): @property def save_rad_fields_only(self): """Flag indicating if the saving of only radiated fields is turned on. + Returns ------- bool @@ -473,6 +492,7 @@ def save_rad_fields_only(self): @property def use_q3d_for_dc(self): """Flag indicating if the Q3D solver is used for DC point extraction. + Returns ------- bool @@ -591,6 +611,7 @@ def _set_frequencies(self, freq_sweep_string="Linear Step: 0GHz to 20GHz, step=0 @pyedb_function_handler() def set_frequencies_linear_scale(self, start="0.1GHz", stop="20GHz", step="50MHz"): """Set a linear scale frequency sweep. + Parameters ---------- start : str, float, optional @@ -599,6 +620,7 @@ def set_frequencies_linear_scale(self, start="0.1GHz", stop="20GHz", step="50MHz Stop frequency. The default is ``"20GHz"``. step : str, float, optional Step frequency. The default is ``"50MHz"``. + Returns ------- bool @@ -610,6 +632,7 @@ def set_frequencies_linear_scale(self, start="0.1GHz", stop="20GHz", step="50MHz @pyedb_function_handler() def set_frequencies_linear_count(self, start="1kHz", stop="0.1GHz", count=10): """Set a linear count frequency sweep. + Parameters ---------- start : str, float, optional @@ -618,6 +641,7 @@ def set_frequencies_linear_count(self, start="1kHz", stop="0.1GHz", count=10): Stop frequency. The default is ``"0.1GHz"``. count : int, optional Step frequency. The default is ``10``. + Returns ------- bool @@ -631,6 +655,7 @@ def set_frequencies_linear_count(self, start="1kHz", stop="0.1GHz", count=10): @pyedb_function_handler() def set_frequencies_log_scale(self, start="1kHz", stop="0.1GHz", samples=10): """Set a log-count frequency sweep. + Parameters ---------- start : str, float, optional @@ -639,6 +664,7 @@ def set_frequencies_log_scale(self, start="1kHz", stop="0.1GHz", samples=10): Stop frequency. The default is ``"0.1GHz"``. samples : int, optional Step frequency. The default is ``10``. + Returns ------- bool @@ -652,6 +678,7 @@ def set_frequencies_log_scale(self, start="1kHz", stop="0.1GHz", samples=10): @pyedb_function_handler() def set_frequencies(self, frequency_list=None, update=True): """Set frequency list to the sweep frequencies. + Parameters ---------- frequency_list : list, optional diff --git a/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py b/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py index 6fe5a2aed5..151105a5e8 100644 --- a/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py +++ b/src/pyedb/legacy/edb_core/edb_data/siwave_simulation_setup_data.py @@ -45,6 +45,7 @@ def sim_setup_info(self): @pyedb_function_handler def get_configurations(self): """Get all attributes. + Returns ------- dict @@ -520,6 +521,7 @@ def __init__(self, parent): @property def compute_inductance(self): """Whether to compute Inductance. + Returns ------- bool @@ -538,6 +540,7 @@ def compute_inductance(self, value): @property def contact_radius(self): """Circuit element contact radius. + Returns ------- str @@ -572,6 +575,7 @@ def dc_slider_position(self, value): def use_dc_custom_settings(self): """Whether to use DC custom settings. This setting is automatically enabled by other properties when needed. + Returns ------- bool @@ -589,6 +593,7 @@ def use_dc_custom_settings(self, value): @property def plot_jv(self): """Plot current and voltage distributions. + Returns ------- bool @@ -1010,10 +1015,11 @@ def set_pi_slider(self, value): @pyedb_function_handler def set_si_slider(self, value): """Set SIwave SI simulation accuracy level. + Options are: - - ``0``: Optimal speed - - ``1``: Balanced - - ``2``: Optimal accuracy``` + - ``0``: Optimal speed; + - ``1``: Balanced; + - ``2``: Optimal accuracy```. """ self.use_si_settings = True self.use_custom_settings = False diff --git a/src/pyedb/legacy/edb_core/edb_data/sources.py b/src/pyedb/legacy/edb_core/edb_data/sources.py index 149b1085df..d3d5f13407 100644 --- a/src/pyedb/legacy/edb_core/edb_data/sources.py +++ b/src/pyedb/legacy/edb_core/edb_data/sources.py @@ -289,11 +289,13 @@ def get_terminal(self, name=None, create_new_terminal=False): @pyedb_function_handler() def _create_terminal(self, name=None): """Create a terminal on the pin group. + Parameters ---------- name : str, optional Name of the terminal. The default is ``None``, in which case a name is automatically assigned. + Returns ------- :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal` diff --git a/src/pyedb/legacy/edb_core/edb_data/terminals.py b/src/pyedb/legacy/edb_core/edb_data/terminals.py index 222ae172cc..ba7f578d19 100644 --- a/src/pyedb/legacy/edb_core/edb_data/terminals.py +++ b/src/pyedb/legacy/edb_core/edb_data/terminals.py @@ -490,6 +490,7 @@ def create(self, padstack_instance, name=None, layer=None, is_ref=False): default name is assigned. is_ref : bool, optional Whether it is a reference terminal. The default is ``False``. + Returns ------- Edb.Cell.Terminal.EdgeTerminal @@ -527,6 +528,7 @@ def __init__(self, pedb, edb_object=None): @pyedb_function_handler def create(self, name, net, location, layer, is_ref=False): """Create a point terminal. + Parameters ---------- name : str @@ -539,6 +541,7 @@ def create(self, name, net, location, layer, is_ref=False): Name of the layer. is_ref : bool, optional Whether it is a reference terminal. + Returns ------- :class:`pyedb.legacy.edb_core.edb_data.terminals.PointTerminal` @@ -590,6 +593,7 @@ def __init__(self, pedb, edb_object=None): @pyedb_function_handler def create(self, name, net_name, pin_group_name, is_ref=False): """Create a pin group terminal. + Parameters ---------- name : str @@ -600,6 +604,7 @@ def create(self, name, net_name, pin_group_name, is_ref=False): Name of the pin group. is_ref : bool, optional Whether it is a reference terminal. The default is ``False``. + Returns ------- :class:`pyedb.legacy.edb_core.edb_data.terminals.PinGroupTerminal` diff --git a/src/pyedb/legacy/edb_core/hfss.py b/src/pyedb/legacy/edb_core/hfss.py index b5521aaee5..45cc17a76f 100644 --- a/src/pyedb/legacy/edb_core/hfss.py +++ b/src/pyedb/legacy/edb_core/hfss.py @@ -105,6 +105,7 @@ def _create_edge_terminal(self, prim_id, point_on_edge, terminal_name=None, is_r default name is assigned. is_ref : bool, optional Whether it is a reference terminal. The default is ``False``. + Returns ------- Edb.Cell.Terminal.EdgeTerminal @@ -844,6 +845,7 @@ def create_edge_port_vertical( Radial extent factor. The default value is ``0``. pec_launch_width : str, optional Launch Width of PEC. The default value is ``"0.01mm"``. + Returns ------- str @@ -910,6 +912,7 @@ def create_edge_port_horizontal( Impedance of the port. The default value is ``50``. layer_alignment : str, optional Layer alignment. The default value is ``Upper``. Options are ``"Upper"``, ``"Lower"``. + Returns ------- str @@ -1157,10 +1160,11 @@ def get_layout_bounding_box(self, layout=None, digit_resolution=6): digit_resolution : int, optional Digit Resolution. The default value is ``6``. + Returns ------- list - [lower left corner X, lower left corner, upper right corner X, upper right corner Y] + [lower left corner X, lower left corner, upper right corner X, upper right corner Y]. """ if layout == None: return False diff --git a/src/pyedb/legacy/edb_core/layout_validation.py b/src/pyedb/legacy/edb_core/layout_validation.py index 282befbd1f..2695ccfca2 100644 --- a/src/pyedb/legacy/edb_core/layout_validation.py +++ b/src/pyedb/legacy/edb_core/layout_validation.py @@ -121,6 +121,7 @@ def disjoint_nets( Default is ``False``. keep_disjoint_pins : bool, optional Whether if delete disjoints pins not connected to any other primitive or not. Default is ``False``. + Returns ------- List diff --git a/src/pyedb/legacy/edb_core/materials.py b/src/pyedb/legacy/edb_core/materials.py index 29b46ed644..c6e002b0cb 100644 --- a/src/pyedb/legacy/edb_core/materials.py +++ b/src/pyedb/legacy/edb_core/materials.py @@ -854,10 +854,12 @@ def load_amat(self, amat_file): @pyedb_function_handler() def read_materials(amat_file): """Read materials from an AMAT file. + Parameters ---------- amat_file : str Full path to the AMAT file to read. + Returns ------- dict diff --git a/src/pyedb/legacy/edb_core/nets.py b/src/pyedb/legacy/edb_core/nets.py index e5cf5b5b6b..71b1ea63ce 100644 --- a/src/pyedb/legacy/edb_core/nets.py +++ b/src/pyedb/legacy/edb_core/nets.py @@ -266,6 +266,7 @@ def generate_extended_nets( Whether to generate extended signal nets. The default is ``True``. include_power : str, optional Whether to generate extended power nets. The default is ``True``. + Returns ------- list @@ -478,12 +479,12 @@ def get_plot_data( If ``True`` the components placed on bottom layer are plotted. If ``False`` the components are not plotted. (default) If nets and/or layers is specified, only the components belonging to the specified nets/layers are plotted. + Returns ------- - list, str - list of data to be used in plot. - In case of remote session it will be returned a string that could be converted to list - using ast.literal_eval(). + List, str: list of data to be used in plot. + In case of remote session it will be returned a string that could be converted \ + to list using ast.literal_eval(). """ start_time = time.time() if not nets: @@ -1179,6 +1180,7 @@ def find_and_fix_disjoint_nets( order_by_area : bool, optional Whether if the naming order has to be by number of objects (fastest) or area (slowest but more accurate). Default is ``False``. + Returns ------- List diff --git a/src/pyedb/legacy/edb_core/padstack.py b/src/pyedb/legacy/edb_core/padstack.py index 4691793299..2ff2dde567 100644 --- a/src/pyedb/legacy/edb_core/padstack.py +++ b/src/pyedb/legacy/edb_core/padstack.py @@ -782,6 +782,7 @@ def create_padstack( rotation of antipad. The default is ``"0.0"``. has_hole : bool, optional Whether this padstack has a hole. + Returns ------- str @@ -996,6 +997,7 @@ def duplicate_padstack(self, target_padstack_name, new_padstack_name=""): Name of the padstack to be duplicated. new_padstack_name : str, optional Name of the new padstack. + Returns ------- str @@ -1014,6 +1016,7 @@ def duplicate(self, target_padstack_name, new_padstack_name=""): Name of the padstack to be duplicated. new_padstack_name : str, optional Name of the new padstack. + Returns ------- str @@ -1315,6 +1318,7 @@ def get_padstack_instance_by_net_name(self, net_name): ---------- net_name : str The net name to be used for filtering padstack instances. + Returns ------- list diff --git a/src/pyedb/legacy/edb_core/siwave.py b/src/pyedb/legacy/edb_core/siwave.py index 3b23a3ec9e..e472e7d0e4 100644 --- a/src/pyedb/legacy/edb_core/siwave.py +++ b/src/pyedb/legacy/edb_core/siwave.py @@ -1404,6 +1404,7 @@ def place_voltage_probe( negative_layer, ): """Place a voltage probe between two points. + Parameters ---------- name : str, diff --git a/src/pyedb/legacy/edb_core/stackup.py b/src/pyedb/legacy/edb_core/stackup.py index f7673f30e9..c9b1b005e9 100644 --- a/src/pyedb/legacy/edb_core/stackup.py +++ b/src/pyedb/legacy/edb_core/stackup.py @@ -199,6 +199,7 @@ def create_symmetric_stackup( Whether to create soldermask layers. The default is``True``. soldermask_thickness : str, optional Thickness of soldermask layer. + Returns ------- bool @@ -363,6 +364,7 @@ def stackup_mode(self): .. deprecated:: 0.6.52 Use :func:`mode` method instead. + Returns ------- int, str @@ -482,6 +484,7 @@ def _set_layout_stackup(self, layer_clone, operation, base_layer=None, method=1) ``"insert_above"``, ``"add_on_top"``, ``"add_on_bottom"``, ``"non_stackup"``, ``"add_at_elevation"``. base_layer : str, optional Name of the base layer. The default value is ``None``. + Returns ------- @@ -1781,6 +1784,7 @@ def _set(self, layers=None, materials=None, roughness=None, non_stackup_layers=N Dictionary containing material information. roughness: dict Dictionary containing roughness information. + Returns ------- @@ -2003,6 +2007,7 @@ def _import_xml(self, file_path): ---------- file_path: str Path to external XML file. + Returns ------- bool @@ -2071,6 +2076,7 @@ def _export_xml(self, file_path): ---------- file_path: str Path to external XML file. + Returns ------- bool @@ -2122,6 +2128,7 @@ def load(self, file_path): ---------- file_path : str Path to stackup file. + Returns ------- bool @@ -2156,6 +2163,7 @@ def import_stackup(self, file_path): ---------- file_path : str Path to stackup file. + Returns ------- bool From 47233eba55d40d139055fa43e1bb884daf22f9b0 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 4 Dec 2023 11:58:19 +0100 Subject: [PATCH 19/19] CI: activate check on sphinx warnings --- .github/workflows/build-documentation.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-documentation.yml b/.github/workflows/build-documentation.yml index 1d76373499..aacdddf028 100644 --- a/.github/workflows/build-documentation.yml +++ b/.github/workflows/build-documentation.yml @@ -53,12 +53,10 @@ jobs: echo $'Examples\n========' > doc/source/examples/index.rst make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N" - # FIXME: uncomment this when the documentation built is working - # and ensure that there are no more sphinx warnings. - # # Verify that sphinx generates no warnings - # - name: Check for warnings - # run: | - # python doc/print_errors.py + # Verify that sphinx generates no warnings + - name: Check for warnings + run: | + python doc/print_errors.py - name: Upload Documentation uses: actions/upload-artifact@v3