Skip to content

Commit 1dd2cdb

Browse files
authored
Merge branch 'master' into doc/new-tutorials-section
2 parents 97f32dc + 22f0d8d commit 1dd2cdb

File tree

795 files changed

+4637
-4468
lines changed

Some content is hidden

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

795 files changed

+4637
-4468
lines changed

.ci/code_generation.py

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,9 @@
55
import os
66
import glob
77
from pathlib import Path
8-
import time
98
import shutil
109

1110

12-
core.set_default_server_context(core.AvailableServerContexts.premium)
13-
14-
if os.name == "posix":
15-
LIB_TO_GENERATE = [
16-
"libAns.Dpf.Native.so",
17-
"libAns.Dpf.FEMutils.so",
18-
"libmapdlOperatorsCore.so",
19-
"libmeshOperatorsCore.so",
20-
"libAns.Dpf.Math.so",
21-
"libAns.Dpf.Hdf5.so",
22-
"libAns.Dpf.LSDYNAHGP.so",
23-
"libAns.Dpf.LivePost.so",
24-
"libans.dpf.pointcloudsearch.so",
25-
"libAns.Dpf.Vtk.so",
26-
"libAns.Dpf.MechanicalResults.so",
27-
]
28-
LIB_OPTIONAL_TO_GENERATE = [
29-
"libAns.Dpf.SystemCouplingMapping.so",
30-
]
31-
else:
32-
LIB_TO_GENERATE = [
33-
"Ans.Dpf.Native.dll",
34-
"Ans.Dpf.FEMutils.dll",
35-
"meshOperatorsCore.dll",
36-
"mapdlOperatorsCore.dll",
37-
"Ans.Dpf.Math.dll",
38-
"Ans.Dpf.PythonPluginWrapper.dll",
39-
"Ans.Dpf.Hdf5.dll",
40-
"Ans.Dpf.FlowDiagram.dll",
41-
"Ans.Dpf.LSDYNAHGP.dll",
42-
"Ans.Dpf.LivePost.dll",
43-
"Ans.Dpf.PointCloudSearch.dll",
44-
"Ans.Dpf.Vtk.dll",
45-
"Ans.Dpf.MechanicalResults.dll",
46-
]
47-
LIB_OPTIONAL_TO_GENERATE = [
48-
"Ans.Dpf.SystemCouplingMapping.dll",
49-
]
50-
5111
local_dir = os.path.dirname(os.path.abspath(__file__))
5212
TARGET_PATH = os.path.join(local_dir, os.pardir, "src", "ansys", "dpf", "core", "operators")
5313
files = glob.glob(os.path.join(TARGET_PATH, "*"))
@@ -65,41 +25,8 @@
6525
os.remove(f)
6626
except:
6727
pass
68-
core.start_local_server(config=core.AvailableServerConfigs.LegacyGrpcServer)
69-
code_gen = core.Operator("python_generator")
70-
code_gen.connect(1, TARGET_PATH)
71-
for lib in LIB_TO_GENERATE:
72-
try:
73-
code_gen.connect(0, lib)
74-
if lib != LIB_TO_GENERATE[0]:
75-
code_gen.connect(2, False)
76-
else:
77-
code_gen.connect(2, True)
78-
print(f"Generating {lib} operators for server {core.SERVER.version}...")
79-
code_gen.run()
80-
time.sleep(0.1)
81-
except Exception as e:
82-
print(f"Could not generate operators for library {lib}:\n{str(e)}")
83-
raise e
8428

85-
for lib in LIB_OPTIONAL_TO_GENERATE:
86-
try:
87-
code_gen.connect(0, lib)
88-
if lib != LIB_OPTIONAL_TO_GENERATE[0]:
89-
code_gen.connect(2, False)
90-
else:
91-
code_gen.connect(2, True)
92-
print(f"Generating optional {lib} operators for server {core.SERVER.version}...")
93-
code_gen.run()
94-
time.sleep(0.1)
95-
except Exception as e:
96-
print(f"Could not generate operators for optional library {lib}:\n{str(e)}")
97-
98-
# Reorder imports alphabetically in __init__.py files to reduce changes raised
99-
for init_file_path in glob.glob(os.path.join(TARGET_PATH, "**/__init__.py"), recursive=True):
100-
with open(init_file_path, "r") as init_file:
101-
lines = init_file.readlines()
102-
with open(init_file_path, "w") as init_file:
103-
init_file.writelines(sorted(lines))
29+
core.set_default_server_context(core.AvailableServerContexts.premium)
30+
core.start_local_server(config=core.AvailableServerConfigs.LegacyGrpcServer)
10431

10532
build.build_operators()

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ body:
6161
label: Which DPF/Ansys version are you using?
6262
multiple: true
6363
options:
64+
- 'DPF Server 2025.2.pre0'
65+
- 'Ansys 2025 R1'
6466
- 'DPF Server 2025.1.pre0'
6567
- 'Ansys 2024 R2'
6668
- 'DPF Server 2024.2.pre1'

.github/ISSUE_TEMPLATE/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 🎓 Adding an example
22
description: Proposing a new example for the library
33
title: "Example proposal: ..."
4-
labels: ["example"]
4+
labels: ["examples"]
55
assignees: [""]
66

77
body:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 🎓 Adding a tutorial
2+
description: Proposing a new tutorial for the library
3+
title: "Tutorial proposal: ..."
4+
labels: ["tutorials"]
5+
assignees: [""]
6+
7+
body:
8+
9+
- type: textarea
10+
id: tutorial-description
11+
attributes:
12+
label: '📝 Description of the tutorial'
13+
placeholder: Describe what tutorial you devised and why it is useful for the project.
14+
15+
validations:
16+
required: true

.github/workflows/ci.yml

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
description: "ANSYS version"
1515
required: false
1616
type: string
17-
default: "251"
17+
default: "252"
1818
standalone_branch_suffix:
1919
description: 'Suffix of the branch on standalone'
2020
required: false
@@ -28,8 +28,6 @@ concurrency:
2828
env:
2929
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
3030
MAIN_PYTHON_VERSION: '3.9'
31-
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
32-
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
3331

3432
jobs:
3533
debug:
@@ -107,7 +105,7 @@ jobs:
107105
uses: ./.github/workflows/tests.yml
108106
needs: pick_server_suffix
109107
with:
110-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
108+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
111109
python_versions: '["3.9"]'
112110
wheel: true
113111
wheelhouse: false
@@ -118,7 +116,7 @@ jobs:
118116
uses: ./.github/workflows/tests.yml
119117
needs: pick_server_suffix
120118
with:
121-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
119+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
122120
python_versions: '["3.9"]'
123121
wheel: true
124122
wheelhouse: false
@@ -131,7 +129,7 @@ jobs:
131129
uses: ./.github/workflows/test_docker.yml
132130
needs: pick_server_suffix
133131
with:
134-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
132+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
135133
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
136134
secrets: inherit
137135

@@ -140,7 +138,7 @@ jobs:
140138
uses: ./.github/workflows/examples_docker.yml
141139
needs: pick_server_suffix
142140
with:
143-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
141+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
144142
python_versions: '["3.9"]'
145143
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
146144
secrets: inherit
@@ -150,7 +148,7 @@ jobs:
150148
uses: ./.github/workflows/docs.yml
151149
needs: pick_server_suffix
152150
with:
153-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
151+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
154152
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
155153
event_name: ${{ github.event_name }}
156154
secrets: inherit
@@ -167,32 +165,30 @@ jobs:
167165
token: ${{ secrets.GITHUB_TOKEN }}
168166
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
169167
decompress-artifact: true
170-
171-
doc-index-dev:
172-
name: "Deploy dev index docs"
173-
runs-on: ubuntu-latest
174-
needs: upload-development-docs
175-
steps:
176-
- name: "Deploy the latest documentation index"
177-
uses: ansys/actions/doc-deploy-index@v8
178-
with:
179-
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
180-
index-name: pydpf-core-vdev
181-
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
182-
api-key: ${{ env.MEILISEARCH_API_KEY }}
183-
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
184-
decompress-artifact: true
168+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
169+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
185170

186171
examples:
187172
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
188173
uses: ./.github/workflows/examples.yml
189174
needs: pick_server_suffix
190175
with:
191-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
176+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
192177
python_versions: '["3.9"]'
193178
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
194179
secrets: inherit
195180

181+
retro_251:
182+
name: "retro 251"
183+
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
184+
uses: ./.github/workflows/tests.yml
185+
with:
186+
ANSYS_VERSION: "251"
187+
python_versions: '["3.9"]'
188+
DOCSTRING: false
189+
standalone_suffix: ''
190+
secrets: inherit
191+
196192
retro_242:
197193
name: "retro 242"
198194
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
@@ -252,7 +248,7 @@ jobs:
252248
uses: ./.github/workflows/pydpf-post.yml
253249
needs: pick_server_suffix
254250
with:
255-
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
251+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
256252
post_branch: "master"
257253
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
258254
test_docstrings: "true"

.github/workflows/ci_release.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,43 @@ jobs:
7373
name: ${{ steps.wheel.outputs.wheel_name }}
7474
path: dist/${{ steps.wheel.outputs.wheel_name }}
7575

