Skip to content

Commit

Permalink
Merge branch 'main' into 5282-Add-Missing-Circuit-Elements
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveTwyman authored Dec 11, 2024
2 parents e8431c4 + 4ab7475 commit 70600ea
Show file tree
Hide file tree
Showing 100 changed files with 11,039 additions and 7,354 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ jobs:
optional-dependencies-name: unit-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-unit-tests
file: ./coverage.xml
files: ./coverage.xml
flags: linux_unit

- name: Upload pytest test results
Expand All @@ -123,11 +122,10 @@ jobs:
optional-dependencies-name: integration-tests

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-integration-tests
file: ./coverage.xml
files: ./coverage.xml
flags: linux_integration

- name: Upload pytest test results
Expand Down Expand Up @@ -182,11 +180,10 @@ jobs:
.venv\Scripts\Activate.ps1
pytest ${{ env.PYTEST_ARGUMENTS }} -m solvers
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-solvers-tests-windows
file: ./coverage.xml
files: ./coverage.xml
flags: windows_system_solvers

- name: Upload pytest test results
Expand Down Expand Up @@ -238,11 +235,10 @@ jobs:
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -m solvers
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-solvers-tests-linux
file: ./coverage.xml
files: ./coverage.xml
flags: linux_system_solvers

- name: Upload pytest test results
Expand Down Expand Up @@ -302,11 +298,10 @@ jobs:
.venv\Scripts\Activate.ps1
pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-general-tests-windows
file: ./coverage.xml
files: ./coverage.xml
flags: windows_system_general

- name: Upload pytest test results
Expand Down Expand Up @@ -370,11 +365,10 @@ jobs:
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-general-tests
file: ./coverage.xml
files: ./coverage.xml
flags: linux_system_general

- name: Upload pytest test results
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/manual_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ jobs:
.venv\Scripts\Activate.ps1
pytest ${{ env.PYTEST_ARGUMENTS }} -m solvers
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-solvers-tests-windows
file: ./coverage.xml
files: ./coverage.xml
flags: system,solvers,windows

- name: Upload pytest test results
Expand Down Expand Up @@ -131,11 +130,10 @@ jobs:
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -m solvers
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-solvers-tests-linux
file: ./coverage.xml
files: ./coverage.xml
flags: system,solver,linux

- name: Upload pytest test results
Expand Down Expand Up @@ -191,11 +189,10 @@ jobs:
.venv\Scripts\Activate.ps1
pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-general-tests-windows
file: ./coverage.xml
files: ./coverage.xml
flags: system,general,windows

- name: Upload pytest test results
Expand Down Expand Up @@ -255,11 +252,10 @@ jobs:
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} -n 4 --dist loadfile -m general
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-system-general-tests
file: ./coverage.xml
files: ./coverage.xml
flags: system,solver,linux

- name: Upload pytest test results
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_test_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
Set-Item -Path env:PYTHONMALLOC -Value "malloc"
pytest --tx 6*popen --durations=50 --dist loadfile -v --cov=ansys.aedt.core --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html tests
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == '3.8'
Expand Down
4 changes: 4 additions & 0 deletions doc/source/Resources/pyaedt_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ aedt_env_var:
ANSYSEM_FEATURE_SF222134_CABLE_MODELING_ENHANCEMENTS_ENABLE: '1'
ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE: '1'
ANS_MESHER_PROC_DUMP_PREPOST_BEND_SM3: '1'
# Environment variable useful in Linux to skip the dependency check which improves speed
ANS_NODEPCHECK: '1'

general:
# Enable or disable the lazy load
Expand Down Expand Up @@ -120,3 +122,5 @@ general:
pyaedt_server_path: ''
# Remote temp folder
remote_rpc_session_temp_folder: ''
# Block figure plot during python script run
block_figure_plot: false
10 changes: 8 additions & 2 deletions doc/source/User_guide/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ If the environment variable is not defined, a check is performed to see if a fil
``HOME`` folder for Linux. If such file exists, it is then used to update the default
configuration.

Below is the content that can be updated through the YAML file.
Here is an example of YAML file :download:`YAML configuration file <../Resources/pyaedt_settings.yaml>`

:download:`YAML configuration file <../Resources/pyaedt_settings.yaml>`
.. warning::
In Linux, it is recommended to add the ``ANS_NODEPCHECK`` environment variable for speed reasons.
This variable is commented out in the download file. Using this file without modifying it disables
this option from the default settings behaviour.

.. note::
Not all settings from class ``Settings`` can be modified through this file
Expand All @@ -23,6 +26,7 @@ Below is the content that can be updated through the YAML file.
``Formatter`` and ``time_tick`` which expects a time value, in seconds, since the
`epoch <https://docs.python.org/3/library/time.html#epoc>`_ as a floating-point number.

Below is the content that can be updated through the YAML file.

