Skip to content

Commit

Permalink
Merge branch 'main' into fix_export_to_q3d
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys authored May 3, 2024
2 parents 0d19fa9 + 9c4ba60 commit 7435249
Show file tree
Hide file tree
Showing 12 changed files with 1,111 additions and 641 deletions.
5 changes: 3 additions & 2 deletions _unittest/test_01_Design.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pyaedt import Hfss3dLayout
from pyaedt import Icepak
from pyaedt import get_pyaedt_app
from pyaedt.application.Design import DesignSettings
from pyaedt.application.aedt_objects import AedtObjects
from pyaedt.application.design_solutions import model_names
from pyaedt.generic.general_methods import is_linux
Expand Down Expand Up @@ -418,9 +419,9 @@ def test_39_load_project(self, desktop):

def test_40_get_design_settings(self, add_app):
ipk = add_app(application=Icepak)
design_settings_dict = ipk.design_settings()
design_settings_dict = ipk.design_settings

assert isinstance(design_settings_dict, dict)
assert isinstance(design_settings_dict, DesignSettings)
assert "AmbTemp" in design_settings_dict
assert "AmbRadTemp" in design_settings_dict
assert "GravityVec" in design_settings_dict
Expand Down
30 changes: 28 additions & 2 deletions _unittest/test_98_Icepak.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def test_14_edit_design_settings(self):
assert self.aedtapp.edit_design_settings(gravity_dir=3)
assert self.aedtapp.edit_design_settings(ambtemp=20)
assert self.aedtapp.edit_design_settings(ambtemp="325kel")
self.aedtapp.solution_type = "Transient"
bc = self.aedtapp.create_linear_transient_assignment("0.01cel", "5")
assert self.aedtapp.edit_design_settings(ambtemp=bc)

def test_15_insert_new_icepak(self):
self.aedtapp.insert_design("Solve")
Expand Down Expand Up @@ -404,6 +407,7 @@ def test_33_create_source(self):
assert self.aedtapp.create_source_power(self.aedtapp.modeler["boxSource"].top_face_z.id, input_power="2W")
assert self.aedtapp.create_source_power(
self.aedtapp.modeler["boxSource"].bottom_face_z.id,
input_power="0W",
thermal_condtion="Fixed Temperature",
temperature="28cel",
)
Expand All @@ -426,6 +430,7 @@ def test_33_create_source(self):
voltage_current_choice="Current",
voltage_current_value="1A",
)
self.aedtapp.solution_type = "SteadyState"
assert not self.aedtapp.assign_source(
self.aedtapp.modeler["boxSource"].top_face_x.id,
"Total Power",
Expand Down Expand Up @@ -950,7 +955,6 @@ def test_54_assign_stationary_wall(self):
thickness="0mm",
material="Al-Extruded",
htc=10,
htc_dataset=None,
ref_temperature="AmbientTemp",
ht_correlation=True,
ht_correlation_type="Forced Convection",
Expand All @@ -966,7 +970,7 @@ def test_54_assign_stationary_wall(self):
name=None,
thickness="0mm",
material="Al-Extruded",
htc_dataset="ds1",
htc="ds1",
ref_temperature="AmbientTemp",
ht_correlation=False,
)
Expand Down Expand Up @@ -1583,3 +1587,25 @@ def test_74_boundary_conditions_dictionaries(self):
def test_75_native_component_load(self, add_app):
app = add_app(application=Icepak, project_name=native_import, subfolder=test_subfolder)
assert len(app.native_components) == 1

def test_76_design_settings(self):
d = self.aedtapp.design_settings
d["AmbTemp"] = 5
assert d["AmbTemp"] == "5cel"
d["AmbTemp"] = "5kel"
assert d["AmbTemp"] == "5kel"
d["AmbTemp"] = {"1": "2"}
assert d["AmbTemp"] == "5kel"
d["AmbGaugePressure"] = 5
assert d["AmbGaugePressure"] == "5n_per_meter_sq"
d["GravityVec"] = 1
assert d["GravityVec"] == "Global::Y"
assert d["GravityDir"] == "Positive"
d["GravityVec"] = 4
assert d["GravityVec"] == "Global::Y"
assert d["GravityDir"] == "Negative"
d["GravityVec"] = "+X"
assert d["GravityVec"] == "Global::X"
assert d["GravityDir"] == "Positive"
d["GravityVec"] = "Global::Y"
assert d["GravityVec"] == "Global::Y"
5 changes: 4 additions & 1 deletion _unittest_solvers/test_00_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def test_07_export_maxwell_fields(self, m3dtransient):
new_setup.props = setup.props
new_setup.update()

