Skip to content

Commit 6909cb5

Browse files
committed
Merge branch 'master' into mhanmer/operator_doc_template
2 parents c6ac5f0 + 68f0755 commit 6909cb5

File tree

835 files changed

+68463
-89890
lines changed

Some content is hidden

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

835 files changed

+68463
-89890
lines changed

.ci/code_generation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
from ansys.dpf import core
99
from ansys.dpf.core.operators import build
1010

11+
core.set_default_server_context(core.AvailableServerContexts.premium)
12+
core.start_local_server(config=core.AvailableServerConfigs.LegacyGrpcServer)
13+
1114
local_dir = Path(__file__).parent
1215
TARGET_PATH = local_dir.parent / "src" / "ansys" / "dpf" / "core" / "operators"
1316
files = TARGET_PATH.glob("*")
1417
for file_path in files:
1518
if file_path.stem == "specification":
1619
continue
20+
if file_path.stem == "translator":
21+
continue
1722
if file_path.name == "build.py":
1823
continue
1924
if file_path.name == "operator.mustache":
@@ -26,7 +31,4 @@
2631
except:
2732
pass
2833

29-
core.set_default_server_context(core.AvailableServerContexts.premium)
30-
core.start_local_server(config=core.AvailableServerConfigs.LegacyGrpcServer)
31-
3234
build.build_operators()

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
*.jpg binary
44+
*.png binary
45+
*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ jobs:
151151
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
152152
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
153153
event_name: ${{ github.event_name }}
154+
python_version: "3.11"
154155
secrets: inherit
155156

156157
upload-development-docs:

.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.10"
10+
default: "3.11"
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.10"
32+
default: "3.11"
3333
ANSYS_VERSION:
3434
description: "ANSYS version"
3535
required: true

.github/workflows/releaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
- name: "Upload to Public PyPI"
5555
run: |
56-
pip install twine
56+
pip install twine==6.0.1
5757
twine upload --skip-existing assets/*
5858
env:
5959
TWINE_USERNAME: __token__

.github/workflows/test_docker.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,11 @@ jobs:
229229
token: ${{ secrets.CODECOV_TOKEN }} # required
230230
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}_docker.xml
231231
flags: docker,${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}
232+
233+
- name: "Upload test analytics results to Codecov"
234+
if: ${{ !cancelled() }}
235+
uses: codecov/test-results-action@v1
236+
with:
237+
token: ${{ secrets.CODECOV_TOKEN }}
238+
name: test_results_${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}
239+
flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}

.github/workflows/tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,3 +309,11 @@ jobs:
309309
file: ./.tox/.cov/coverage.xml
310310
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml
311311
flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}
312+
313+
- name: "Upload test analytics results to Codecov"
314+
if: ${{ !cancelled() }}
315+
uses: codecov/test-results-action@v1
316+
with:
317+
token: ${{ secrets.CODECOV_TOKEN }}
318+
name: test_results_${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}
319+
flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}

.github/workflows/update_operators.yml

Lines changed: 4 additions & 4 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
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
5151
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '' }}
52-
ANSYS_VERSION : ${{ github.event.inputs.ANSYS_VERSION || '251' }}
52+
ANSYS_VERSION : ${{ github.event.inputs.ANSYS_VERSION || '252' }}
5353

5454
- name: "Update ansys-grpc-dpf"
5555
shell: bash
@@ -133,9 +133,9 @@ jobs:
133133
src/ansys/dpf/core/operators/*
134134
doc/source/_static/dpf_operators.html
135135
commit-message: update generated code
136-
title: Update generated code for DPF ${{ github.event.inputs.ANSYS_VERSION || '251' }}${{ github.event.inputs.standalone_branch_suffix || '' }} on ${{ github.ref_name }}
136+
title: Update generated code for DPF ${{ github.event.inputs.ANSYS_VERSION || '252' }}${{ github.event.inputs.standalone_branch_suffix || '' }} on ${{ github.ref_name }}
137137
body: An update of generated code has been triggered either manually or by an update in the dpf-standalone repository.
138-
branch: maint/update_code_for_${{ github.event.inputs.ANSYS_VERSION || '251' }}${{ github.event.inputs.standalone_branch_suffix || '' }}_on_${{ github.ref_name }}
138+
branch: maint/update_code_for_${{ github.event.inputs.ANSYS_VERSION || '252' }}${{ github.event.inputs.standalone_branch_suffix || '' }}_on_${{ github.ref_name }}
139139
labels: server-sync
140140
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
141141
reviewers: ${{ github.ref_name == 'master' && 'ansys/dpf_integration_proxies' || '' }}

doc/source/_static/dpf_operators.html

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

doc/source/conf.py

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from datetime import datetime
22
from glob import glob
33
import os
4+
from pathlib import Path
5+
import subprocess
46

57
from ansys_sphinx_theme import (
68
ansys_favicon,
@@ -109,9 +111,8 @@
109111
"sphinx.ext.todo",
110112
"sphinx_copybutton",
111113
"sphinx_design",
112-
"sphinx_gallery.gen_gallery",
114+
"sphinx_jinja",
113115
'sphinx_reredirects',
114-
"ansys_sphinx_theme.extension.autoapi",
115116
]
116117

117118
redirects = {
@@ -373,4 +374,34 @@ def reset_servers(gallery_conf, fname, when):
373374
# epub_uid = ''
374375

375376
# A list of files that should not be packed into the epub file.
376-
epub_exclude_files = ["search.html"]
377+
epub_exclude_files = ["search.html"]
378+
379+
# Common content for every RST file such us links
380+
rst_epilog = ""
381+
links_filepath = Path(__file__).parent.absolute() / "links.rst"
382+
rst_epilog += links_filepath.read_text(encoding="utf-8")
383+
384+
jinja_globals = {
385+
"PYDPF_CORE_VERSION": version,
386+
}
387+
388+
# Get list of tox environments and add to jinja context
389+
envs = subprocess.run(["tox", "list", "-q"], capture_output=True, text=True).stdout.splitlines()
390+
envs.remove("default environments:")
391+
envs.remove("additional environments:")
392+
envs.remove("")
393+
394+
jinja_contexts = {
395+
"toxenvs" : {
396+
"envs": envs,
397+
}
398+
}
399+
400+
# Optionally exclude api or example documentation generation.
401+
BUILD_API = True if os.environ.get("BUILD_API", "true") == "true" else False
402+
if BUILD_API:
403+
extensions.extend(["ansys_sphinx_theme.extension.autoapi"])
404+
405+
BUILD_EXAMPLES = True if os.environ.get("BUILD_EXAMPLES", "true") == "true" else False
406+
if BUILD_EXAMPLES:
407+
extensions.extend(["sphinx_gallery.gen_gallery"])

0 commit comments

Comments
 (0)