.. code-block:: yaml
Expand Down Expand Up @@ -99,6 +103,8 @@ Below is the content that can be updated through the YAML file.
ANSYSEM_FEATURE_SF222134_CABLE_MODELING_ENHANCEMENTS_ENABLE: '1'
ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE: '1'
ANS_MESHER_PROC_DUMP_PREPOST_BEND_SM3: '1'
# Environment variable used in Linux to skip the dependency check for speed
# ANS_NODEPCHECK: '1'
general:
# Enable or disable the lazy load
Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ dependencies = [
"pyedb>=0.4.0; python_version == '3.7'",
"pyedb>=0.24.0; python_version > '3.7'",
"pyedb!=0.28.0; python_version > '3.7'",
"pytomlpp; python_version < '3.12'",
"tomli; python_version < '3.11'",
"tomli-w",
"rpyc>=6.0.0,<6.1",
"pyyaml",
"defusedxml>=0.7,<8.0"
Expand All @@ -66,7 +67,7 @@ tests = [
"mock>=5.1.0,<5.2",
"numpy>=1.20.0,<2",
"openpyxl>=3.1.0,<3.3",
"osmnx>=1.1.0,<1.10",
"osmnx>=1.1.0,<2.1",
"pandas>=1.1.0,<2.3",
"pytest>=7.4.0,<8.4",
"pytest-cov>=4.0.0,<6.1",
Expand All @@ -76,7 +77,7 @@ tests = [
"tables; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
"scikit-rf>=0.30.0,<1.6",
"SRTM.py",
"utm",
]
Expand Down Expand Up @@ -105,30 +106,30 @@ all = [
"matplotlib>=3.5.0,<3.10",
"numpy>=1.20.0,<2",
"openpyxl>=3.1.0,<3.3",
"osmnx>=1.1.0,<1.10",
"osmnx>=1.1.0,<2.1",
"pandas>=1.1.0,<2.3",
"pyvista[io]>=0.38.0,<0.45",
"fast-simplification>=0.1.7",
"ansys-tools-visualization-interface; python_version >= '3.10'",
"tables; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
"scikit-rf>=0.30.0,<1.6",
"SRTM.py",
"utm",
]
installer = [
"matplotlib>=3.5.0,<3.10",
"numpy>=1.20.0,<2",
"openpyxl>=3.1.0,<3.3",
"osmnx>=1.1.0,<1.10",
"osmnx>=1.1.0,<2.1",
"pandas>=1.1.0,<2.3",
"pyvista[io]>=0.38.0,<0.45",
"fast-simplification>=0.1.7",
"ansys-tools-visualization-interface; python_version >= '3.10'",
# Never directly imported but required when loading ML related file see #4713
"scikit-learn>=1.0.0,<1.6",
"scikit-rf>=0.30.0,<1.5",
"scikit-rf>=0.30.0,<1.6",
"SRTM.py",
"utm",
"jupyterlab>=3.6.0,<4.4",
Expand Down
33 changes: 33 additions & 0 deletions src/ansys/aedt/core/application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,36 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler


@pyaedt_function_handler()
def _get_data_model(child_object, level=-1):
import json

def _fix_dict(p_list, p_out):
for p, val in p_list.items():
if p == "properties":
for prop in val:
if "value" in prop:
p_out[prop["name"]] = prop["value"]
elif "values" in prop:
p_out[prop["name"]] = prop["values"]
else:
p_out[prop["name"]] = None
elif isinstance(val, dict):
_fix_dict(val, p_out[p])
elif isinstance(val, list):
p_out[p] = []
for el in val:
children = {}
_fix_dict(el, children)
p_out[p].append(children)
else:
p_out[p] = val

input_str = child_object.GetDataModel(level, 1, 1)
props_list = json.loads(input_str)
props = {}
_fix_dict(props_list, props)
return props
16 changes: 8 additions & 8 deletions src/ansys/aedt/core/application/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
from ansys.aedt.core.generic.general_methods import open_file
from ansys.aedt.core.generic.general_methods import pyaedt_function_handler
from ansys.aedt.core.generic.settings import settings
from ansys.aedt.core.modules.boundary import MaxwellParameters
from ansys.aedt.core.modules.boundary import NativeComponentObject
from ansys.aedt.core.modules.boundary import NativeComponentPCB
from ansys.aedt.core.modules.boundary.layout_boundary import NativeComponentObject
from ansys.aedt.core.modules.boundary.layout_boundary import NativeComponentPCB
from ansys.aedt.core.modules.boundary.maxwell_boundary import MaxwellParameters
from ansys.aedt.core.modules.design_xploration import OptimizationSetups
from ansys.aedt.core.modules.design_xploration import ParametricSetups
from ansys.aedt.core.modules.solve_setup import Setup
Expand Down Expand Up @@ -407,11 +407,9 @@ def nominal_sweep(self):
References
----------
>>> oModule.GelAllSolutionNames
>>> oModule.GetSweeps
"""

if len(self.existing_analysis_sweeps) > 1:
return self.existing_analysis_sweeps[1]
else:
Expand Down Expand Up @@ -1539,14 +1537,16 @@ def get_setup(self, name):
setup = SetupSBR(self, setuptype, name, is_new_setup=False)
elif self.design_type in ["Q3D Extractor", "2D Extractor", "HFSS"]:
setup = SetupHFSS(self, setuptype, name, is_new_setup=False)
if setup.props and setup.props.get("SetupType", "") == "HfssDrivenAuto":
if setup.properties:
if "Auto Solver Setting" in setup.properties:
setup = SetupHFSSAuto(self, 0, name, is_new_setup=False)
elif setup.props and setup.props.get("SetupType", "") == "HfssDrivenAuto":
setup = SetupHFSSAuto(self, 0, name, is_new_setup=False)
elif self.design_type in ["Maxwell 2D", "Maxwell 3D"]:
setup = SetupMaxwell(self, setuptype, name, is_new_setup=False)
else:
setup = Setup(self, setuptype, name, is_new_setup=False)
if setup.props:
self.active_setup = name
self.active_setup = name
return setup

@pyaedt_function_handler()
Expand Down
Loading

0 comments on commit 70600ea

Please sign in to comment.