diff --git a/_unittest/test_28_Maxwell3D.py b/_unittest/test_28_Maxwell3D.py index 281e2fbe4b9..92f87bc5cab 100644 --- a/_unittest/test_28_Maxwell3D.py +++ b/_unittest/test_28_Maxwell3D.py @@ -198,6 +198,7 @@ def test_05a_assign_coil(self): def test_05_draw_region(self): assert self.aedtapp.modeler.create_air_region(*[300] * 6) + @pytest.mark.skipif(desktop_version == "2024.2", reason="GetDisplacementCurrent not working in 2024.2") def test_06_eddycurrent(self): assert self.aedtapp.eddy_effects_on(["Plate"], enable_eddy_effects=True) oModule = self.aedtapp.odesign.GetModule("BoundarySetup") diff --git a/_unittest/test_30_Q2D.py b/_unittest/test_30_Q2D.py index 61683934358..ec88160bca7 100644 --- a/_unittest/test_30_Q2D.py +++ b/_unittest/test_30_Q2D.py @@ -200,79 +200,79 @@ def test_15_export_equivalent_circuit(self, add_app): assert q2d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.cir")) assert not q2d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.doc")) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + setup="Setup1", sweep="LastAdaptive", ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup_name="Setup2" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup2" ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + setup="Setup1", sweep="LastAdaptive", variations=["r1:0.3mm"], ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + setup="Setup1", sweep="LastAdaptive", variations=[" r1 : 0.3 mm "], ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + setup="Setup1", sweep="LastAdaptive", variations="r1:0.3mm", ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Original" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Original" ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Test1" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Test1" ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2 + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2 ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0 + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0 ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1 + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1 ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0, - res_limit="6Mohm", ind_limit="12nH", + res_limit="6Mohm", ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34mm" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34mm" ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34nounits" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), lumped_length="34nounits" ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), rise_time_value="1e-6", rise_time_unit="s", ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), rise_time_value="23", rise_time_unit="m", ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="WELement" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="WELement" ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="test" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), file_type="test" ) assert q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name=q2d_q3d + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model=q2d_q3d ) assert not q2d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test" + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test" ) self.aedtapp.close_project(q2d.project_name, save_project=False) diff --git a/_unittest/test_41_3dlayout_modeler.py b/_unittest/test_41_3dlayout_modeler.py index 14c8a0d3c92..0b6add565e9 100644 --- a/_unittest/test_41_3dlayout_modeler.py +++ b/_unittest/test_41_3dlayout_modeler.py @@ -654,7 +654,6 @@ def test_41_test_create_polygon(self): @pytest.mark.skipif(config["desktopVersion"] < "2023.2", reason="Working only from 2023 R2") def test_42_post_processing(self, add_app): test_post1 = add_app(project_name=test_post, application=Maxwell3d, subfolder=test_subfolder) - assert test_post1.post.create_fieldplot_layers( [], "Mag_H", @@ -692,6 +691,11 @@ def test_42_post_processing(self, add_app): intrinsics={"Freq": "1GHz", "Phase": "0deg"}, plot_name="Test_Layers4", ) + assert test_post2.post.create_fieldplot_layers( + ["TOP"], + "Mag_E", + intrinsics={"Freq": "1GHz", "Phase": "0deg"}, + ) assert test_post2.post.create_fieldplot_layers( ["TOP", "UNNAMED_004"], "Mag_E", diff --git a/_unittest_solvers/test_31_Q3D.py b/_unittest_solvers/test_31_Q3D.py index 9f071d5e61e..66b83cb7bcc 100644 --- a/_unittest_solvers/test_31_Q3D.py +++ b/_unittest_solvers/test_31_Q3D.py @@ -373,58 +373,38 @@ def test_16_export_equivalent_circuit(self, add_app): q3d["d"] = "10mm" q3d.modeler.duplicate_along_line(objid="Box1", vector=[0, "d", 0]) q3d.analyze_setup(q3d.active_setup, cores=6) - assert q3d.export_equivalent_circuit( - os.path.join(self.local_scratch.path, "test_export_circuit.cir"), variations=["d: 10mm"] - ) + assert q3d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.cir"), + variations=["d: 10mm"]) assert not q3d.export_equivalent_circuit(os.path.join(self.local_scratch.path, "test_export_circuit.doc")) assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", - sweep="LastAdaptive", - variations=["c: 10mm", "d: 20mm"], - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup1", + sweep="LastAdaptive", variations=["c: 10mm", "d: 20mm"]) assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup_name="Setup2" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup2") assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - setup_name="Setup1", - sweep="Sweep1", - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), setup="Setup1", + sweep="Sweep1") assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="Original" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="Original") assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="JointTest" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="JointTest") assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix_name="JointTest1" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), matrix="JointTest1") assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2 - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=2) assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0 - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0) assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1 - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=1) assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), - coupling_limit_type=0, - cond_limit="3Sie", - cap_limit="4uF", - ind_limit="9uH", - res_limit="2ohm", - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), coupling_limit_type=0, + cap_limit="4uF", ind_limit="9uH", res_limit="2ohm", cond_limit="3Sie") assert q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test_14" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test_14") assert not q3d.export_equivalent_circuit( - file_name=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model_name="test" - ) + output_file=os.path.join(self.local_scratch.path, "test_export_circuit.cir"), model="test") self.aedtapp.close_project(q3d.project_name, save_project=False) def test_17_export_results_q3d(self, add_app): diff --git a/doc/source/API/SetupTemplatesIcepak.rst b/doc/source/API/SetupTemplatesIcepak.rst index 0d3c46980c8..97212557adc 100644 --- a/doc/source/API/SetupTemplatesIcepak.rst +++ b/doc/source/API/SetupTemplatesIcepak.rst @@ -14,7 +14,7 @@ You can edit a setup after it is created. Here is an example: # Any property of this setup can be found on this page. setup = app.create_setup(MaxIterations=5) - +Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``. .. pprint:: pyaedt.modules.SetupTemplates.TransientFlowOnly .. pprint:: pyaedt.modules.SetupTemplates.TransientTemperatureOnly diff --git a/doc/source/index.rst b/doc/source/index.rst index 2174585ef76..c4cdb25bbf8 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,9 +6,13 @@ PyAEDT documentation |version| `Source Repository `_ | `Issues `_ -PyAEDT is a Python library that interacts directly with the Ansys Electronics Desktop (AEDT) API, +PyAEDT is a Python client library that interacts directly with the Ansys Electronics Desktop (AEDT) API, enabling straightforward and efficient automation in your workflow. +.. note:: + Also consider viewing the `PyEDB documentation `_. + PyEDB is a Python client library for processing complex and large layout designs in the Ansys + Electronics Database (EDB) format, which stores information describing designs for AEDT. .. grid:: 2 @@ -26,19 +30,12 @@ enabling straightforward and efficient automation in your workflow. .. grid:: 2 - .. grid-item-card:: AEDT API reference :fa:`book-bookmark` + .. grid-item-card:: API reference :fa:`book-bookmark` :link: API/index :link-type: doc This section contains descriptions of the functions and modules included in PyAEDT. - It describes how the methods work and the parameter that can be used. - - .. grid-item-card:: EDB API reference :fa:`book-bookmark` - :link: https://edb.docs.pyansys.com/version/stable/ - :link-type: url - - Contains descriptions of the functions and modules included in PyEDB. - It describes how the methods work and the parameter that can be used. + It describes how the methods work and the parameters that can be used. .. jinja:: main_toctree @@ -70,5 +67,3 @@ enabling straightforward and efficient automation in your workflow. {% if run_examples %} examples/index {% endif %} - - diff --git a/examples/01-HFSS3DLayout/Hfss3DComponent.py b/examples/01-HFSS3DLayout/Hfss3DComponent.py index 5bdace325e2..daeb0177ae3 100644 --- a/examples/01-HFSS3DLayout/Hfss3DComponent.py +++ b/examples/01-HFSS3DLayout/Hfss3DComponent.py @@ -199,8 +199,8 @@ h3d["len"] = str(trace_length) + "mm" h3d["w1"] = str(trace_width) + "mm" -h3d.create_edge_port(line, h3d.modeler[line].top_edge_x, is_wave_port=True, wave_horizontal_extension=15) line = h3d.modeler.create_line("L1", [[0, 0], ["len", 0]], lw="w1", name="microstrip", net="microstrip") +h3d.create_edge_port(line, h3d.modeler[line.name].top_edge_x, is_wave_port=True, wave_horizontal_extension=15) ############################################################################### # Create void on Ground plane for pin @@ -218,7 +218,12 @@ h3d.edit_hfss_extents(diel_extent_horizontal_padding="0.2", air_vertical_positive_padding="0", air_vertical_negative_padding="2", airbox_values_as_dim=False) setup1 = h3d.create_setup() -sweep1 = h3d.create_linear_count_sweep(setup1.name, "GHz", 0.01, 8, 1601, sweep_type="Interpolating") +sweep1 = h3d.create_linear_count_sweep(setup1.name, + "GHz", + 0.01, + 8, + 1601, + sweep_type="Interpolating") setup1.props["AdaptiveSettings"]["SingleFrequencyDataList"]["AdaptiveFrequencyData"]["AdaptiveFrequency"] = freq setup1.props["AdaptiveSettings"]["SingleFrequencyDataList"]["AdaptiveFrequencyData"]["MaxPasses"] = max_steps diff --git a/examples/03-Maxwell/Maxwell2D_Electrostatic.py b/examples/03-Maxwell/Maxwell2D_Electrostatic.py index 6eb50df7baf..3f044ffd9bc 100644 --- a/examples/03-Maxwell/Maxwell2D_Electrostatic.py +++ b/examples/03-Maxwell/Maxwell2D_Electrostatic.py @@ -198,13 +198,6 @@ M2D.post.export_field_plot(plot_name="LineTracesTest", output_dir=M2D.toolkit_directory, file_format="fldplt") -########################################################## -# Export a field plot to an image file -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Export the flux lines plot to an image file using PyVista Python package. - -M2D.post.plot_field_from_fieldplot(plot.name, show=False) - ########################################################## # Export the mesh field plot # ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/05-Q3D/Q3D_DC_IR.py b/examples/05-Q3D/Q3D_DC_IR.py index 6536fe911e6..20c7e451384 100644 --- a/examples/05-Q3D/Q3D_DC_IR.py +++ b/examples/05-Q3D/Q3D_DC_IR.py @@ -214,7 +214,9 @@ # ~~~~~~~~ # Compute ACL solutions and plot them. -plot1 = q3d.post.create_fieldplot_surface(q3d.modeler.get_objects_by_material("copper"), quantity=drop_name) +plot1 = q3d.post.create_fieldplot_surface(q3d.modeler.get_objects_by_material("copper"), + quantity=drop_name, + intrinsics={"Freq": "1GHz"}) q3d.post.plot_field_from_fieldplot(plot1.name, project_path=q3d.working_directory, mesh_plot=False, image_format="jpg", view="isometric", show=False, plot_cad_objs=False, log_scale=False) diff --git a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py index 9b7de137a56..c9192f669e2 100644 --- a/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py +++ b/examples/07-TwinBuilder/02-Wiring_A_Rectifier.py @@ -124,7 +124,6 @@ tb.analyze_setup("TR") - ############################################################################### # Get report data and plot using Matplotlib # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -136,7 +135,7 @@ x = tb.post.get_solution_data(E_Value, "TR", "Time") plt.plot(x.intrinsics["Time"], x.data_real(E_Value)) -R_Value = "RL.V" +R_Value = "R1.V" x = tb.post.get_solution_data(R_Value, "TR", "Time") plt.plot(x.intrinsics["Time"], x.data_real(R_Value)) diff --git a/pyaedt/application/design_solutions.py b/pyaedt/application/design_solutions.py index 979ab40c3f2..8b0fa36aab9 100644 --- a/pyaedt/application/design_solutions.py +++ b/pyaedt/application/design_solutions.py @@ -1,5 +1,6 @@ import copy +from pyaedt.aedt_logger import pyaedt_logger as logger from pyaedt.generic.general_methods import pyaedt_function_handler solutions_defaults = { @@ -549,7 +550,8 @@ def __init__(self, odesign, design_type, aedt_version): self._odesign = odesign self._aedt_version = aedt_version self.model_name = model_names[design_type] - assert design_type in solutions_types, "Wrong Design Type" + if not design_type in solutions_types: + raise ValueError("Design type is not valid.") # deepcopy doesn't work on remote self._solution_options = copy.deepcopy(solutions_types[design_type]) self._design_type = design_type @@ -844,7 +846,7 @@ def solution_type(self, value): opts = "" self._odesign.SetSolutionType(self._solution_options[self._solution_type]["name"], opts) except Exception: - pass + logger.error("Failed to set solution type.") class IcepakDesignSolution(DesignSolution, object): @@ -922,7 +924,7 @@ def solution_type(self, solution_type): try: self._odesign.SetSolutionType(options) except Exception: - pass + logger.error("Failed to set solution type.") class RmXprtDesignSolution(DesignSolution, object): @@ -943,7 +945,7 @@ def solution_type(self, solution_type): self._odesign.SetDesignFlow(self._design_type, solution_type) self._solution_type = solution_type except Exception: - pass + logger.error("Failed to set design flow.") @property def design_type(self): diff --git a/pyaedt/circuit.py b/pyaedt/circuit.py index 3c09eaac547..e8638873c11 100644 --- a/pyaedt/circuit.py +++ b/pyaedt/circuit.py @@ -214,7 +214,7 @@ def create_schematic_from_netlist(self, input_file): self[ppar] = pval xpos = 0.0254 except Exception: - pass + self.logger.error("Failed to parse line '{}'.".format(line)) elif ".model" in line[:7].lower() or ".lib" in line[:4].lower(): model.append(line) if model: diff --git a/pyaedt/generic/general_methods.py b/pyaedt/generic/general_methods.py index a286641a2f7..432acb95a12 100644 --- a/pyaedt/generic/general_methods.py +++ b/pyaedt/generic/general_methods.py @@ -253,7 +253,7 @@ def deprecate_kwargs(func_name, kwargs, aliases): msg += "{} is deprecated, use {} instead.".format(alias, new) raise TypeError(msg) pyaedt_logger.warning( - '`{}` is deprecated as an argument to `{}`; use" f" `{}` instead.'.format(alias, func_name, new) + "Argument `{}` is deprecated for method `{}`; use `{}` instead.".format(alias, func_name, new) ) kwargs[new] = kwargs.pop(alias) diff --git a/pyaedt/generic/plot.py b/pyaedt/generic/plot.py index ce95fcd9c6a..76c8a18b5ad 100644 --- a/pyaedt/generic/plot.py +++ b/pyaedt/generic/plot.py @@ -1327,7 +1327,24 @@ def _read_mesh_files(self, read_frames=False): if ".case" in field.path: reader = pv.get_reader(os.path.abspath(field.path)).read() field._cached_polydata = reader[reader.keys()[0]].extract_surface() - field.scalar_name = field._cached_polydata.point_data.active_scalars_name + + if ( + hasattr(field._cached_polydata.point_data, "active_vectors") + and field._cached_polydata.point_data.active_vectors_name + ): + field.scalar_name = field._cached_polydata.point_data.active_scalars_name + vector_scale = (max(field._cached_polydata.bounds) - min(field._cached_polydata.bounds)) / ( + 10 + * ( + np.vstack(field._cached_polydata.active_vectors).max() + - np.vstack(field._cached_polydata.active_vectors).min() + ) + ) + field._cached_polydata["vectors"] = field._cached_polydata.active_vectors * vector_scale + + field.is_vector = True + else: + field.scalar_name = field._cached_polydata.point_data.active_scalars_name elif ".aedtplt" in field.path: vertices, faces, scalars, log1 = _parse_aedtplt(field.path) diff --git a/pyaedt/modeler/circuits/PrimitivesNexxim.py b/pyaedt/modeler/circuits/PrimitivesNexxim.py index ea080cff015..bc43400b011 100644 --- a/pyaedt/modeler/circuits/PrimitivesNexxim.py +++ b/pyaedt/modeler/circuits/PrimitivesNexxim.py @@ -681,12 +681,12 @@ def create_inductor(self, name=None, value=50, location=None, angle=0, use_insta return cmpid @pyaedt_function_handler(compname="name") - def create_capacitor(self, cname=None, value=50, location=None, angle=0, use_instance_id_netlist=False): + def create_capacitor(self, name=None, value=50, location=None, angle=0, use_instance_id_netlist=False): """Create a capacitor. Parameters ---------- - cname : str, optional + name : str, optional Name of the capacitor. The default is ``None``. value : float, optional Capacitor value. The default is ``50``. @@ -708,12 +708,11 @@ def create_capacitor(self, cname=None, value=50, location=None, angle=0, use_ins >>> oEditor.CreateComponent """ - if location == None: location = [] cmpid = self.create_component( - cname, + name, component_library="Capacitors", component_name="CAP_", location=location, diff --git a/pyaedt/modules/AdvancedPostProcessing.py b/pyaedt/modules/AdvancedPostProcessing.py index a2b76fb55f3..6b5650d6074 100644 --- a/pyaedt/modules/AdvancedPostProcessing.py +++ b/pyaedt/modules/AdvancedPostProcessing.py @@ -328,6 +328,8 @@ def plot_field_from_fieldplot( ): """Export a field plot to an image file (JPG or PNG) using Python PyVista. + This method does not support streamlines plot. + .. note:: The PyVista module rebuilds the mesh and the overlap fields on the mesh. @@ -392,8 +394,6 @@ def plot_field_from_fieldplot( else: self.ofieldsreporter.UpdateQuantityFieldsPlots(plot_folder) - if self.field_plots[plot_name].field_type == "DC R/L Fields": - file_format = "fldplt" file_to_add = self.export_field_plot(plot_name, self._app.working_directory, file_format=file_format) model = self.get_model_plotter_geometries( generate_mesh=False, diff --git a/pyaedt/modules/MeshIcepak.py b/pyaedt/modules/MeshIcepak.py index 2292e8b5323..a0939fbae27 100644 --- a/pyaedt/modules/MeshIcepak.py +++ b/pyaedt/modules/MeshIcepak.py @@ -408,8 +408,8 @@ def parts(self, parts): class MeshSettings(object): - automatic_mesh_settings = {"MeshRegionResolution": 3} # min: 1, max: 5 - common_mesh_settings = { + _automatic_mesh_settings = {"MeshRegionResolution": 3} # min: 1, max: 5 + _common_mesh_settings = { "ProximitySizeFunction": True, "CurvatureSizeFunction": True, "EnableTransition": False, @@ -419,7 +419,7 @@ class MeshSettings(object): "Enforce2dot5DCutCell": False, "StairStepMeshing": False, } - manual_mesh_settings = { + _manual_mesh_settings = { "MaxElementSizeX": "0.02mm", "MaxElementSizeY": "0.02mm", "MaxElementSizeZ": "0.03mm", @@ -437,7 +437,7 @@ class MeshSettings(object): "MinGapY": "1mm", "MinGapZ": "1mm", } - aedt_20212_args = [ + _aedt_20212_args = [ "ProximitySizeFunction", "CurvatureSizeFunction", "EnableTransition", @@ -450,12 +450,12 @@ class MeshSettings(object): def __init__(self, mesh_class, app): self._app = app self._mesh_class = mesh_class - self.instance_settings = self.common_mesh_settings.copy() - self.instance_settings.update(self.manual_mesh_settings.copy()) - self.instance_settings.update(self.automatic_mesh_settings.copy()) + self._instance_settings = self._common_mesh_settings.copy() + self._instance_settings.update(self._manual_mesh_settings.copy()) + self._instance_settings.update(self._automatic_mesh_settings.copy()) if settings.aedt_version < "2021.2": - for arg in self.aedt_20212_args: - del self.instance_settings[arg] + for arg in self._aedt_20212_args: + del self._instance_settings[arg] @pyaedt_function_handler() def _dim_arg(self, value): @@ -474,7 +474,7 @@ def parse_settings(self): List of strings containing all the parts that must be included in the subregion. """ out = [] - for k, v in self.instance_settings.items(): + for k, v in self._instance_settings.items(): out.append(k + ":=") if k in ["MaxElementSizeX", "MaxElementSizeY", "MaxElementSizeZ", "MinGapX", "MinGapY", "MinGapZ"]: v = self._dim_arg(v) @@ -483,16 +483,25 @@ def parse_settings(self): def _key_in_dict(self, key): if self._mesh_class.manual_settings: - ref_dict = self.manual_mesh_settings + ref_dict = self._manual_mesh_settings else: - ref_dict = self.automatic_mesh_settings - return key in ref_dict or key in self.common_mesh_settings + ref_dict = self._automatic_mesh_settings + return key in ref_dict or key in self._common_mesh_settings + + def keys(self): + return self.parse_settings().keys() + + def values(self): + return self.parse_settings().values() + + def __repr__(self): + return repr(self.parse_settings()) def __getitem__(self, key): if key == "Level": key = "MeshRegionResolution" if self._key_in_dict(key): - return self.instance_settings[key] + return self._instance_settings[key] else: raise KeyError("Setting not available.") @@ -515,7 +524,7 @@ def __setitem__(self, key, value): value = 5 except TypeError: pass - self.instance_settings[key] = value + self._instance_settings[key] = value else: self._app.logger.error("Setting not available.") @@ -523,13 +532,13 @@ def __delitem__(self, key): self._app.logger.error("Setting cannot be removed.") def __iter__(self): - return self.instance_settings.__iter__() + return self._instance_settings.__iter__() def __len__(self): - return self.instance_settings.__len__() + return self._instance_settings.__len__() def __contains__(self, x): - return self.instance_settings.__contains__(x) + return self._instance_settings.__contains__(x) class MeshRegionCommon(object): @@ -783,10 +792,20 @@ def assignment(self): """ if isinstance(self._assignment, SubRegion): # try to update name - try: - parts = self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Parts") + if self.name in self._app.odesign.GetChildObject("Mesh").GetChildNames(): + parts = [] + subparts = [] + if "Parts" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): + parts = self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Parts") + if "Submodels" in self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropNames(): + subparts = ( + self._app.odesign.GetChildObject("Mesh").GetChildObject(self.name).GetPropValue("Submodels") + ) if not isinstance(parts, list): parts = [parts] + if not isinstance(subparts, list): + subparts = [subparts] + parts += subparts sub_regions = self._app.modeler.non_model_objects for sr in sub_regions: p1 = [] @@ -802,8 +821,6 @@ def assignment(self): p1 += p2 if "CreateSubRegion" == self._app.modeler[sr].history().command and all(p in p1 for p in parts): self._assignment.name = sr - except GrpcApiError: - pass return self._assignment elif isinstance(self._assignment, list): return self._assignment @@ -1374,7 +1391,7 @@ def assign_mesh_region(self, assignment=None, level=5, name=None, **kwargs): added_obj = [i for i in objectlist2 if i not in all_objs or i in assignment] meshregion.Objects = added_obj meshregion.SubModels = None - meshregion.update() + meshregion.update() return meshregion else: return False diff --git a/pyaedt/modules/PostProcessor.py b/pyaedt/modules/PostProcessor.py index 762677b4aff..e95d3c7c9e1 100644 --- a/pyaedt/modules/PostProcessor.py +++ b/pyaedt/modules/PostProcessor.py @@ -3333,33 +3333,15 @@ def _get_3d_layers_nets(self, layers, nets): new_layers = [] for k, v in self._app.modeler.user_defined_components.items(): if v.layout_component: - if not layers and not nets: - new_layers.extend( - [ - "{}:{}#t=fill".format(k, i) - for i in v.layout_component.edb_object.stackup.signal_layers.keys() - ] - ) - new_layers.extend( - ["{}:{}".format(k, i) for i in v.layout_component.edb_object.stackup.dielectric_layers.keys()] - ) - elif not nets: - for layer in layers: - if layer in v.layout_component.edb_object.stackup.signal_layers: - new_layers.append("{}:{}#t=fill".format(k, layer)) - elif layer in v.layout_component.edb_object.stackup.dielectric_layers: - new_layers.append("{}:{}".format(k, layer)) - elif not layers: - for v in self._app.modeler.user_defined_components.values(): - new_layers.extend( - [[i] + nets for i in v.layout_component.edb_object.stackup.signal_layers.keys()] - ) - else: - for layer in layers: - if layer in v.layout_component.edb_object.stackup.signal_layers: - new_layers.append([layer] + nets) - elif layer in v.layout_component.edb_object.stackup.dielectric_layers: - dielectrics.append("{}:{}".format(k, layer)) + if not layers: + layers = [i for i in v.layout_component.edb_object.stackup.stackup_layers.keys()] + if not nets: + nets = [""] + [i for i in v.layout_component.edb_object.nets.nets.keys()] + for layer in layers: + if layer in v.layout_component.edb_object.stackup.signal_layers: + new_layers.append([layer] + nets) + elif layer in v.layout_component.edb_object.stackup.dielectric_layers: + dielectrics.append("{}:{}".format(k, layer)) return dielectrics, new_layers @pyaedt_function_handler() @@ -3433,12 +3415,10 @@ def create_fieldplot_layers( return self._create_fieldplot(lst_faces, quantity, setup, intrinsics, "FacesList", name) else: dielectrics, new_layers = self._get_3d_layers_nets(layers, nets) - if nets and plot_on_surface: + if plot_on_surface: plot_type = "LayerNetsExtFace" - elif nets: - plot_type = "LayerNets" else: - plot_type = "ObjList" + plot_type = "LayerNets" if new_layers: plt = self._create_fieldplot( new_layers, quantity, setup, intrinsics, plot_type, name, create_plot=False diff --git a/pyaedt/modules/SetupTemplates.py b/pyaedt/modules/SetupTemplates.py index 3125de54ca0..b55424bb77f 100644 --- a/pyaedt/modules/SetupTemplates.py +++ b/pyaedt/modules/SetupTemplates.py @@ -317,6 +317,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Temperature": True, "Include Flow": True, "Include Gravity": False, @@ -380,6 +381,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Temperature": True, "Include Gravity": False, "Solution Initialization - X Velocity": "0m_per_sec", @@ -441,6 +443,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Flow": True, "Include Gravity": False, "Solution Initialization - X Velocity": "0m_per_sec", @@ -793,6 +796,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Temperature": True, "Include Flow": True, "Include Gravity": False, @@ -811,7 +815,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Convergence Criteria - Turbulent Dissipation Rate": "0.001", "Convergence Criteria - Specific Dissipation Rate": "0.001", "Convergence Criteria - Discrete Ordinates": "1e-06", - "IsEnabled:=": False, + "IsEnabled": False, "Radiation Model": "Off", "Solar Radiation Model": "Solar Radiation Calculator", "Solar Radiation - Scattering Fraction": "0", @@ -865,9 +869,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Linear Solver Stabilization - Temperature": "None", "Coupled pressure-velocity formulation": False, "Frozen Flow Simulation": False, - "Start Time:=": "0s", - "Stop Time:=": "20s", - "Time Step:=": "1s", + "Start Time": "0s", + "Stop Time": "20s", + "Time Step": "1s", "Iterations per Time Step": 20, "Import Start Time": False, "Copy Fields From Source": False, @@ -883,6 +887,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Temperature": True, "Include Flow": False, "Include Gravity": False, @@ -901,7 +906,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Convergence Criteria - Turbulent Dissipation Rate": "0.001", "Convergence Criteria - Specific Dissipation Rate": "0.001", "Convergence Criteria - Discrete Ordinates": "1e-06", - "IsEnabled:=": False, + "IsEnabled": False, "Radiation Model": "Off", "Solar Radiation Model": "Solar Radiation Calculator", "Solar Radiation - Scattering Fraction": "0", @@ -955,9 +960,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Linear Solver Stabilization - Temperature": "None", "Coupled pressure-velocity formulation": False, "Frozen Flow Simulation": False, - "Start Time:=": "0s", - "Stop Time:=": "20s", - "Time Step:=": "1s", + "Start Time": "0s", + "Stop Time": "20s", + "Time Step": "1s", "Iterations per Time Step": 20, "Import Start Time": False, "Copy Fields From Source": False, @@ -973,6 +978,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): { "Enabled": True, "Flow Regime": "Laminar", + "Turbulent Model Eqn": "ZeroEquation", "Include Temperature": False, "Include Flow": True, "Include Gravity": False, @@ -991,7 +997,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Convergence Criteria - Turbulent Dissipation Rate": "0.001", "Convergence Criteria - Specific Dissipation Rate": "0.001", "Convergence Criteria - Discrete Ordinates": "1e-06", - "IsEnabled:=": False, + "IsEnabled": False, "Radiation Model": "Off", "Solar Radiation Model": "Solar Radiation Calculator", "Solar Radiation - Scattering Fraction": "0", @@ -1045,9 +1051,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Linear Solver Stabilization - Temperature": "None", "Coupled pressure-velocity formulation": False, "Frozen Flow Simulation": False, - "Start Time:=": "0s", - "Stop Time:=": "20s", - "Time Step:=": "1s", + "Start Time": "0s", + "Stop Time": "20s", + "Time Step": "1s", "Iterations per Time Step": 20, "Import Start Time": False, "Copy Fields From Source": False, @@ -1150,7 +1156,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "InclBBoxOption": 1, "AuxBlock": OrderedDict({}), "DoAdaptive": True, - "Color": ["R:=", 0, "G:=", 0, "B:=", 0], # TODO: create something smart for color arrays: like a class + "Color": ["R", 0, "G", 0, "B", 0], # TODO: create something smart for color arrays: like a class "AdvancedSettings": HFSS3DLayout_AdvancedSettings, "CurveApproximation": HFSS3DLayout_CurveApproximation, "Q3D_DCSettings": HFSS3DLayout_Q3D_DCSettings, @@ -1225,7 +1231,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "ICModeLength": "50nm", "AuxBlock": OrderedDict({}), "DoAdaptive": True, - "Color": ["R:=", 0, "G:=", 0, "B:=", 0], # TODO: create something smart for color arrays: like a class + "Color": ["R", 0, "G", 0, "B", 0], # TODO: create something smart for color arrays: like a class "AdvancedSettings": HFSS3DLayout_AdvancedSettings, "CurveApproximation": HFSS3DLayout_CurveApproximation, "Q3D_DCSettings": HFSS3DLayout_Q3D_DCSettings, @@ -1240,8 +1246,8 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): HFSS3DLayout_SIWAdvancedSettings = OrderedDict( { "IncludeCoPlaneCoupling": True, - "IncludeInterPlaneCoupling:=": False, - "IncludeSplitPlaneCoupling:=": True, + "IncludeInterPlaneCoupling": False, + "IncludeSplitPlaneCoupling": True, "IncludeFringeCoupling": True, "IncludeTraceCoupling": True, "XtalkThreshold": "-34", @@ -1334,7 +1340,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq): "Properties": HFSS3DLayout_Properties, "CustomSetup": False, "SolveSetupType": "SIwave", - "Color": ["R:=", 0, "G:=", 0, "B:=", 0], + "Color": ["R", 0, "G", 0, "B", 0], "Position": 0, "SimSetupType": "kSIwave", "SimulationSettings": HFSS3DLayout_ACSimulationSettings, diff --git a/pyaedt/modules/SolveSetup.py b/pyaedt/modules/SolveSetup.py index 48a1ce7d10b..743a7267150 100644 --- a/pyaedt/modules/SolveSetup.py +++ b/pyaedt/modules/SolveSetup.py @@ -1945,6 +1945,7 @@ def _get_net_names(self, app, file_fullname): if pad_ind not in obj_dict: obj_dict[pad_ind] = aedtapp.modeler.objects[pad_ind] obj_list = list(obj_dict.values()) + net = net.replace(".", "_") if len(obj_list) == 1: net = net.replace("-", "m") net = net.replace("+", "p") @@ -1954,14 +1955,13 @@ def _get_net_names(self, app, file_fullname): elif len(obj_list) > 1: united_object = aedtapp.modeler.unite(obj_list, purge=True) obj_ind = aedtapp.modeler.objects[united_object].id - try: + if obj_ind: net = net.replace("-", "m") net = net.replace("+", "p") net_name = re.sub("[^a-zA-Z0-9 .\n]", "_", net) aedtapp.modeler.objects[obj_ind].name = net_name aedtapp.modeler.objects[obj_ind].color = [randrange(255), randrange(255), randrange(255)] - except Exception: - pass + if aedtapp.design_type == "Q3D Extractor": aedtapp.auto_identify_nets() aedtapp.close_project(save_project=True) diff --git a/pyaedt/modules/solutions.py b/pyaedt/modules/solutions.py index 97114c46e92..b1022423974 100644 --- a/pyaedt/modules/solutions.py +++ b/pyaedt/modules/solutions.py @@ -2961,6 +2961,8 @@ def surfacePlotInstruction(self): self.plotsettings, "EnableGaussianSmoothing:=", False, + "SurfaceOnly:=", + True if self.surfaces or self.cutplanes else False, ] ) return out diff --git a/pyaedt/q3d.py b/pyaedt/q3d.py index dfb66ee6d19..51c9c714a0d 100644 --- a/pyaedt/q3d.py +++ b/pyaedt/q3d.py @@ -733,14 +733,22 @@ def export_matrix_data( self.logger.error("Export of matrix data was unsuccessful.") return False + @pyaedt_function_handler( + file_name="output_file", + setup_name="setup", + matrix_name="matrix", + num_cells="cells", + freq="frequency", + model_name="model", + ) def export_equivalent_circuit( self, - file_name, - setup_name=None, + output_file, + setup=None, sweep=None, variations=None, - matrix_name=None, - num_cells=2, + matrix=None, + cells=2, user_changed_settings=True, include_cap=True, include_cond=True, @@ -761,8 +769,8 @@ def export_equivalent_circuit( ind_limit=None, res_limit=None, cond_limit=None, - model_name=None, - freq=0, + model=None, + frequency=0, file_type="HSPICE", include_cpp=False, ): @@ -770,11 +778,11 @@ def export_equivalent_circuit( Parameters ---------- - file_name : str + output_file : str Full path for saving the matrix data to. Options for file extensions are CIR, SML, SP, PKG, SPC, LIB, CKT, BSP, DML, and ICM. - setup_name : str, optional + setup : str, optional Setup name. The default value is ``None``, in which case the first analysis setup is used. sweep : str, optional @@ -784,9 +792,9 @@ def export_equivalent_circuit( Design variation. The default is ``None``, in which case the current nominal variation is used. If you provide a design variation, use the format ``{Name}:{Value}``. - matrix_name : str, optional + matrix : str, optional Name of the matrix to show. The default is ``"Original"``. - num_cells : int, optional + cells : int, optional Number of cells in export. Default value is 2. user_changed_settings : bool, optional @@ -855,10 +863,10 @@ def export_equivalent_circuit( Inductance limit. Default value is 1nH if coupling_limit_type is 0. Default value is 0.01 if coupling_limit_type is 1. - model_name : str, optional + model : str, optional Model name or name of the sub circuit (Optional). If None then file_name is considered as model name. - freq : str, optional + frequency : str, optional Sweep frequency in Hz. Default value is 0. file_type : str, optional @@ -896,12 +904,10 @@ def export_equivalent_circuit( >>> aedtapp.modeler.duplicate_along_line(objid="Box1",vector=[0, "d", 0]) >>> mysetup = aedtapp.create_setup() >>> aedtapp.analyze_setup(mysetup.name) - >>> aedtapp.export_equivalent_circuit(file_name="test_export_circuit.cir", - ... setup_name=mysetup.name, - ... sweep="LastAdaptive", - ... variations=["d: 20mm"] + >>> aedtapp.export_equivalent_circuit(output_file="test_export_circuit.cir", + ... setup=mysetup.name,sweep="LastAdaptive", variations=["d: 20mm"]) """ - if os.path.splitext(file_name)[1] not in [ + if os.path.splitext(output_file)[1] not in [ ".cir", ".sml", ".sp", @@ -919,10 +925,10 @@ def export_equivalent_circuit( ) return False - if setup_name is None: - setup_name = self.active_setup - elif setup_name != self.active_setup: - self.logger.error("Setup named: %s is invalid. Provide a valid analysis setup name.", setup_name) + if setup is None: + setup = self.active_setup + elif setup != self.active_setup: + self.logger.error("Setup named: %s is invalid. Provide a valid analysis setup name.", setup) return False if sweep is None: sweep = self.design_solutions.default_adaptive @@ -931,7 +937,7 @@ def export_equivalent_circuit( if sweep.replace(" ", "") not in sweep_array: self.logger.error("Sweep is invalid. Provide a valid sweep.") return False - analysis_setup = setup_name + " : " + sweep.replace(" ", "") + analysis_setup = setup + " : " + sweep.replace(" ", "") if variations is None: if not self.available_variations.nominal_w_values_dict: @@ -962,11 +968,11 @@ def export_equivalent_circuit( variations_list.append(variation) variations = ",".join(variations_list) - if matrix_name is None: - matrix_name = "Original" + if matrix is None: + matrix = "Original" else: if self.matrices: - if not [matrix for matrix in self.matrices if matrix.name == matrix_name]: + if not [matrix_object for matrix_object in self.matrices if matrix_object.name == matrix]: self.logger.error("Matrix doesn't exist. Provide an existing matrix.") return False else: @@ -1047,9 +1053,9 @@ def export_equivalent_circuit( coupling_limit_value = "None" coupling_limits.append(coupling_limit_value) - if model_name is None: - model_name = self.project_name - elif model_name != self.project_name: + if model is None: + model = self.project_name + elif model != self.project_name: self.logger.error("Invalid project name.") return False @@ -1092,6 +1098,7 @@ def export_equivalent_circuit( self.logger.error("Invalid file type, possible solutions are Hspice, Welement, RLGC.") return False + cpp_settings = [] if include_cpp: if settings.aedt_version >= "2023.2": if not [x for x in [include_dcr, include_dcl, include_acr, include_acl, add_resistance] if x]: @@ -1106,22 +1113,19 @@ def export_equivalent_circuit( if isinstance(setting, tuple): if setting[0] == "NAME:CPPInfo": cpp_settings = setting - else: - include_cpp = False - cpp_settings = [] if self.modeler._is3d: try: self.oanalysis.ExportCircuit( analysis_setup, variations, - file_name, + output_file, [ "NAME:CircuitData", "MatrixName:=", - matrix_name, + matrix, "NumberOfCells:=", - str(num_cells), + str(cells), "UserHasChangedSettings:=", user_changed_settings, "IncludeCap:=", @@ -1145,8 +1149,8 @@ def export_equivalent_circuit( include_cpp, cpp_settings, ], - model_name, - freq, + model, + frequency, ) return True except Exception: @@ -1157,13 +1161,13 @@ def export_equivalent_circuit( self.oanalysis.ExportCircuit( analysis_setup, variations, - file_name, + output_file, [ "NAME:CircuitData", "MatrixName:=", - matrix_name, + matrix, "NumberOfCells:=", - str(num_cells), + str(cells), "UserHasChangedSettings:=", user_changed_settings, "IncludeCap:=", @@ -1182,9 +1186,9 @@ def export_equivalent_circuit( "RiseTime:=", rise_time, ], - model_name, + model, file_type, - freq, + frequency, ) return True except Exception: @@ -1614,6 +1618,9 @@ def _assign_source_or_sink(self, assignment, direction, name, net_name, terminal def assign_sink_to_objectface(self, assignment, direction=0, name=None, net_name=None): """Generate a sink on a face of an object. + .. deprecated:: 0.8.9 + This method is deprecated. Use the ``sink()`` method instead. + The face ID is selected based on the axis direction. It is the face that has the maximum or minimum in this axis direction. @@ -1638,6 +1645,11 @@ def assign_sink_to_objectface(self, assignment, direction=0, name=None, net_name >>> oModule.AssignSink """ + warnings.warn( + "This method is deprecated in 0.8.9. Use the ``sink()`` method.", + DeprecationWarning, + ) + assignment = self.modeler.convert_to_selections(assignment, True)[0] if isinstance(assignment, int): a = assignment @@ -1664,6 +1676,9 @@ def assign_sink_to_sheet( ): """Generate a sink on a sheet. + .. deprecated:: 0.8.9 + This method is deprecated. Use the ``sink()`` method instead. + Parameters ---------- assignment : @@ -1687,6 +1702,11 @@ def assign_sink_to_sheet( >>> oModule.AssignSink """ + warnings.warn( + "This method is deprecated in 0.8.9. Use the ``sink()`` method.", + DeprecationWarning, + ) + if not sink_name: sink_name = generate_unique_name("Sink") assignment = self.modeler.convert_to_selections(assignment, True)[0] diff --git a/pyproject.toml b/pyproject.toml index 64ccc2854c9..0d57d7120e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "fpdf2", "jsonschema", "psutil", - "pyedb>=0.4.0,<0.5; python_version == '3.7'", + "pyedb>=0.4.0,<0.9; python_version == '3.7'", "pyedb>=0.5.0; python_version > '3.7'", "pytomlpp; python_version < '3.12'", "rpyc>=6.0.0,<6.1", @@ -48,9 +48,9 @@ tests = [ "pandas>=1.1.0,<2.3", "pytest>=7.4.0,<8.2", "pytest-cov>=4.0.0,<5.1", - "pytest-xdist>=3.5.0,<3.6", - "pyedb>=0.4.0,<0.5; python_version == '3.7'", - "pyedb>=0.5.0,<0.8; python_version > '3.7'", + "pytest-xdist>=3.5.0,<3.7", + "pyedb>=0.4.0,<0.9; python_version == '3.7'", + "pyedb>=0.5.0,<0.9; python_version > '3.7'", "pyvista>=0.38.0,<0.44", "scikit-learn>=1.0.0,<1.5", "scikit-rf>=0.30.0,<0.33",