@pytest.mark.skipif(is_linux and desktop_version == "2024.1", reason="Temporary skip for SPISIM related tests")
def test_08_compute_erl(self, circuit_erl):
touchstone_file = circuit_erl.export_touchstone()
spisim = SpiSim(touchstone_file)
Expand All @@ -452,6 +453,7 @@ def test_08_compute_erl(self, circuit_erl):
erl_data_3 = spisim.compute_erl(specify_through_ports=[1, 2, 3, 4])
assert erl_data_3

@pytest.mark.skipif(is_linux and desktop_version == "2024.1", reason="Temporary skip for SPISIM related tests")
def test_09a_compute_com(self, local_scratch, circuit_com):
touchstone_file = circuit_com.export_touchstone()
spisim = SpiSim(touchstone_file)
Expand All @@ -464,6 +466,7 @@ def test_09a_compute_com(self, local_scratch, circuit_com):
)
assert com

@pytest.mark.skipif(is_linux and desktop_version == "2024.1", reason="Temporary skip for SPISIM related tests")
def test_09b_compute_com(self, local_scratch):
com_example_file_folder = os.path.join(local_path, "example_models", test_subfolder, "com_unit_test_sparam")
thru_s4p = local_scratch.copyfile(os.path.join(com_example_file_folder, "SerDes_Demo_02_Thru.s4p"))
Expand Down Expand Up @@ -503,7 +506,7 @@ def test_09b_compute_com(self, local_scratch):
)
assert com_0 and com_1


@pytest.mark.skipif(is_linux and desktop_version == "2024.1", reason="Temporary skip for SPISIM related tests")
def test_09c_compute_com(self, local_scratch):
com_example_file_folder = Path(local_path) / "example_models" / test_subfolder / "com_unit_test_sparam"
thru_s4p = local_scratch.copyfile(com_example_file_folder / "SerDes_Demo_02_Thru.s4p")
Expand Down
2 changes: 1 addition & 1 deletion _unittest_solvers/test_26_emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ def test_22_couplings(self, add_app):
)
def test_23_result_categories(self, add_app):
# set up project and run
self.aedtapp = add_app(application=Emit)
self.aedtapp = add_app(application=Emit, project_name=generate_unique_project_name())
rad1 = self.aedtapp.modeler.components.create_component("GPS Receiver")
ant1 = self.aedtapp.modeler.components.create_component("Antenna")
ant1.move_and_connect_to(rad1)
Expand Down
19 changes: 0 additions & 19 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def setup(app):
"sphinx.ext.coverage",
"sphinx_copybutton",
"sphinx_design",
"sphinx_jinja",
"sphinx.ext.graphviz",
"sphinx.ext.mathjax",
"sphinx.ext.inheritance_diagram",
Expand Down Expand Up @@ -296,24 +295,6 @@ def setup(app):
# "set_plot_theme('document')"),
}

jinja_contexts = {
"main_toctree": {
"run_examples": config["run_examples"],
},
}
# def prepare_jinja_env(jinja_env) -> None:
# """
# Customize the jinja env.
#
# Notes
# -----
# See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
# """
# jinja_env.globals["project_name"] = project
#
#
# autoapi_prepare_jinja_env = prepare_jinja_env

# -- Options for HTML output -------------------------------------------------
html_short_title = html_title = "PyAEDT"
html_theme = "ansys_sphinx_theme"
Expand Down
39 changes: 15 additions & 24 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,24 @@ enabling straightforward and efficient automation in your workflow.
This section contains descriptions of the functions and modules included in PyAEDT.
It describes how the methods work and the parameters that can be used.

.. jinja:: main_toctree

.. grid:: 2

{% if run_examples %}
.. grid-item-card:: Examples :fa:`scroll`
:link: examples/index
:link-type: doc
.. grid-item-card:: Examples :fa:`scroll`
:link: examples/index
:link-type: doc

Explore examples that show how to use PyAEDT to perform different types of simulations.

{% endif %}
Explore examples that show how to use PyAEDT to perform different types of simulations.

.. grid-item-card:: Contribute :fa:`people-group`
:link: Getting_started/Contributing
:link-type: doc
.. grid:: 2

Learn how to contribute to the PyAEDT codebase or documentation.
.. grid-item-card:: Contribute :fa:`people-group`
:link: Getting_started/Contributing
:link-type: doc

.. jinja:: main_toctree
Learn how to contribute to the PyAEDT codebase or documentation.

.. toctree::
:hidden:
.. toctree::
:hidden:

Getting_started/index
User_guide/index
API/index
{% if run_examples %}
examples/index
{% endif %}
Getting_started/index
User_guide/index
API/index
examples/index
Loading

0 comments on commit 7435249

Please sign in to comment.