-
Notifications
You must be signed in to change notification settings - Fork 65
feat: RF GUI <-> python
client interoperabilty
#2738
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule faq
updated
16 files
Submodule notebooks
updated
19 files
+1,149 −363 | AdvancedGaussianSources.ipynb | |
+233 −92 | GUIDataTutorial.ipynb | |
+412 −84 | GroundedCPWViaFence.ipynb | |
+3 −3 | SiWaveguideTPA.ipynb | |
+1,691 −0 | WPDHarmonicSuppression1.ipynb | |
+1,643 −0 | WPDHarmonicSuppression2.ipynb | |
+1,382 −0 | WPDHarmonicSuppression3.ipynb | |
+3 −0 | docs/case_studies/microwave.rst | |
+ − | img/wpdhs_1_render.png | |
+ − | img/wpdhs_1_schematic.png | |
+ − | img/wpdhs_1_schematic_2.png | |
+ − | img/wpdhs_2_render.png | |
+ − | img/wpdhs_2_schematic.png | |
+ − | img/wpdhs_3_render.png | |
+ − | img/wpdhs_3_schematic.png | |
+7 −4 | misc/import_file_mapping.json | |
+401 −0 | misc/wpd-part1-fem.csv | |
+601 −0 | misc/wpd-part2-fem.csv | |
+601 −0 | misc/wpd-part3-fem.csv |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from __future__ import annotations | ||
|
||
import collections.abc | ||
|
||
import pydantic.v1 as pydantic | ||
import pytest | ||
|
||
from tidy3d import SimulationMap | ||
|
||
from ..utils import SAMPLE_SIMULATIONS | ||
|
||
# Reusable test constants | ||
SIM_MAP_DATA = { | ||
"sim_A": SAMPLE_SIMULATIONS["full_fdtd"], | ||
"sim_B": SAMPLE_SIMULATIONS["full_fdtd"].updated_copy(run_time=2e-12), | ||
} | ||
|
||
|
||
def make_simulation_map() -> SimulationMap: | ||
"""Factory function to create a standard SimulationMap instance.""" | ||
return SimulationMap(keys=tuple(SIM_MAP_DATA.keys()), values=tuple(SIM_MAP_DATA.values())) | ||
|
||
|
||
def test_simulation_map_creation(): | ||
"""Tests successful creation and basic properties of a SimulationMap.""" | ||
s_map = make_simulation_map() | ||
assert isinstance(s_map, collections.abc.Mapping) | ||
assert len(s_map) == len(SIM_MAP_DATA) | ||
assert s_map["sim_A"] == SIM_MAP_DATA["sim_A"] | ||
assert list(s_map.keys()) == list(SIM_MAP_DATA.keys()) | ||
|
||
|
||
def test_simulation_map_invalid_type_raises_error(): | ||
"""Tests that a ValidationError is raised for incorrect value types.""" | ||
invalid_data = {"sim_A": "not a simulation"} | ||
with pytest.raises(pydantic.ValidationError): | ||
SimulationMap(keys=tuple(invalid_data.keys()), values=tuple(invalid_data.values())) | ||
|
||
|
||
def test_simulation_map_getitem_success(): | ||
"""Tests successful retrieval of a simulation by its string key.""" | ||
s_map = make_simulation_map() | ||
assert s_map["sim_A"] == SIM_MAP_DATA["sim_A"] | ||
assert s_map["sim_B"] == SIM_MAP_DATA["sim_B"] | ||
|
||
|
||
def test_simulation_map_getitem_key_error(): | ||
"""Tests that a KeyError is raised when retrieving a non-existent key.""" | ||
s_map = make_simulation_map() | ||
with pytest.raises(KeyError): | ||
_ = s_map["not_a_real_key"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from __future__ import annotations | ||
|
||
import collections.abc | ||
|
||
import pydantic.v1 as pydantic | ||
import pytest | ||
|
||
from tidy3d import SimulationDataMap | ||
|
||
from ..utils import SAMPLE_SIMULATIONS, run_emulated | ||
|
||
# Reusable test constants | ||
# Base simulation data is needed to generate the SimulationData objects | ||
SIM_MAP_DATA = { | ||
"sim_A": SAMPLE_SIMULATIONS["full_fdtd"], | ||
"sim_B": SAMPLE_SIMULATIONS["full_fdtd"].updated_copy(run_time=2e-12), | ||
} | ||
|
||
# Generate SimulationData once to be reused | ||
SIM_DATA_MAP_DATA = { | ||
"data_A": run_emulated(SIM_MAP_DATA["sim_A"]), | ||
"data_B": run_emulated(SIM_MAP_DATA["sim_B"]), | ||
} | ||
|
||
|
||
def make_simulation_data_map() -> SimulationDataMap: | ||
"""Factory function to create a standard SimulationDataMap instance.""" | ||
return SimulationDataMap( | ||
keys=tuple(SIM_DATA_MAP_DATA.keys()), values=tuple(SIM_DATA_MAP_DATA.values()) | ||
) | ||
|
||
|
||
def test_simulation_data_map_creation(): | ||
"""Tests successful creation and basic properties of a SimulationDataMap.""" | ||
sd_map = make_simulation_data_map() | ||
assert isinstance(sd_map, collections.abc.Mapping) | ||
assert len(sd_map) == len(SIM_DATA_MAP_DATA) | ||
assert sd_map["data_A"] == SIM_DATA_MAP_DATA["data_A"] | ||
assert list(sd_map.keys()) == list(SIM_DATA_MAP_DATA.keys()) | ||
|
||
|
||
def test_simulation_data_map_invalid_type_raises_error(): | ||
"""Tests that a ValidationError is raised for incorrect value types.""" | ||
invalid_data = {"data_A": "not simulation data"} | ||
with pytest.raises(pydantic.ValidationError): | ||
SimulationDataMap(keys=tuple(invalid_data.keys()), values=tuple(invalid_data.values())) | ||
|
||
|
||
def test_simulation_data_map_getitem_success(): | ||
"""Tests successful retrieval of simulation data by its string key.""" | ||
sd_map = make_simulation_data_map() | ||
assert sd_map["data_A"] == SIM_DATA_MAP_DATA["data_A"] | ||
assert sd_map["data_B"] == SIM_DATA_MAP_DATA["data_B"] | ||
|
||
|
||
def test_simulation_data_map_getitem_key_error(): | ||
"""Tests that a KeyError is raised when retrieving a non-existent key.""" | ||
sd_map = make_simulation_data_map() | ||
with pytest.raises(KeyError): | ||
_ = sd_map["not_a_real_key"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.