Skip to content

Commit cbad1a0

Browse files
SMoraisAnsysSamuelopez-ansyspre-commit-ci[bot]myoung301
authored
REFACTOR!: Architecture to match pyansys guide lines (#4849)
Co-authored-by: Samuel Lopez <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matthew Young <[email protected]>
1 parent ca17b80 commit cbad1a0

File tree

689 files changed

+37143
-3972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

689 files changed

+37143
-3972
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.github/* @MaxJPRey @maxcapodi78 @Samuelopez-ansys
22

33
/_unittest/test_26_emit.py @jsalant22 @myoung301
4-
/pyaedt/emit.py @jsalant22 @myoung301
5-
/pyaedt/emit_core/ @jsalant22 @myoung301
6-
/pyaedt/modeler/circuits/PrimitivesEmit.py @jsalant22 @myoung301
4+
/src/ansys/aedt/core/emit.py @jsalant22 @myoung301
5+
/src/ansys/aedt/core/emit_core/ @jsalant22 @myoung301
6+
/src/ansys/aedt/core/modeler/circuits/PrimitivesEmit.py @jsalant22 @myoung301
77
/examples/07-EMIT/ @jsalant22 @myoung301

.github/workflows/ci_cd.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
- name: Import python package
6868
run: |
69-
python -c "import pyaedt; from pyaedt import __version__"
69+
python -c "import ansys.aedt.core; from ansys.aedt.core import __version__"
7070
7171
# TODO: Update to ansys/actions/doc-build@v6 once we remove examples
7272
doc-build:
@@ -93,8 +93,8 @@ jobs:
9393
- name: Retrieve PyAEDT version
9494
id: version
9595
run: |
96-
echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT
97-
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
96+
echo "PYAEDT_VERSION=$(python -c 'from ansys.aedt.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
97+
echo "PyAEDT version is: $(python -c "from ansys.aedt.core import __version__; print(__version__)")"
9898
9999
- name: Install doc build requirements
100100
run: |
@@ -166,8 +166,8 @@ jobs:
166166
id: version
167167
run: |
168168
.venv\Scripts\Activate.ps1
169-
echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT
170-
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
169+
echo "PYAEDT_VERSION=$(python -c 'from ansys.aedt.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
170+
echo "PyAEDT version is: $(python -c "from ansys.aedt.core import __version__; print(__version__)")"
171171
172172
- name: Install CI dependencies (e.g. vtk-osmesa)
173173
run: |
@@ -264,7 +264,7 @@ jobs:
264264
PYTHONMALLOC: malloc
265265
run: |
266266
.venv\Scripts\Activate.ps1
267-
pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers
267+
pytest --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers
268268
269269
- uses: codecov/codecov-action@v4
270270
with:
@@ -321,7 +321,7 @@ jobs:
321321
run: |
322322
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
323323
source .venv/bin/activate
324-
pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers
324+
pytest --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers
325325
326326
- uses: codecov/codecov-action@v4
327327
with:
@@ -385,7 +385,7 @@ jobs:
385385
timeout_minutes: 50
386386
command: |
387387
.venv\Scripts\Activate.ps1
388-
pytest -n 4 --dist loadfile --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest
388+
pytest -n 4 --dist loadfile --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest
389389
390390
- uses: codecov/codecov-action@v4
391391
with:
@@ -454,7 +454,7 @@ jobs:
454454
command: |
455455
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:${{ env.ANSYSEM_ROOT242 }}/Delcross:$LD_LIBRARY_PATH
456456
source .venv/bin/activate
457-
pytest -n 2 --dist loadfile --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest
457+
pytest -n 2 --dist loadfile --durations=50 -v --cov=ansys.aedt.core --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest
458458
459459
- uses: codecov/codecov-action@v4
460460
with:
@@ -470,38 +470,9 @@ jobs:
470470
path: junit/test-results.xml
471471
if: ${{ always() }}
472472

473-
# # =================================================================================================
474-
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
475-
# # =================================================================================================
476-
477-
test-ironpython-windows:
478-
name: Testing IronPython and coverage (Windows)
479-
needs: [smoke-tests]
480-
runs-on: [ self-hosted, Windows, pyaedt ]
481-
steps:
482-
- uses: actions/checkout@v4
483-
484-
- name: Run Ironpython tests
485-
timeout-minutes: 5
486-
run: |
487-
$processA = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd' -PassThru
488-
$processA.WaitForExit()
489-
490-
- name: Get log content
491-
run: |
492-
get-content .\_unittest_ironpython\pyaedt_unit_test_ironpython.log
493-
494-
- name: Check for errors
495-
run: |
496-
$test_errors_failures = Select-String -Path .\_unittest_ironpython\pyaedt_unit_test_ironpython.log -Pattern "TextTestResult errors="
497-
if ($test_errors_failures -ne $null)
498-
{
499-
exit 1
500-
}
501-
502473
package:
503474
name: Package library
504-
needs: [test-windows, test-solvers-windows, test-ironpython-windows, test-linux, test-solvers-linux, doc-build]
475+
needs: [test-windows, test-solvers-windows, test-linux, test-solvers-linux, doc-build]
505476
runs-on: ubuntu-latest
506477
steps:
507478
- name: Build library source and wheel artifacts
@@ -556,8 +527,8 @@ jobs:
556527

557528
- name: Get the version to PyMeilisearch
558529
run: |
559-
VERSION=$(python -c "from pyaedt import __version__; print('.'.join(__version__.split('.')[:2]))")
560-
VERSION_MEILI=$(python -c "from pyaedt import __version__; print('-'.join(__version__.split('.')[:2]))")
530+
VERSION=$(python -c "from ansys.aedt.core import __version__; print('.'.join(__version__.split('.')[:2]))")
531+
VERSION_MEILI=$(python -c "from ansys.aedt.core import __version__; print('-'.join(__version__.split('.')[:2]))")
561532
echo "Calculated VERSION: $VERSION"
562533
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
563534
echo "VERSION=$VERSION" >> $GITHUB_ENV

.github/workflows/nightly-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
id: version
5050
run: |
5151
.venv\Scripts\Activate.ps1
52-
echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT
53-
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
52+
echo "PYAEDT_VERSION=$(python -c 'from ansys.aedt.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
53+
echo "PyAEDT version is: $(python -c "from ansys.aedt.core import __version__; print(__version__)")"
5454
5555
- name: Install CI dependencies (e.g. vtk-osmesa)
5656
run: |

.github/workflows/unit_test_prerelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
Copy-Item -Path "C:\actions-runner\local_config.json" -Destination "_unittest" -Force
6262
mkdir tmp
6363
cd tmp
64-
python -c "import pyaedt; print('Imported pyaedt')"
64+
python -c "import ansys.aedt.core; print('Imported pyaedt')"
6565
6666
# - name: "Check licences of packages"
6767
# uses: pyansys/pydpf-actions/[email protected]
@@ -71,7 +71,7 @@ jobs:
7171
run: |
7272
testenv\Scripts\Activate.ps1
7373
Set-Item -Path env:PYTHONMALLOC -Value "malloc"
74-
pytest --tx 6*popen --durations=50 --dist loadfile -v --cov=pyaedt --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html _unittest
74+
pytest --tx 6*popen --durations=50 --dist loadfile -v --cov=ansys.aedt.core --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html _unittest
7575
7676
- uses: codecov/codecov-action@v4
7777
env:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ doc/build_errors.txt
361361
_autosummary/
362362

363363
# pip files
364-
*.egg-info/*
364+
*.egg-info*
365365
build/
366366
dist/
367367

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
files: |
22
(?x)(
3-
^pyaedt/|
3+
^src/ansys/aedt/core/|
44
_unittest/
55
)
66
exclude: |
77
(?x)(
8-
^pyaedt/rpc/|
9-
^pyaedt/sbrplus/matlab/|
10-
pyaedt/conftest.py|
8+
^src/ansys/aedt/core/rpc/|
9+
^src/ansys/aedt/core/sbrplus/matlab/|
1110
_unittest/example_models/
1211
)
1312
@@ -69,7 +68,7 @@ repos:
6968
rev: v0.4.3
7069
hooks:
7170
- id: add-license-headers
72-
files: '(pyaedt|examples|_unittest|_unittest_ironpython|_unittest_solvers)/.*\.(py)'
71+
files: '(src|examples|_unittest|_unittest_ironpython|_unittest_solvers)/.*\.(py)'
7372
args:
7473
- --custom_template=mit_license.jinja2
7574
- --start_year=2021

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global-include ansys.aedt.core *.txt *.md *.toml *.json *.png *.xml *.areg *.joblib *.acf *.m *.ipynb *.py_build

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Simple makefile to simplify repetitive build env management tasks under posix
22

3-
CODESPELL_DIRS ?= ./pyaedt
4-
CODESPELL_SKIP ?= "*.pyc,*.aedt,*.xml,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./docs/build/*,./docs/images/*,./dist/*,*~,.hypothesis*,./pyaedt/third_party,./docs/source/examples/*,*cover,*.dat,*.mac,\#*,PKG-INFO,*.mypy_cache/*,*.xml,*.aedt,*.svg"
3+
CODESPELL_DIRS ?= ./src/ansys/aedt/core
4+
CODESPELL_SKIP ?= "*.pyc,*.aedt,*.xml,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./docs/build/*,./docs/images/*,./dist/*,*~,.hypothesis*,./src/ansys/aedt/core/third_party,./docs/source/examples/*,*cover,*.dat,*.mac,\#*,PKG-INFO,*.mypy_cache/*,*.xml,*.aedt,*.svg"
55
CODESPELL_IGNORE ?= "ignore_words.txt"
66

77
all: doctest flake8

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Usage examples follow.
203203
``` python
204204
# Launch AEDT 2022 R2 in non-graphical mode
205205

206-
from pyaedt import Desktop, Circuit
206+
from ansys.aedt.core import Desktop, Circuit
207207
with Desktop(specified_version="2022.2",
208208
non_graphical=False, new_desktop_session=True,
209209
close_on_exit=True, student_version=False):
@@ -220,7 +220,7 @@ Usage examples follow.
220220
``` python
221221
# Launch the latest installed version of AEDT in graphical mode
222222

223-
from pyaedt import Circuit
223+
from ansys.aedt.core import Circuit
224224
with Circuit(specified_version="2022.2",
225225
non_graphical=False) as circuit:
226226
...
@@ -240,14 +240,14 @@ On a CPython Server:
240240
``` python
241241
# Launch PyAEDT remote server on CPython
242242

243-
from pyaedt.common_rpc import pyaedt_service_manager
243+
from ansys.aedt.core.common_rpc import pyaedt_service_manager
244244
pyaedt_service_manager()
245245
```
246246

247247
On any Windows client machine:
248248

249249
``` python
250-
from pyaedt.common_rpc import create_session
250+
from ansys.aedt.core.common_rpc import create_session
251251
cl1 = create_session("server_name")
252252
cl1.aedt(port=50000, non_graphical=False)
253253
hfss = Hfss(machine="server_name", port=50000)
@@ -257,7 +257,7 @@ On any Windows client machine:
257257
## Variables
258258

259259
``` python
260-
from pyaedt.HFSS import HFSS
260+
from ansys.aedt.core.HFSS import HFSS
261261
with HFSS as hfss:
262262
hfss["dim"] = "1mm" # design variable
263263
hfss["$dim"] = "1mm" # project variable
@@ -268,7 +268,7 @@ On any Windows client machine:
268268
``` python
269269
# Create a box, assign variables, and assign materials.
270270

271-
from pyaedt.hfss import Hfss
271+
from ansys.aedt.core.hfss import Hfss
272272
with Hfss as hfss:
273273
hfss.modeler.create_box([0, 0, 0], [10, "dim", 10],
274274
"mybox", "aluminum")

README_CN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pip install pyaedt[all]
132132
``` python
133133
# 以非图形模式启动 AEDT 2022 R2
134134

135-
from pyaedt import Desktop, Circuit
135+
from ansys.aedt.core import Desktop, Circuit
136136
with Desktop(specified_version="2022.2",
137137
non_graphical=False, new_desktop_session=True,
138138
close_on_exit=True, student_version=False):
@@ -149,7 +149,7 @@ pip install pyaedt[all]
149149
``` python
150150
# Launch the latest installed version of AEDT in graphical mode
151151

152-
from pyaedt import Circuit
152+
from ansys.aedt.core import Circuit
153153
with Circuit(specified_version="2022.2",
154154
non_graphical=False) as circuit:
155155
...
@@ -168,14 +168,14 @@ CPython 服务器:
168168
``` python
169169
# 在CPython上启动PyAEDT远程服务器
170170

171-
from pyaedt.common_rpc import pyaedt_service_manager
171+
from ansys.aedt.core.common_rpc import pyaedt_service_manager
172172
pyaedt_service_manager()
173173
```
174174

175175
任意的 Windows 客户端:
176176

177177
``` python
178-
from pyaedt.common_rpc import create_session
178+
from ansys.aedt.core.common_rpc import create_session
179179
cl1 = create_session("server_name")
180180
cl1.aedt(port=50000, non_graphical=False)
181181
hfss = Hfss(machine="server_name", port=50000)
@@ -185,7 +185,7 @@ CPython 服务器:
185185
## 变量 Variables
186186

187187
``` python
188-
from pyaedt.HFSS import HFSS
188+
from ansys.aedt.core.HFSS import HFSS
189189
with HFSS as hfss:
190190
hfss["dim"] = "1mm" # design variable
191191
hfss["$dim"] = "1mm" # project variable
@@ -196,7 +196,7 @@ CPython 服务器:
196196
``` python
197197
# 创建BOX、分配变量和指定材料。
198198

199-
from pyaedt.hfss import Hfss
199+
from ansys.aedt.core.hfss import Hfss
200200
with Hfss as hfss:
201201
hfss.modeler.create_box([0, 0, 0], [10, "dim", 10],
202202
"mybox", "aluminum")

0 commit comments

Comments
 (0)