Skip to content

Commit c801d5c

Browse files
committed
initial move from pymapdl
0 parents  commit c801d5c

File tree

476 files changed

+163438
-0
lines changed

Some content is hidden

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

476 files changed

+163438
-0
lines changed

.ci/azure-pipelines.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# azure pipelines build and test pymapdl
2+
3+
variables:
4+
ALLOW_PLOTTING: true
5+
package_name: ansys-mapdl
6+
SHELLOPTS: 'errexit:pipefail'
7+
8+
trigger:
9+
branches:
10+
include:
11+
- '*'
12+
exclude:
13+
- gh-pages
14+
tags:
15+
include:
16+
- '*'
17+
18+
jobs:
19+
- job: Linux
20+
variables:
21+
python.version: '3.7' # due to VTK 8.1.2 requirement for docbuild
22+
DISPLAY: ':99.0'
23+
MAPDL_IMAGE: 'docker.pkg.github.com/pyansys/mapdl/mapdl:v21.1.0'
24+
PYMAPDL_PORT: 32771 # default won't work on azure devops...
25+
PYMAPDL_START_INSTANCE: FALSE
26+
PYANSYS_OFF_SCREEN: True
27+
pool:
28+
vmImage: 'ubuntu-20.04'
29+
steps:
30+
- task: UsePythonVersion@0
31+
inputs:
32+
versionSpec: '$(python.version)'
33+
displayName: 'Use Python $(python.version)'
34+
- task: PipAuthenticate@1
35+
inputs:
36+
artifactFeeds: 'pyansys'
37+
onlyAddExtraIndex: true
38+
39+
- script: |
40+
uname -a
41+
displayName: Display kernel version
42+
43+
- script: |
44+
.ci/setup_headless_display.sh
45+
pip install -r .ci/requirements_test_xvfb.txt
46+
python .ci/display_test.py
47+
displayName: Install and start a virtual framebuffer
48+
49+
- script: |
50+
pip install -r requirements_build.txt
51+
python setup.py bdist_wheel
52+
pip install dist/ansys_mapdl*.whl
53+
python -c "from ansys import mapdl; print(mapdl.Report())"
54+
displayName: Build, install, and validate installation of ansys-mapdl
55+
56+
- script: |
57+
set -ex
58+
echo $(PAT) | docker login -u $(GH_USERNAME) --password-stdin docker.pkg.github.com
59+
docker pull $(MAPDL_IMAGE)
60+
docker run -e ANSYSLMD_LICENSE_FILE=1055@$(LICENSE_SERVER) --restart always --name mapdl -p $(PYMAPDL_PORT):50052 $(MAPDL_IMAGE) -smp > log.txt &
61+
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
62+
python -c "from ansys.mapdl import launch_mapdl; print(launch_mapdl())"
63+
displayName: Pull, launch, and validate MAPDL service
64+
65+
- script: |
66+
pip install -r requirements_test.txt
67+
pip install pytest-azurepipelines
68+
pytest -v --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
69+
displayName: 'Test Core API'
70+
71+
- script: |
72+
cat log.txt
73+
displayName: 'Display MAPDL Logs'
74+
condition: always()
75+
76+
# - script: |
77+
# pip install twine
78+
# python setup.py sdist
79+
# twine upload --skip-existing dist/pyvista*
80+
# displayName: 'Upload to PyPi'
81+
# condition: and(eq(variables['python.version'], '3.7'), contains(variables['Build.SourceBranch'], 'refs/tags/'))
82+
# env:
83+
# TWINE_USERNAME: $(twine.username)
84+
# TWINE_PASSWORD: $(twine.password)
85+
# TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
86+
87+
88+
# - job: Windows
89+
# strategy:
90+
# matrix:
91+
# Python35:
92+
# python.version: '3.5'
93+
# Python36:
94+
# python.version: '3.6'
95+
# Python37:
96+
# python.version: '3.7'
97+
# Python38:
98+
# python.version: '3.8'
99+
# pool:
100+
# vmImage: 'vs2017-win2016'
101+
# steps:
102+
# - task: UsePythonVersion@0
103+
# inputs:
104+
# versionSpec: $(python.version)
105+
# addToPath: true
106+
# - powershell: |
107+
# powershell .ci/install_opengl.ps1
108+
# displayName: 'Install OpenGL'
109+
# - template: .ci/build_wheel.yml
110+
# - template: .ci/install_pyansys.yml
111+
# - template: .ci/unit_testing.yml
112+
# - template: .ci/azure-publish-dist.yml
113+
114+
115+
# - job: macOS
116+
# strategy:
117+
# matrix:
118+
# Python36:
119+
# python.version: '3.6'
120+
# Python37:
121+
# python.version: '3.7'
122+
# Python38:
123+
# python.version: '3.8'
124+
# pool:
125+
# vmImage: 'macOS-10.15'
126+
# steps:
127+
# - script: .ci/macos-install-python.sh '$(python.version)'
128+
# displayName: Install Python
129+
# - template: .ci/build_wheel.yml
130+
# - template: .ci/install_pyansys.yml
131+
# - template: .ci/unit_testing_allow_error.yml
132+
# - template: .ci/azure-publish-dist.yml
133+
134+
# docs are built locally (for now) due to MAPDL requirement
135+
# - job: build_docs
136+
# variables:
137+
# gh_user: akaszynski
138+
# gh_repo: pyansys.github.io
139+
# gh_pass: $(github_pat)
140+
# gh_email: $(github_email)
141+
# gh_auth_header: $(echo -n "${gh_user}:$(github_pat)" | base64);
142+
# pool:
143+
# vmImage: 'ubuntu-16.04'
144+
# steps:
145+
# - template: .ci/build_documentation.yml