76+
tests_3_9:
77+
uses: ./.github/workflows/tests.yml
78+
with:
79+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
80+
python_versions: '["3.9"]'
81+
wheel: true
82+
wheelhouse: true
83+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
84+
secrets: inherit
85+
7686
tests:
7787
uses: ./.github/workflows/tests.yml
7888
with:
7989
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
80-
python_versions: '["3.9", "3.10", "3.11"]'
81-
wheel: ${{ matrix.python-version == '3.9' }}
90+
python_versions: '["3.10", "3.11"]'
91+
wheel: false
8292
wheelhouse: true
8393
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
8494
secrets: inherit
8595

96+
tests_any_3_9:
97+
uses: ./.github/workflows/tests.yml
98+
with:
99+
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
100+
python_versions: '["3.9"]'
101+
wheel: true
102+
wheelhouse: false
103+
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
104+
test_any: true
105+
secrets: inherit
106+
86107
tests_any:
87108
uses: ./.github/workflows/tests.yml
88109
with:
89110
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
90-
python_versions: '["3.9", "3.10", "3.11"]'
91-
wheel: ${{ matrix.python-version == '3.9' }}
111+
python_versions: '["3.10", "3.11"]'
112+
wheel: false
92113
wheelhouse: false
93114
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
94115
test_any: true
@@ -211,11 +232,11 @@ jobs:
211232
draft_release:
212233
name: "Draft Release"
213234
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
214-
needs: [style, tests, docs, examples, retro_232, retro_231, retro_222, docker_tests]
235+
needs: [style, tests, tests_3_9, tests_any, tests_any_3_9, docs, examples, retro_232, retro_231, retro_222, docker_tests]
215236
runs-on: ubuntu-latest
216237
steps:
217238
- name: "Download artifacts"
218-
uses: actions/download-artifact@v3
239+
uses: actions/download-artifact@v4
219240

220241
- name: "Display downloaded files"
221242
run: ls -R

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
python_version:
88
required: false
99
type: string
10-
default: "3.9"
10+
default: "3.10"
1111
ANSYS_VERSION:
1212
required: false
1313
type: string
@@ -29,7 +29,7 @@ on:
2929
description: "Python interpreter"
3030
required: true
3131
type: string
32-
default: "3.9"
32+
default: "3.10"
3333
ANSYS_VERSION:
3434
description: "ANSYS version"
3535
required: true

.github/workflows/releaser.yml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,9 @@ on:
1010
description: 'Release tag'
1111
default: 'latest'
1212
type: string
13-
checkout_ref:
14-
description: 'Ref to checkout for doc index (default to current branch)'
15-
default: ''
16-
type: string
1713

1814
env:
1915
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
20-
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
21-
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
2216

2317
jobs:
2418

@@ -95,40 +89,8 @@ jobs:
9589
token: ${{ secrets.GITHUB_TOKEN }}
9690
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
9791
decompress-artifact: true
98-
99-
doc-index-stable:
100-
name: "Deploy stable docs index"
101-
runs-on: ubuntu-latest
102-
needs: upload_docs_release
103-
steps:
104-
- name: "Install Git and clone project"
105-
uses: actions/checkout@v4
106-
with:
107-
ref: ${{ github.event.inputs.checkout_ref || '' }}
108-
109-
- name: "Install the package requirements"
110-
run: |
111-
python3 -m venv .venv
112-
.venv/bin/python -m pip install -e .
113-
114-
- name: "Get the version to PyMeilisearch"
115-
run: |
116-
VERSION=$(.venv/bin/python -c "from ansys.dpf.core import __version__; print('.'.join(__version__.split('.')[:2]))")
117-
VERSION_MEILI=$(.venv/bin/python -c "from ansys.dpf.core import __version__; print('-'.join(__version__.split('.')[:2]))")
118-
echo "Calculated VERSION: $VERSION"
119-
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
120-
echo "VERSION=$VERSION" >> $GITHUB_ENV
121-
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
122-
123-
- name: "Deploy the latest documentation index"
124-
uses: ansys/actions/doc-deploy-index@v8
125-
with:
126-
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
127-
index-name: pydpf-core-v${{ env.VERSION_MEILI }}
128-
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
129-
api-key: ${{ env.MEILISEARCH_API_KEY }}
130-
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
131-
decompress-artifact: true
92+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
93+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
13294

13395
update_ansys_lab_examples:
13496
uses: ./.github/workflows/ansys_lab.yml

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
140140
141141
- name: "Upload wheel to artifacts"
142-
if: (inputs.wheel == 'true') && !(inputs.test_any && (matrix.os == 'ubuntu-latest') )
142+
if: (inputs.wheel == 'true') && !( (inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest') )
143143
uses: actions/upload-artifact@v4
144144
with:
145145
name: ${{ steps.wheel.outputs.wheel_name }}

0 commit comments

Comments
 (0)