Skip to content

Commit

Permalink
Merge branch 'main' into release/0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Mar 7, 2024
2 parents 3063cd3 + 8730a2b commit 651d8dc
Show file tree
Hide file tree
Showing 33 changed files with 944 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = venv, __init__.py, doc/_build, doc/source/examples, pyaedt/third_party/**/*
exclude = venv, __init__.py, doc/_build, doc/source/examples
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
count = True
max-complexity = 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheelhouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
python -m pip install pip -U
python -m pip install wheel setuptools -U
python -c "import sys; print(sys.executable)"
pip install .[all]
pip install .[all,dotnet]
pip install jupyterlab
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheelhouse_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Install pyaedt
run: |
pip install .[all]
pip install .[all,dotnet]
pip install jupyterlab
- name: Verify pyaedt can be imported
Expand Down
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ files: |
)
exclude: |
(?x)(
^pyaedt/dlls/|
^pyaedt/rpc/|
^pyaedt/sbrplus/matlab/|
^pyaedt/third_party/|
pyaedt/conftest.py|
_unittest/example_models/
)
Expand Down
26 changes: 26 additions & 0 deletions _unittest/test_21_Circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ def test_42_create_wire(self):
self.aedtapp.insert_design("CreateWireTest")
myind = self.aedtapp.modeler.schematic.create_inductor("L101", location=[0.02, 0.0])
myres = self.aedtapp.modeler.schematic.create_resistor("R101", location=[0.0, 0.0])
myres2 = self.aedtapp.modeler.components.get_component(myres.composed_name)
self.aedtapp.modeler.schematic.create_wire(
[myind.pins[0].location, myres.pins[1].location], wire_name="wire_name_test"
)
Expand Down Expand Up @@ -809,3 +810,28 @@ def test_45_create_circuit_from_multizone_layout(self, add_edb):
self.aedtapp.insert_design("test_45")
self.aedtapp.connect_circuit_models_from_multi_zone_cutout(project_connexions, edb_zones, defined_ports)
assert [mod for mod in list(self.aedtapp.modeler.schematic.components.values()) if "PagePort" in mod.name]
assert self.aedtapp.remove_all_unused_definitions()

def test_46_create_vpwl(self):

# default inputs
myres = self.aedtapp.modeler.schematic.create_voltage_pwl(compname="V1")
assert myres.refdes != ""
assert type(myres.id) is int
assert myres.parameters["time1"] == "0s"
assert myres.parameters["time2"] == "0s"
assert myres.parameters["val1"] == "0V"
assert myres.parameters["val2"] == "0V"
# time and voltage input list
myres = self.aedtapp.modeler.schematic.create_voltage_pwl(
compname="V2", time_list=[0, "1u"], voltage_list=[0, 1]
)
assert myres.refdes != ""
assert type(myres.id) is int
assert myres.parameters["time1"] == "0"
assert myres.parameters["time2"] == "1u"
assert myres.parameters["val1"] == "0"
assert myres.parameters["val2"] == "1"
# time and voltage different length
myres = self.aedtapp.modeler.schematic.create_voltage_pwl(compname="V3", time_list=[0], voltage_list=[0, 1])
assert myres is False
11 changes: 11 additions & 0 deletions _unittest/test_44_TouchstoneParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ def test_02_read_ts_file(self):

assert ts1.plot_insertion_losses(plot=False)
assert ts1.get_worst_curve(curve_list=ts1.get_return_loss_index(), plot=False)

def test_03_check_touchstone_file(self):
from pyaedt.generic.touchstone_parser import check_touchstone_files

check = check_touchstone_files(folder=test_T44_dir)
assert check
for k, v in check.items():
if v[0] == "passivity":
assert v[1]
elif v[0] == "causality":
assert not v[1]
35 changes: 22 additions & 13 deletions _unittest_solvers/test_26_emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from pyaedt.modeler.circuits.PrimitivesEmit import EmitComponent
from pyaedt.modeler.circuits.PrimitivesEmit import EmitComponents

test_subfolder = "T26"
TEST_SUBFOLDER = "T26"
TEST_REVIEW_FLAG = True


@pytest.fixture(scope="class")
Expand Down Expand Up @@ -933,11 +934,11 @@ def test_17_availability_1_to_1(self, add_app):
assert len(radiosRX) == 2

@pytest.mark.skipif(
config["desktopVersion"] <= "2023.1",
config["desktopVersion"] <= "2023.1" or TEST_REVIEW_FLAG,
reason="Skipped on versions earlier than 2023.2",
)
def test_18_interference_scripts_no_filter(self, add_app):
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=TEST_SUBFOLDER)

# Generate a revision
rev = self.aedtapp.results.analyze()
Expand All @@ -963,8 +964,12 @@ def test_18_interference_scripts_no_filter(self, add_app):
assert protection_colors == expected_protection_colors
assert protection_power_matrix == expected_protection_power

@pytest.mark.skipif(
TEST_REVIEW_FLAG,
reason="Test under review in 2024.1",
)
def test_19_radio_protection_levels(self, add_app):
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=TEST_SUBFOLDER)

# Generate a revision
rev = self.aedtapp.results.analyze()
Expand All @@ -990,11 +995,11 @@ def test_19_radio_protection_levels(self, add_app):
assert protection_power_matrix == expected_protection_power