.ci/build_documentation.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
steps:
2+
3+
- script: |
4+
mkdir -p doc_archive
5+
6+
- script: |
7+
sudo apt install pandoc -qy
8+
pip install -r requirements_docs.txt
9+
make -C docs html
10+
condition: always() # always build docs, regardless of prior steps testing
11+
displayName: 'Build Documentation'
12+
13+
- task: ArchiveFiles@2
14+
inputs:
15+
rootFolderOrFile: docs/build/html
16+
includeRootFolder: false
17+
archiveType: 'zip'
18+
archiveFile: doc_archive/ansys-mapdl_docs.zip
19+
displayName: Compress html documentation
20+
21+
- task: PublishPipelineArtifact@0
22+
inputs:
23+
artifactName: 'documentation'
24+
targetPath: 'doc_archive'

.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/requirements_test_xvfb.txt

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

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Compiled source #
2+
###################
3+
*.pyc
4+
*.pyd
5+
*.c
6+
*.cpp
7+
*.so
8+
*.o
9+
*.cache
10+
11+
# OS generated files #
12+
######################
13+
.fuse_hidden*
14+
*~
15+
*swp
16+
17+
# emacs
18+
flycheck*
19+
20+
# Old files #
21+
_old/
22+
23+
# Pip generated folders #
24+
#########################
25+
*.egg-info/
26+
build/
27+
dist/
28+
29+
# MISC
30+
_build/
31+
pyansys/Interface.py
32+
*.bat
33+
docs/source/examples/*
34+
*.out
35+
*.tar.gz
36+
37+
# Testing
38+
factory/
39+
Testing/
40+
UnitTesting/
41+
TODO
42+
test.sh
43+
.pytest_cache/
44+
tests/.coverage
45+
tests/htmlcov
46+
tests/cyclic/htmlcov
47+
.coverage
48+
*,cover
49+
50+
\#*
51+
.\#*
52+
/.ipynb_checkpoints
53+
54+
# test scripts
55+
*.sh
56+
*.cmd
57+
wheelhouse/
58+
59+
# jupyterlab
60+
node_modules
61+
yarn.lock
62+
jupyterlab/docker/*.tar.gz
63+
examples/.local
64+
.ipynb_checkpoints/
65+
66+
# docker
67+
docker/mapdl/v211

0 commit comments

Comments
 (0)