Skip to content

Commit 612ae13

Browse files
committed
Merged PR 333982: Merge: release-22.2_package_gate into develop
DPF PR: !327691 ansys-dpf-core version is set to 0.6.dev0. Related work items: #670272
2 parents ab3b437 + c009c46 commit 612ae13

File tree

2,216 files changed

+230760
-47113
lines changed

Some content is hidden

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

2,216 files changed

+230760
-47113
lines changed

.ci/build_doc.bat

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
set SPHINX_APIDOC_OPTIONS=inherited-members
2-
call sphinx-apidoc -o ../docs/source/api ../ansys ../ansys/dpf/core/aeneid.py -f --implicit-namespaces --separate --no-headings
2+
call sphinx-apidoc -o ../docs/source/api ../ansys ../ansys/dpf/core/log.py ^
3+
../ansys/dpf/core/help.py ../ansys/dpf/core/mapping_types.py ../ansys/dpf/core/ipconfig.py ^
4+
../ansys/dpf/core/field_base.py ../ansys/dpf/core/cache.py ../ansys/dpf/core/misc.py ^
5+
../ansys/dpf/core/check_version.py ../ansys/dpf/core/operators/build.py ../ansys/dpf/core/operators/specification.py ^
6+
../ansys/dpf/core/vtk_helper.py ^
7+
-f --implicit-namespaces --separate --no-headings
38
pushd .
49
cd ../docs/
510
call make clean
611
call make html
7-
popd
12+
popd

.ci/code_generation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"libmeshOperatorsCore.so",
1414
"libAns.Dpf.Math.so",
1515
"libAns.Dpf.Hdf5.so",
16+
"libAns.Dpf.LSDYNAHGP.so",
17+
"libAns.Dpf.LivePost.so",
18+
"libans.dpf.pointcloudsearch.so",
1619
]
1720
else:
1821
LIB_TO_GENERATE = [
@@ -22,6 +25,9 @@
2225
"mapdlOperatorsCore.dll",
2326
"Ans.Dpf.Math.dll",
2427
"Ans.Dpf.Hdf5.dll",
28+
"Ans.Dpf.LSDYNAHGP.dll",
29+
"Ans.Dpf.LivePost.dll",
30+
"Ans.Dpf.PointCloudSearch.dll",
2531
]
2632

2733
local_dir = os.path.dirname(os.path.abspath(__file__))

