Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: freq sweep #665

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/pyedb/dotnet/edb_core/sim_setup_data/data/sweep_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/pyedb/dotnet/edb_core/utilities/simulation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
20 changes: 4 additions & 16 deletions tests/legacy/system/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions tests/legacy/system/test_edb_future_features_242.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading