From d9006552b067d51c95ee14eec8e2312c7b6808f7 Mon Sep 17 00:00:00 2001 From: Maxime Rey Date: Wed, 27 Mar 2024 17:24:36 +0100 Subject: [PATCH] Remove useless pass statements. --- _unittest/test_02_3D_modeler.py | 2 -- _unittest/test_08_Primitives3D.py | 10 ---------- _unittest/test_09_VariableManager.py | 1 - _unittest/test_12_1_PostProcessing.py | 2 -- _unittest/test_20_HFSS.py | 1 - _unittest/test_21_Circuit.py | 1 - _unittest/test_41_3dlayout_modeler.py | 2 -- _unittest/test_98_Icepak.py | 1 - _unittest_solvers/test_31_Q3D.py | 1 - pyaedt/application/Variables.py | 2 -- pyaedt/desktop.py | 4 ---- pyaedt/generic/configurations.py | 1 - pyaedt/modeler/circuits/PrimitivesCircuit.py | 1 - pyaedt/modules/DesignXPloration.py | 5 ----- pyaedt/modules/Material.py | 2 -- 15 files changed, 36 deletions(-) diff --git a/_unittest/test_02_3D_modeler.py b/_unittest/test_02_3D_modeler.py index c8128e75e52..dbe348469d1 100644 --- a/_unittest/test_02_3D_modeler.py +++ b/_unittest/test_02_3D_modeler.py @@ -326,7 +326,6 @@ def test_30_create_waveguide(self): position, self.aedtapp.AXIS.Z, wgmodel="MYMODEL", wg_length=2000, parametrize_h=True ) assert not wgfail - pass def test_31_set_objects_unmodel(self): assert self.aedtapp.modeler.set_object_model_state("Second_airbox", False) @@ -663,7 +662,6 @@ def test_45_sweep_along_path(self): def test_46_section_object(self): box1 = self.aedtapp.modeler.create_box([-10, -10, -10], [20, 20, 20], "box_to_split") assert self.aedtapp.modeler.section(box1, 0, create_new=True, section_cross_object=False) - pass def test_47_sweep_along_vector(self): sweep_vector = [5, 0, 0] diff --git a/_unittest/test_08_Primitives3D.py b/_unittest/test_08_Primitives3D.py index 5a803019c78..fbccb275aeb 100644 --- a/_unittest/test_08_Primitives3D.py +++ b/_unittest/test_08_Primitives3D.py @@ -98,8 +98,6 @@ def create_copper_box(self, name=None): name = "MyBox" if self.aedtapp.modeler[name]: self.aedtapp.modeler.delete(name) - else: - pass new_object = self.aedtapp.modeler.create_box([0, 0, 0], [10, 10, 5], name, "Copper") return new_object @@ -241,8 +239,6 @@ def test_03_create_polyhedron(self): matname="Aluminum", ) - pass - def test_05_center_and_centroid(self): o = self.create_copper_box() tol = 1e-9 @@ -334,7 +330,6 @@ def test_15_create_cylinder(self): assert o.is3d is True assert not self.aedtapp.modeler.create_cylinder(axis, [2, 2], radius, height, 8, "MyCyl", "Copper") assert not self.aedtapp.modeler.create_cylinder(axis, udp, -0.1, height, 8, "MyCyl", "Copper") - pass def test_16_create_ellipse(self): udp = self.aedtapp.modeler.Position(5, 3, 8) @@ -378,7 +373,6 @@ def test_17_create_object_from_edge(self): of = self.aedtapp.modeler.create_object_from_edge([o4.edges[0], o3.edges[1], o4.edges[1]]) assert of assert len(of) == 3 - pass def test_18_create_object_from_face(self): o = self.create_copper_cylinder() @@ -400,7 +394,6 @@ def test_18_create_object_from_face(self): of = self.aedtapp.modeler.create_object_from_face([o3.faces[0], o4.faces[1], o4.faces[1], o3.faces[2]]) assert of assert len(of) == 4 - pass def test_19_create_polyline(self): udp1 = [0, 0, 0] @@ -868,8 +861,6 @@ def test_48_insert_polylines_segments_test2(self): P.insert_segment(position_list=[start_point, insert_point1, insert_point2], segment="Arc") - pass - def test_49_modify_crossection(self): P = self.aedtapp.modeler.create_polyline( position_list=[[34.1004, 14.1248, 0], [27.646, 16.7984, 0], [24.9725, 10.3439, 0]], @@ -1157,7 +1148,6 @@ def test_60_get_edges_on_bounding_box(self): def test_61_get_closest_edge_to_position(self): my_box = self.create_copper_box("test_closest_edge") assert isinstance(self.aedtapp.modeler.get_closest_edgeid_to_position([0.2, 0, 0]), int) - pass @pytest.mark.skipif(config["NonGraphical"], reason="Not running in non-graphical mode") def test_62_import_space_claim(self): diff --git a/_unittest/test_09_VariableManager.py b/_unittest/test_09_VariableManager.py index 166f644eeca..df4adad7f8d 100644 --- a/_unittest/test_09_VariableManager.py +++ b/_unittest/test_09_VariableManager.py @@ -119,7 +119,6 @@ def test_02_test_formula(self): v = self.aedtapp.variable_manager for var_name in v.variable_names: print("{} = {}".format(var_name, self.aedtapp[var_name])) - pass tol = 1e-9 c2pi = math.pi * 2.0 assert abs(v["$PrjVar1"].numeric_value - c2pi) < tol diff --git a/_unittest/test_12_1_PostProcessing.py b/_unittest/test_12_1_PostProcessing.py index 609f128c44c..d08731659e0 100644 --- a/_unittest/test_12_1_PostProcessing.py +++ b/_unittest/test_12_1_PostProcessing.py @@ -459,7 +459,6 @@ def test_09n_add_line_from_point(self): # pragma: no cover assert new_report.limit_lines[0].set_line_properties( style=style.Dot, width=4, hatch_above=False, violation_emphasis=True, hatch_pixels=1, color=(255, 255, 0) ) - pass @pytest.mark.skipif( config["desktopVersion"] < "2022.2", reason="Not working in non-graphical mode in version earlier than 2022.2." @@ -479,7 +478,6 @@ def test_09o_add_note(self): # pragma: no cover font_size=10, color=(255, 0, 0), ) - pass def test_10_delete_report(self): plots_number = len(self.aedtapp.post.plots) diff --git a/_unittest/test_20_HFSS.py b/_unittest/test_20_HFSS.py index 6cafedfc5f7..111c53630ee 100644 --- a/_unittest/test_20_HFSS.py +++ b/_unittest/test_20_HFSS.py @@ -844,7 +844,6 @@ def test_24_create_curvilinear(self): ).GetPropValue("Apply Curvilinear Elements") mesh.delete() assert len(self.aedtapp.mesh.meshoperations) == 2 - pass def test_30_assign_initial_mesh(self): assert self.aedtapp.mesh.assign_initial_mesh_from_slider(6) diff --git a/_unittest/test_21_Circuit.py b/_unittest/test_21_Circuit.py index 06948314a1c..be0a6a5a264 100644 --- a/_unittest/test_21_Circuit.py +++ b/_unittest/test_21_Circuit.py @@ -118,7 +118,6 @@ def test_06a_create_setup(self): def test_08_import_mentor_netlist(self): self.aedtapp.insert_design("MentorSchematicImport") assert self.aedtapp.create_schematic_from_mentor_netlist(self.netlist_file2) - pass def test_09_import_netlist(self): self.aedtapp.insert_design("SchematicImport") diff --git a/_unittest/test_41_3dlayout_modeler.py b/_unittest/test_41_3dlayout_modeler.py index 69ec0c416c3..0c1e5a85229 100644 --- a/_unittest/test_41_3dlayout_modeler.py +++ b/_unittest/test_41_3dlayout_modeler.py @@ -580,7 +580,6 @@ def test_33_set_temperature_dependence(self): ambient_temp=27, create_project_var=True, ) - pass def test_34_create_additional_setup(self): setup_name = "SiwaveDC" @@ -651,7 +650,6 @@ def test_39_import_ipc(self): def test_40_test_flex(self, add_app): flex = add_app(project_name=test_rigid_flex, application=Hfss3dLayout, subfolder=test_subfolder) assert flex.enable_rigid_flex() - pass def test_41_test_create_polygon(self): points = [[100, 100], [100, 200], [200, 200]] diff --git a/_unittest/test_98_Icepak.py b/_unittest/test_98_Icepak.py index 625c1a5e91d..70ed2b6338f 100644 --- a/_unittest/test_98_Icepak.py +++ b/_unittest/test_98_Icepak.py @@ -226,7 +226,6 @@ def test_10_DesignSettings(self): def test_11_mesh_level(self): assert self.aedtapp.mesh.assign_mesh_level({"USB_Shiels": 2}) - pass def test_12a_AssignMeshOperation(self): self.aedtapp.oproject = test_project_name diff --git a/_unittest_solvers/test_31_Q3D.py b/_unittest_solvers/test_31_Q3D.py index fdb5ad0aeae..5869c08eca5 100644 --- a/_unittest_solvers/test_31_Q3D.py +++ b/_unittest_solvers/test_31_Q3D.py @@ -191,7 +191,6 @@ def test_08_create_faceted_bondwire(self): "bondwire_example", self.aedtapp.AXIS.Z, min_size=0.2, numberofsegments=8 ) assert test - pass def test_11_assign_net(self): box = self.aedtapp.modeler.create_box([30, 30, 30], [10, 10, 10], name="mybox") diff --git a/pyaedt/application/Variables.py b/pyaedt/application/Variables.py index 1da104d08ba..0bc9681e3e7 100644 --- a/pyaedt/application/Variables.py +++ b/pyaedt/application/Variables.py @@ -146,8 +146,6 @@ def __init__( for quantity_name in self._header: self._data[quantity_name] = [] - pass - @pyaedt_function_handler() def __getitem__(self, item): variable_list = item.split(",") diff --git a/pyaedt/desktop.py b/pyaedt/desktop.py index 87ee60c209a..a90d6c07966 100644 --- a/pyaedt/desktop.py +++ b/pyaedt/desktop.py @@ -255,7 +255,6 @@ def _close_aedt_application(desktop_class, close_desktop, pid, is_grpc_api): return True except Exception: # pragma: no cover warnings.warn("Something went wrong closing AEDT. Exception in `_main.oDesktop.QuitApplication()`.") - pass elif _desktop_sessions and len(_desktop_sessions) > 1 and not desktop_class.parent_desktop_id: pyaedt_logger.error("Release is not allowed when multiple desktop sessions are available.") pyaedt_logger.error("Closing Desktop session.") @@ -268,7 +267,6 @@ def _close_aedt_application(desktop_class, close_desktop, pid, is_grpc_api): return True except Exception: # pragma: no cover warnings.warn("Something went wrong closing AEDT. Exception in `_main.oDesktop.QuitApplication()`.") - pass elif _desktop_sessions and len(_desktop_sessions) > 1: pyaedt_logger.error("A child desktop session is linked to this session.") pyaedt_logger.error("Multiple desktop sessions must be released in reverse order.") @@ -284,7 +282,6 @@ def _close_aedt_application(desktop_class, close_desktop, pid, is_grpc_api): warnings.warn( "Something went wrong releasing AEDT. Exception in `StandalonePyScriptWrapper.Release()`." ) - pass elif not inside_desktop: if close_desktop: try: @@ -302,7 +299,6 @@ def _close_aedt_application(desktop_class, close_desktop, pid, is_grpc_api): pyaedt_logger.warning( "Something went wrong releasing AEDT. Exception in `_main.COMUtil.ReleaseCOMObjectScope`." ) - pass if not settings.remote_rpc_session and not is_ironpython and close_desktop: timeout = 10 while pid in active_sessions(): diff --git a/pyaedt/generic/configurations.py b/pyaedt/generic/configurations.py index 14ba767c84e..0afef57ae35 100644 --- a/pyaedt/generic/configurations.py +++ b/pyaedt/generic/configurations.py @@ -1685,7 +1685,6 @@ def _export_mesh_operations(self, dict_out): } dict_out["mesh"][mesh.name] = mop[mesh.name] self._map_object(mop, dict_out) - pass @pyaedt_function_handler() def update_monitor(self, m_case, m_object, m_quantity, m_name): diff --git a/pyaedt/modeler/circuits/PrimitivesCircuit.py b/pyaedt/modeler/circuits/PrimitivesCircuit.py index d8639bf017a..ff46a7c9e99 100644 --- a/pyaedt/modeler/circuits/PrimitivesCircuit.py +++ b/pyaedt/modeler/circuits/PrimitivesCircuit.py @@ -64,7 +64,6 @@ def __init__(self, modeler): self.current_position = [0, 0] self.increment_mils = [1000, 1000] self.limits_mils = 20000 - pass @property def o_definition_manager(self): diff --git a/pyaedt/modules/DesignXPloration.py b/pyaedt/modules/DesignXPloration.py index e2566253a47..8c8d870ac64 100644 --- a/pyaedt/modules/DesignXPloration.py +++ b/pyaedt/modules/DesignXPloration.py @@ -860,11 +860,6 @@ def __init__(self, p_app, name, dictinputs=None, optim_type="OptiParametric"): def delete(self): """Delete a defined Optimetrics Setup. - Parameters - ---------- - setup_name : str - Name of optimetrics setup to delete. - Returns ------- bool diff --git a/pyaedt/modules/Material.py b/pyaedt/modules/Material.py index 5969dadf6c2..7e1c28a1edb 100644 --- a/pyaedt/modules/Material.py +++ b/pyaedt/modules/Material.py @@ -1363,7 +1363,6 @@ def _update_material(self): self._props[property] if property in self._props else MatProperties.get_defaultvalue(aedtname=property) ) self.__dict__["_" + property] = MatProperty(self, property, property_value, tmods, smods) - pass @property def material_appearance(self): @@ -2704,7 +2703,6 @@ def __init__(self, materiallib, name, props=None, material_update=True): self.__dict__["_" + property] = MatProperty( self, property, SurfMatProperties.get_defaultvalue(aedtname=property) ) - pass @property def emissivity(self):