diff --git a/src/pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py b/src/pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py index 1805f1c22c..d3f10c10a0 100644 --- a/src/pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py +++ b/src/pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py @@ -50,7 +50,10 @@ def __init__(self, pedb, edb_object=None, name: str = None, sim_setup=None): def _update_sweep(self): """Update the sweep.""" self.sim_setup.delete_frequency_sweep(self) - self.sim_setup._add_frequency_sweep(self) + ss_info = self.sim_setup.sim_setup_info + ss_info.add_sweep_data(self) + self.sim_setup.set_sim_setup_info(ss_info) + self.sim_setup._update_setup() return @property diff --git a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py index 7e3259849d..dbce4ab5d5 100644 --- a/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py +++ b/src/pyedb/dotnet/edb_core/utilities/simulation_setup.py @@ -293,10 +293,7 @@ def _add_frequency_sweep(self, sweep_data): """ warnings.warn("Use new property :func:`add_sweep_data` instead.", DeprecationWarning) self._sweep_list[sweep_data.name] = sweep_data - if self.setup_type in ["kRaptorX", "kHFSSPI"]: - edb_setup_info = self._edb_setup_info - else: - edb_setup_info = self.sim_setup_info + edb_setup_info = self.sim_setup_info if self._setup_type in ["kSIwave", "kHFSS", "kRaptorX", "kHFSSPI"]: for _, v in self._sweep_list.items(): diff --git a/tests/legacy/system/test_edb.py b/tests/legacy/system/test_edb.py index 99e4545c88..2e6fb5549d 100644 --- a/tests/legacy/system/test_edb.py +++ b/tests/legacy/system/test_edb.py @@ -929,22 +929,6 @@ def test_hfss_simulation_setup(self): hfss_port_settings.set_triangles_wave_port = True assert hfss_port_settings.set_triangles_wave_port - # mesh_operations = setup1.mesh_operations - # setup1.mesh_operations = mesh_operations - - setup1.add_sweep( - "sweep1", - frequency_set=[ - ["linear count", "0", "1kHz", 1], - ["log scale", "1kHz", "0.1GHz", 10], - ["linear scale", "0.1GHz", "10GHz", "0.1GHz"], - ], - ) - assert "sweep1" in setup1.frequency_sweeps - sweep1 = setup1.frequency_sweeps["sweep1"] - sweep1.adaptive_sampling = True - assert sweep1.adaptive_sampling - edbapp.setups["setup1"].name = "setup1a" assert "setup1" not in edbapp.setups assert "setup1a" in edbapp.setups @@ -993,6 +977,10 @@ def test_hfss_frequency_sweep(self, edb_examples): assert len(setup1.sweeps["sw1"].frequencies) == 20 setup1.sweeps["sw1"].add("log_scale", "1GHz", "10GHz", 10) assert len(setup1.sweeps["sw1"].frequencies) == 31 + + setup1.sweeps["sw1"].adaptive_sampling = True + assert setup1.sweeps["sw1"].adaptive_sampling + edbapp.close() def test_hfss_simulation_setup_b(self, edb_examples): diff --git a/tests/legacy/system/test_edb_future_features_242.py b/tests/legacy/system/test_edb_future_features_242.py index 1f7d3ac87f..7acdbb8ee8 100644 --- a/tests/legacy/system/test_edb_future_features_242.py +++ b/tests/legacy/system/test_edb_future_features_242.py @@ -154,3 +154,5 @@ def test_create_hfss_pi_setup_add_sweep(self, edb_examples): setup = edbapp.create_hfsspi_setup("test") setup.add_frequency_sweep(name="sweep1", frequency_sweep=["linear scale", "0.1GHz", "10GHz", "0.1GHz"]) assert setup.sweeps["sweep1"].frequencies + setup.sweeps["sweep1"].adaptive_sampling = True + assert setup.sweeps["sweep1"].adaptive_sampling