From f2dab43eb296d980ae762b3118e5628db3023268 Mon Sep 17 00:00:00 2001 From: Maxime Rey <87315832+MaxJPRey@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:12:36 +0100 Subject: [PATCH] Cleanup examples (remove unused imports and fix typos) (#4038) * Fix typos. * Remove unused import from examples. * Update examples/02-SBR+/SBR_Example.py --- doc/source/conf.py | 2 +- examples/00-EDB/01_edb_example.py | 2 -- examples/00-EDB/10_GDS_workflow.py | 2 +- examples/02-SBR+/SBR_Example.py | 2 +- examples/02-SBR+/SBR_Time_Plot.py | 2 +- examples/03-Maxwell/Maxwell3DTeam7.py | 2 +- examples/04-Icepak/Icepak_ECAD_Import.py | 2 +- examples/05-Q3D/Q3D_DC_IR.py | 1 - examples/05-Q3D/Q3D_from_EDB.py | 1 - examples/07-Circuit/Circuit_Example.py | 1 - examples/07-TwinBuilder/01-RC_Circuit_Example.py | 1 - examples/07-TwinBuilder/02-Wiring_A_Rectifier.py | 1 - .../03-Dynamic_ROM_Creation_And_Visualization.py | 3 +-- 13 files changed, 7 insertions(+), 15 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index e69b01843aa..a072c1cf724 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -277,7 +277,7 @@ def setup(app): "examples_dirs": ["../../examples/"], # path where to save gallery generated examples "gallery_dirs": ["examples"], - # Patter to search for examples files + # Pattern to search for examples files "filename_pattern": r"\.py", # Remove the "Download all examples" button from the top level gallery "download_all_examples": False, diff --git a/examples/00-EDB/01_edb_example.py b/examples/00-EDB/01_edb_example.py index c2b71e1b18d..62c016f2c29 100644 --- a/examples/00-EDB/01_edb_example.py +++ b/examples/00-EDB/01_edb_example.py @@ -8,8 +8,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. -import shutil - import os import time import pyaedt diff --git a/examples/00-EDB/10_GDS_workflow.py b/examples/00-EDB/10_GDS_workflow.py index 119dd7d6437..091e289c5e7 100644 --- a/examples/00-EDB/10_GDS_workflow.py +++ b/examples/00-EDB/10_GDS_workflow.py @@ -33,7 +33,7 @@ # ~~~~~~~~~~~~ # A Control file is an xml file which purpose if to provide additional # information during import phase. It can include, materials, stackup, setup, boundaries and settings. -# In this example we will import an exising xml, integrate it with a layer mapping file of gds +# In this example we will import an existing xml, integrate it with a layer mapping file of gds # and then adding setup and boundaries. c = ControlFile(c_file_in, layer_map=c_map) diff --git a/examples/02-SBR+/SBR_Example.py b/examples/02-SBR+/SBR_Example.py index c9d979f77e8..4616973cd06 100644 --- a/examples/02-SBR+/SBR_Example.py +++ b/examples/02-SBR+/SBR_Example.py @@ -7,7 +7,7 @@ ############################################################################### # Perform required imports # ~~~~~~~~~~~~~~~~~~~~~~~~ -# Perrform rquired imports and set up the local path to the path for the PyAEDT +# Perform required imports and set up the local path to the path for the PyAEDT # directory. import os diff --git a/examples/02-SBR+/SBR_Time_Plot.py b/examples/02-SBR+/SBR_Time_Plot.py index 247e4c69a85..c227f3ee99f 100644 --- a/examples/02-SBR+/SBR_Time_Plot.py +++ b/examples/02-SBR+/SBR_Time_Plot.py @@ -8,7 +8,7 @@ ############################################################################### # Perform required imports. # ~~~~~~~~~~~~~~~~~~~~~~~~~ -# Perform requried imports. +# Perform required imports. import os from pyaedt import Hfss, downloads diff --git a/examples/03-Maxwell/Maxwell3DTeam7.py b/examples/03-Maxwell/Maxwell3DTeam7.py index f04c2031d93..8ffd1d989b6 100644 --- a/examples/03-Maxwell/Maxwell3DTeam7.py +++ b/examples/03-Maxwell/Maxwell3DTeam7.py @@ -1,7 +1,7 @@ """ Maxwell 3D: asymmetric conductor analysis ----------------------------------------- -This example uses PyAEDT to set up the TEAM 7 problem for an asymetric +This example uses PyAEDT to set up the TEAM 7 problem for an asymmetric conductor with a hole and solve it using the Maxwell 3D Eddy Current solver. """ ########################################################################################### diff --git a/examples/04-Icepak/Icepak_ECAD_Import.py b/examples/04-Icepak/Icepak_ECAD_Import.py index 714f8bf00d5..2131a6011fc 100644 --- a/examples/04-Icepak/Icepak_ECAD_Import.py +++ b/examples/04-Icepak/Icepak_ECAD_Import.py @@ -62,7 +62,7 @@ # :alt: LDF image. # # -# Imports the idf files with several filtering options incluing caps, resistors, inductors, power, size, ... +# Imports the idf files with several filtering options including caps, resistors, inductors, power, size, ... # There are also options for the PCB creation (number o flayers, copper percentages, layer sizes). # In this examples, the default values are used for the PCB. # The imported PCB here will be deleted later and replaced by a PCB that has the trace information for higher accuracy. diff --git a/examples/05-Q3D/Q3D_DC_IR.py b/examples/05-Q3D/Q3D_DC_IR.py index 91a05e5440b..976279b53c4 100644 --- a/examples/05-Q3D/Q3D_DC_IR.py +++ b/examples/05-Q3D/Q3D_DC_IR.py @@ -10,7 +10,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. import os -import tempfile import pyaedt diff --git a/examples/05-Q3D/Q3D_from_EDB.py b/examples/05-Q3D/Q3D_from_EDB.py index 1cb3fbf0e30..a104684b832 100644 --- a/examples/05-Q3D/Q3D_from_EDB.py +++ b/examples/05-Q3D/Q3D_from_EDB.py @@ -10,7 +10,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. import os -import tempfile import pyaedt diff --git a/examples/07-Circuit/Circuit_Example.py b/examples/07-Circuit/Circuit_Example.py index 500170b4a1b..673c091f8b0 100644 --- a/examples/07-Circuit/Circuit_Example.py +++ b/examples/07-Circuit/Circuit_Example.py @@ -12,7 +12,6 @@ # sphinx_gallery_thumbnail_path = 'Resources/circuit.png' import pyaedt -import os ############################################################################### # Launch AEDT diff --git a/examples/07-TwinBuilder/01-RC_Circuit_Example.py b/examples/07-TwinBuilder/01-RC_Circuit_Example.py index e568f1ec53b..42b842b459a 100644 --- a/examples/07-TwinBuilder/01-RC_Circuit_Example.py +++ b/examples/07-TwinBuilder/01-RC_Circuit_Example.py @@ -10,7 +10,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. -import os import pyaedt ############################################################################### diff --git a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py index 35af45a0691..bd7b1b45469 100644 --- a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py +++ b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py @@ -10,7 +10,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~ # Perform required imports. -import os import math import matplotlib.pyplot as plt import pyaedt diff --git a/examples/07-TwinBuilder/03-Dynamic_ROM_Creation_And_Visualization.py b/examples/07-TwinBuilder/03-Dynamic_ROM_Creation_And_Visualization.py index 5ec8d9652e3..979bae7e9a8 100644 --- a/examples/07-TwinBuilder/03-Dynamic_ROM_Creation_And_Visualization.py +++ b/examples/07-TwinBuilder/03-Dynamic_ROM_Creation_And_Visualization.py @@ -15,7 +15,6 @@ # Perform required imports. import os -import math import shutil import matplotlib.pyplot as plt from pyaedt import TwinBuilder @@ -85,7 +84,7 @@ conf_file_path = os.path.join(data_folder,source_build_conf_file) dynamic_rom_builder.Build(conf_file_path.replace('\\', '/')) -# Test if ROM was created sucessfully +# Test if ROM was created successfully dynamic_rom_path = os.path.join(data_folder,'DynamicRom.dyn') if os.path.exists(dynamic_rom_path): tb._odesign.AddMessage("Info","path exists: {}".format(dynamic_rom_path.replace('\\', '/')), "")