@pytest.mark.skipif(
config["desktopVersion"] <= "2023.1",
config["desktopVersion"] <= "2023.1" or TEST_REVIEW_FLAG,
reason="Skipped on versions earlier than 2023.2",
)
def test_20_interference_filtering(self, add_app):
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=TEST_SUBFOLDER)
# Generate a revision
rev = self.aedtapp.results.analyze()

Expand Down Expand Up @@ -1033,8 +1038,12 @@ def test_20_interference_filtering(self, add_app):
assert interference_colors == expected_interference_colors
assert interference_power_matrix == expected_interference_power

@pytest.mark.skipif(
TEST_REVIEW_FLAG,
reason="Test under review in 2024.1",
)
def test_21_protection_filtering(self, add_app):
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=TEST_SUBFOLDER)

# Generate a revision
rev = self.aedtapp.results.analyze()
Expand Down Expand Up @@ -1082,7 +1091,7 @@ def test_21_protection_filtering(self, add_app):

@pytest.mark.skipif(config["desktopVersion"] <= "2022.1", reason="Skipped on versions earlier than 2021.2")
def test_22_couplings(self, add_app):
self.aedtapp = add_app(project_name="Cell Phone RFI Desense", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="Cell Phone RFI Desense", application=Emit, subfolder=TEST_SUBFOLDER)

links = self.aedtapp.couplings.linkable_design_names
assert len(links) == 0
Expand All @@ -1104,7 +1113,7 @@ def test_22_couplings(self, add_app):

self.aedtapp.close_project()

self.aedtapp = add_app(project_name="Tutorial 4 - Completed", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="Tutorial 4 - Completed", application=Emit, subfolder=TEST_SUBFOLDER)

# test CAD nodes
cad_nodes = self.aedtapp.couplings.cad_nodes
Expand Down Expand Up @@ -1174,7 +1183,7 @@ def test_23_result_categories(self, add_app):
config["desktopVersion"] < "2024.2", reason="Skipped on versions earlier than 2024 R2."
)
def test_24_license_session(self, add_app):
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=test_subfolder)
self.aedtapp = add_app(project_name="interference", application=Emit, subfolder=TEST_SUBFOLDER)

# Generate a revision
results = self.aedtapp.results
Expand All @@ -1198,8 +1207,8 @@ def do_run():
dot_ansys_directory = os.path.join(appdata_local_path, '.ansys')

license_file_path = ''
with os.scandir(dot_ansys_directory) as dir:
for file in dir:
with os.scandir(dot_ansys_directory) as directory:
for file in directory:
filename_pieces = file.name.split('.')
# Since machine names can contain periods, there may be over five splits here
# We only care about the first split and last three splits
Expand Down Expand Up @@ -1244,7 +1253,7 @@ def count_license_actions(license_file_path):
for i in range(number_of_runs):
do_run()

# Run with license session
# Run with license session
with revision.get_license_session():
for i in range(number_of_runs):
do_run()
Expand Down
5 changes: 0 additions & 5 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ coverage:
- "examples" # ignore folders and all its contents
- "_unittest" # ignore folders and all its contents
- "_unittest_ironpython" # ignore folders and all its contents
- "pyaedt/third_party/**/*.py" # ignore folders and all its contents
- "pyaedt/rpc/**/*.py" # ignore folders and all its contents
- "pyaedt/generic/toolkit.py" # ignore folders and all its contents
- "pyaedt/doctest_fixtures/*.py" # ignore folders and all its contents
- "pyaedt/setup.py" # ignore folders and all its contents
- "pyaedt/setup-distutils.py" # ignore folders and all its contents
- "pyaedt/_setup_common.py" # ignore folders and all its contents
- "pyaedt/misc/*.py" # ignore folders and all its contents
- "pyaedt/sbrplus/hdm_utils.py" # ignore folder and all its contents
6 changes: 3 additions & 3 deletions doc/source/API/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
========
AEDT API
========
=============
API reference
=============

This section describes PyAEDT core classes, methods, and functions
for AEDT apps and modules. Use the search feature or click links
Expand Down
12 changes: 12 additions & 0 deletions doc/source/Getting_started/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ You can also install PyAEDT from Conda-Forge:
conda install -c conda-forge pyaedt
To ensure you have all the necessary dependencies, including optional components, use the following command:

.. code:: python
pip install pyaedt[all]
If you are not utilizing gRPC, you can install the required dotnet dependencies separately:

.. code:: python
pip install pyaedt[dotnet]
Linux support
~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/source/Resources/PyAEDTInstallerFromDesktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def install_pyaedt():
zip_ref.extractall(unzipped_path)

run_command(
'"{}" install --no-cache-dir --no-index --find-links={} pyaedt[all]'.format(pip_exe, unzipped_path))
'"{}" install --no-cache-dir --no-index --find-links={} pyaedt[all,dotnet]'.format(pip_exe, unzipped_path))
run_command(
'"{}" install --no-cache-dir --no-index --find-links={} jupyterlab'.format(pip_exe, unzipped_path))

Expand Down
Binary file added doc/source/_static/virtual_compliance_class.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/virtual_compliance_configs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/virtual_compliance_eye.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/virtual_compliance_usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DesignXploration
docstring
[Dd]ocstrings
doppler
dotnet
EDB
EDT
efields
Expand Down
Loading

0 comments on commit 651d8dc

Please sign in to comment.