.ci/display_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Quickly check if VTK off screen plotting works."""
2+
import pyvista
3+
from pyvista.plotting import system_supports_plotting
4+
5+
print("system_supports_plotting", system_supports_plotting())
6+
pyvista.OFF_SCREEN = True
7+
pyvista.plot(pyvista.Sphere())

.ci/edit_ansys_version.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import sys
2+
import pkgutil
3+
import os
4+
5+
if __name__ == "__main__":
6+
directory = os.path.dirname(pkgutil.get_loader("ansys.dpf.core").path)
7+
file_path = os.path.join(directory, "_version.py")
8+
for i, arg in enumerate(sys.argv):
9+
if arg == "--version":
10+
print(sys.argv[i+1])
11+
version = sys.argv[i+1]
12+
file = open(file_path, 'r')
13+
lines = file.readlines()
14+
for i, line in enumerate(lines):
15+
if "__ansys_version__" in line:
16+
lines[i] = f'__ansys_version__ = "{version}"\n'
17+
file.close()
18+
with open(file_path, 'w') as file:
19+
file.writelines(lines)

.ci/requirements_test_xvfb.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyvista>=0.27.2
2+
matplotlib==3.2

.ci/run_examples.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
import os
22
import glob
33
import pathlib
4-
from ansys.dpf import core
4+
import subprocess
5+
import sys
56

6-
core.settings.disable_off_screen_rendering()
7+
os.environ["PYVISTA_OFF_SCREEN"] = "true"
8+
os.environ["MPLBACKEND"] = "Agg"
79

810
actual_path = pathlib.Path(__file__).parent.absolute()
911
print(os.path.join(actual_path, os.path.pardir, "examples"))
12+
13+
1014
for root, subdirectories, files in os.walk(os.path.join(actual_path, os.path.pardir, "examples")):
1115
for subdirectory in subdirectories:
1216
subdir = os.path.join(root, subdirectory)
1317
for file in glob.iglob(os.path.join(subdir, "*.py")):
1418
print("\n\n--------------------------------------------------\n")
1519
print(file)
1620
print("--------------------------------------------------\n")
17-
exec(
18-
open(file, mode="r", encoding="utf8").read(),
19-
globals(),
20-
globals())
21+
try:
22+
subprocess.check_call([sys.executable, file])
23+
except subprocess.CalledProcessError as e:
24+
sys.stderr.write(str(e.args))
25+
if e.returncode != 3221225477:
26+
raise e

.ci/run_non_regression_examples.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import os
2+
import glob
3+
from ansys.dpf import core
4+
import pathlib
5+
import subprocess
6+
import sys
7+
8+
os.environ["PYVISTA_OFF_SCREEN"] = "true"
9+
os.environ["MPLBACKEND"] = "Agg"
10+
11+
actual_path = pathlib.Path(__file__).parent.absolute()
12+
print(os.path.join(actual_path, os.path.pardir, "examples"))
13+
14+
15+
list_tests = [
16+
os.path.join(actual_path, os.path.pardir, "examples", "00-basic"),
17+
os.path.join(actual_path, os.path.pardir, "examples", "01-static-transient"),
18+
os.path.join(actual_path, os.path.pardir, "examples", "02-modal-harmonic"),
19+
os.path.join(actual_path, os.path.pardir, "examples", "05-plotting", "00-basic_plotting.py"),
20+
os.path.join(actual_path, os.path.pardir, "examples", "05-plotting",
21+
"05-plot_on_warped_mesh.py"),
22+
os.path.join(actual_path, os.path.pardir, "examples", "06-distributed-post",
23+
"00-distributed_total_disp.py"),
24+
]
25+
26+
if core.SERVER_CONFIGURATION != core.AvailableServerConfigs.InProcessServer:
27+
list_tests.append(os.path.join(actual_path, os.path.pardir, "examples", "07-python-operators",
28+
"00-wrapping_numpy_capabilities.py"))
29+
30+
for path in list_tests:
31+
if os.path.isdir(path):
32+
for file in glob.iglob(os.path.join(path, "*.py")):
33+
print("\n\n--------------------------------------------------\n")
34+
print(file)
35+
print("--------------------------------------------------\n")
36+
try:
37+
subprocess.check_call([sys.executable, file])
38+
except subprocess.CalledProcessError as e:
39+
sys.stderr.write(str(e.args))
40+
if e.returncode != 3221225477:
41+
raise e
42+
else:
43+
print("\n\n--------------------------------------------------\n")
44+
print(path)
45+
print("--------------------------------------------------\n")
46+
try:
47+
subprocess.check_call([sys.executable, file])
48+
except subprocess.CalledProcessError as e:
49+
sys.stderr.write(str(e.args))
50+
if e.returncode != 3221225477:
51+
raise e

.ci/setup_headless_display.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -x
3+
4+
sudo apt-get update && sudo apt-get install -y libgl1-mesa-glx xvfb
5+
which Xvfb
6+
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 &
7+
sleep 3
8+
set +x

.gitignore

Lines changed: 151 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,164 @@
1+
### Python ###
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
doc/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# poetry
99+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103+
#poetry.lock
104+
105+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
106+
__pypackages__/
107+
108+
# Celery stuff
109+
celerybeat-schedule
110+
celerybeat.pid
111+
112+
# SageMath parsed files
113+
*.sage.py
114+
115+
# Environments
116+
.env
117+
.venv
118+
env/
119+
venv/
120+
ENV/
121+
env.bak/
122+
venv.bak/
123+
124+
# Spyder project settings
125+
.spyderproject
126+
.spyproject
1127

128+
# Rope project settings
129+
.ropeproject
2130

3-
#########################
4-
## DPF
5-
#########################
131+
# mkdocs documentation
132+
/site
6133

7-
# cache and pyc
8-
__pycache__
9-
.pytest_cache
10-
.spyproject
11-
.vs
134+
# mypy
135+
.mypy_cache/
136+
.dmypy.json
137+
dmypy.json
12138

13-
#tests
14-
__pycache__
15-
/tests/.pytest_cache
139+
# Pyre type checker
140+
.pyre/
16141

17-
#ansys/dpf
18-
/ansys/dpf/__pycache__
142+
# pytype static type analyzer
143+
.pytype/
19144

20-
#ansys/dpf/core
21-
/ansys/dpf/core/__pycache__
22-
/ansys/dpf/core/__pycache__/.vs
145+
# Cython debug symbols
146+
cython_debug/
23147

24-
#operators
25-
/ansys/dpf/core/operators/__pycache__
148+
# PyCharm
149+
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
150+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
151+
# and can be added to the global gitignore or merged into this file. For a more nuclear
152+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
153+
.idea/
26154

27-
#other
28-
/perso
29-
.ipynb_checkpoints/
155+
# Visual Studio
156+
.vs/
30157

31-
# compiled documentation
32-
#docs/build
33-
#docs/source/examples
158+
# End of https://www.toptal.com/developers/gitignore/api/python
34159

35-
# pip files
36-
*.egg-info
37-
#build/
38-
dist/
160+
#other
161+
/perso
39162

40163
# emacs
41164
flycheck*
@@ -47,14 +170,12 @@ flycheck*
47170
docker/v211
48171

49172
# pytest -coverage
50-
.coverage
51173
test-output.xml
52174

53175
# downloaded files
54176
ansys/dpf/core/examples/_cache/
55177

56178
*.orig
57-
venv/*
58179

59180
# Visual studio code settings
60181
.vscode

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2020 ANSYS
3+
Copyright (c) 2022 ANSYS, Inc. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)