Skip to content

Commit 8cf4fe9

Browse files
Merge branch 'master' into dependabot/pip/requirements/sphinx-gallery-0.18.0
2 parents 62bfd12 + f00e62a commit 8cf4fe9

File tree

786 files changed

+4537
-4527
lines changed

Some content is hidden

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

786 files changed

+4537
-4527
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/workflows/ci.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -73,7 +71,7 @@ jobs:
7371
name: "Style Check"
7472
runs-on: ubuntu-latest
7573
steps:
76-
- uses: ansys/actions/code-style@v7
74+
- uses: ansys/actions/code-style@v8
7775
with:
7876
use-python-cache: false
7977

@@ -161,27 +159,14 @@ jobs:
161159
needs: [docs]
162160
steps:
163161
- name: "Upload development documentation"
164-
uses: ansys/actions/doc-deploy-dev@v7
162+
uses: ansys/actions/doc-deploy-dev@v8
165163
with:
166164
cname: ${{ env.DOCUMENTATION_CNAME }}
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@v7
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

.github/workflows/ci_release.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: "Style Check"
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: ansys/actions/code-style@v6
46+
- uses: ansys/actions/code-style@v8
4747
with:
4848
use-python-cache: false
4949

@@ -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: 3 additions & 3 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
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- name: "Running documentation style checks"
54-
uses: ansys/actions/doc-style@v7
54+
uses: ansys/actions/doc-style@v8
5555
with:
5656
token: ${{ secrets.GITHUB_TOKEN }}
5757

.github/workflows/releaser.yml

Lines changed: 3 additions & 41 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

@@ -89,46 +83,14 @@ jobs:
8983
path: HTML-doc-ansys-dpf-core.zip
9084

9185
- name: "Deploy the stable documentation"
92-
uses: ansys/actions/doc-deploy-stable@v7
86+
uses: ansys/actions/doc-deploy-stable@v8
9387
with:
9488
cname: ${{ env.DOCUMENTATION_CNAME }}
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@v7
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 }}

doc/source/_static/dpf_operators.html

Lines changed: 13 additions & 6 deletions
Large diffs are not rendered by default.

doc/source/conf.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pyvista
88
from ansys.dpf.core import __version__, server, server_factory
99
from ansys.dpf.core.examples import get_example_required_minimum_dpf_version
10-
from ansys_sphinx_theme import pyansys_logo_black, ansys_favicon, get_version_match
10+
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_light_mode, pyansys_logo_dark_mode
1111

1212
# Manage errors
1313
pyvista.set_error_output_file("errors.txt")
@@ -90,7 +90,9 @@
9090
]
9191

9292
redirects = {
93-
"user_guide/getting_started_with_dpf_server": "../getting_started/dpf_server.html"
93+
"user_guide/getting_started_with_dpf_server": "../getting_started/dpf_server.html",
94+
"concepts/index": "../user_guide/index.html#concepts",
95+
"contributing": "getting_started/contributing.html"
9496
}
9597

9698
typehints_defaults = "comma"
@@ -193,9 +195,12 @@ def reset_servers(gallery_conf, fname, when):
193195
# -- Options for HTML output -------------------------------------------------
194196
html_short_title = html_title = "PyDPF-Core"
195197
html_theme = "ansys_sphinx_theme"
196-
html_logo = pyansys_logo_black
197198
html_favicon = ansys_favicon
198199
html_theme_options = {
200+
"logo": {
201+
"image_dark": pyansys_logo_dark_mode,
202+
"image_light": pyansys_logo_light_mode,
203+
},
199204
"github_url": "https://github.com/ansys/pydpf-core",
200205
"show_prev_next": False,
201206
"show_breadcrumbs": True,
@@ -206,11 +211,10 @@ def reset_servers(gallery_conf, fname, when):
206211
"json_url": f"https://{cname}/versions.json",
207212
"version_match": get_version_match(__version__),
208213
},
209-
"use_meilisearch": {
210-
"api_key": os.getenv("MEILISEARCH_PUBLIC_API_KEY", ""),
211-
"index_uids": {
212-
f"pydpf-core-v{get_version_match(__version__).replace('.', '-')}": "PyDPF-Core",
213-
},
214+
"static_search": {
215+
"threshold": 0.5,
216+
"min_chars_for_search": 2,
217+
"ignoreLocation": True,
214218
},
215219
}
216220

@@ -318,14 +322,3 @@ def reset_servers(gallery_conf, fname, when):
318322

319323
# A list of files that should not be packed into the epub file.
320324
epub_exclude_files = ["search.html"]
321-
322-
323-
def verify_meilisearch_is_active(app):
324-
MEILISEARCH_PUBLIC_API_KEY = os.getenv("MEILISEARCH_PUBLIC_API_KEY", None)
325-
if not MEILISEARCH_PUBLIC_API_KEY:
326-
sys.stderr.write("Could not find MEILISEARCH_PUBLIC_API_KEY")
327-
# sys.exit(1)
328-
329-
330-
def setup(app):
331-
app.connect("builder-inited", verify_meilisearch_is_active)

0 commit comments

Comments
 (0)