Skip to content

Commit 78246f2

Browse files
akaszynskiRobPasMuePProfiziRevathyvenugopal162PipKat
authored
Refactor to pyansys standards (#140)
* initial refactor to pyansys standards * add back in req * fix yml * fix job name * Test the pydpf-actions/build_package@feat/use_build action * Use pydpf-actions from the corresponding @feat/use_build pydpf-actions PR. * Fix importlib_metadata.version call * Revert "Fix importlib_metadata.version call" This reverts commit 5788a00. * Apply suggestions from code review Co-authored-by: Roberto Pastor Muela <[email protected]> Co-authored-by: Revathy Venugopal <[email protected]> * Complement suggestions * Change documentation job name * Updating .gitignore * add debug for CI * rearrange import order * fix package name * order back * ignore cov files * use new debug argument for build_doc pydpf-action * Add numpydoc to requirements_docs.txt * Apply suggestions from code review Co-authored-by: Kathy Pippert <[email protected]> * Apply suggestions from code review Co-authored-by: Kathy Pippert <[email protected]> * Update src/ansys/dpf/post/result_evaluation.py * ignore D401 * Apply suggestions from code review Co-authored-by: Kathy Pippert <[email protected]> * fix line length * Update src/ansys/dpf/post/misc_results.py Co-authored-by: Roberto Pastor Muela <[email protected]> Co-authored-by: paul.profizi <[email protected]> Co-authored-by: PProfizi <[email protected]> Co-authored-by: Revathy Venugopal <[email protected]> Co-authored-by: Kathy Pippert <[email protected]>
1 parent a322410 commit 78246f2

Some content is hidden

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

66 files changed

+1151
-990
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,34 @@ env:
2121
ANSYS_VERSION: 222
2222

2323
jobs:
24-
Style_Check:
24+
style:
2525
name: Style Check
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v3
29-
30-
- name: "Setup Python"
29+
- name: Setup Python
3130
uses: actions/[email protected]
3231
with:
33-
python-version: 3.8
34-
35-
- name: "Install style requirements"
36-
run: |
37-
pip install -r requirements/requirements_style.txt --disable-pip-version-check
38-
39-
- name: "Codespell"
40-
run: |
41-
make codespell
42-
43-
- name: "flake8"
44-
run: |
45-
make flake8
32+
python-version: 3.9
33+
- name: Install pre-commit
34+
run: pip install pre-commit
35+
- name: Run pre-commit
36+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
4637

47-
Build_and_Test:
38+
build_test:
4839
name: Build and Test
4940
runs-on: ${{ matrix.os }}
5041
strategy:
5142
fail-fast: false
5243
matrix:
53-
python-version: ["3.7"]
44+
python-version: ["3.7", "3.8", "3.9", "3.10"]
5445
os: ["windows-latest", "ubuntu-latest"]
5546

5647
steps:
5748
- uses: actions/checkout@v3
5849

5950
- name: "Build Package"
60-
uses: pyansys/pydpf-actions/build_package@v2.2.dev1
51+
uses: pyansys/pydpf-actions/build_package@feat/use_build
6152
with:
6253
python-version: ${{ matrix.python-version }}
6354
ANSYS_VERSION: ${{env.ANSYS_VERSION}}
@@ -68,12 +59,12 @@ jobs:
6859
wheelhouse: true
6960

7061
- name: "Prepare Testing Environment"
71-
uses: pyansys/pydpf-actions/prepare_tests@v2.2.dev1
62+
uses: pyansys/pydpf-actions/prepare_tests@feat/use_build
7263
with:
7364
DEBUG: true
7465

7566
- name: "Test Docstrings"
76-
uses: pyansys/pydpf-actions/test_docstrings@v2.2.dev1
67+
uses: pyansys/pydpf-actions/test_docstrings@feat/use_build
7768
with:
7869
MODULE: ${{env.MODULE}}
7970
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
@@ -85,7 +76,7 @@ jobs:
8576
pytest $DEBUG --cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=junit/test-results.xml --reruns 2 .
8677
8778
- name: "Kill all servers"
88-
uses: pyansys/pydpf-actions/kill-dpf-servers@v2.2.dev1
79+
uses: pyansys/pydpf-actions/kill-dpf-servers@feat/use_build
8980
if: always()
9081

9182
- name: "Upload Test Results"
@@ -97,85 +88,30 @@ jobs:
9788
- name: "Upload coverage to Codecov"
9889
uses: codecov/codecov-action@v3
9990

100-
Documentation:
91+
docs:
10192
name: Documentation
10293
runs-on: ubuntu-latest
10394

10495
steps:
10596
- uses: actions/checkout@v3
10697

10798
- name: "Build Documentation"
108-
uses: pyansys/pydpf-actions/build_doc@v2.2.dev1
99+
uses: pyansys/pydpf-actions/build_doc@feat/use_build
109100
with:
110101
python-version: "3.8"
111102
ANSYS_VERSION: ${{env.ANSYS_VERSION}}
112103
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
113104
MODULE: ${{env.MODULE}}
114105
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
115106
install_extras: plotting
107+
debug: true
116108
timeout-minutes: 30
117109

118-
Build_and_Test_other_Python:
119-
name: Build and Test other Pythons
120-
runs-on: ${{ matrix.os }}
121-
strategy:
122-
fail-fast: false
123-
matrix:
124-
python-version: ["3.8", "3.9", "3.10"]
125-
os: ["windows-latest", "ubuntu-latest"]
126-
127-
steps:
128-
- uses: actions/checkout@v3
129-
130-
- name: "Build Package"
131-
uses: pyansys/pydpf-actions/[email protected]
132-
with:
133-
python-version: ${{ matrix.python-version }}
134-
ANSYS_VERSION: ${{env.ANSYS_VERSION}}
135-
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
136-
MODULE: ${{env.MODULE}}
137-
dpf-standalone-TOKEN: ${{secrets.DPF_PIPELINE}}
138-
install_extras: plotting
139-
wheelhouse: true
140-
wheel: false
141-
142-
- name: "Prepare Testing Environment"
143-
uses: pyansys/pydpf-actions/[email protected]
144-
with:
145-
DEBUG: true
146-
147-
- name: "Test Docstrings"
148-
uses: pyansys/pydpf-actions/[email protected]
149-
with:
150-
MODULE: ${{env.MODULE}}
151-
PACKAGE_NAME: ${{env.PACKAGE_NAME}}
152-
153-
- name: "Kill all servers"
154-
uses: pyansys/pydpf-actions/[email protected]
155-
if: always()
156-
157-
- name: "Test API"
158-
shell: bash
159-
working-directory: tests
160-
run: |
161-
pytest $DEBUG --cov=ansys.dpf.${{env.MODULE}} --cov-report=xml --cov-report=html --cov-append --log-level=ERROR --junitxml=junit/test-results.xml --reruns 2 .
162-
163-
- name: "Kill all servers"
164-
uses: pyansys/pydpf-actions/[email protected]
165-
if: always()
166-
167-
- name: "Upload Test Results"
168-
uses: actions/upload-artifact@v3
169-
with:
170-
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ env.ANSYS_VERSION }}
171-
path: tests/junit/test-results.xml
172-
173-
- name: "Upload coverage to Codecov"
174-
uses: codecov/codecov-action@v3
175110

176-
Draft_Release:
111+
draft_release:
112+
name: "Draft release"
177113
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
178-
needs: [Style_Check, Build_and_Test, Documentation, Build_and_Test_other_Python]
114+
needs: [style, build_test, docs]
179115
runs-on: ubuntu-latest
180116
steps:
181117
- name: "Set up Python"

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ __pycache__
2424
*checkpoint.ipynb
2525

2626
# compiled documentation
27-
docs/_build
28-
docs/source/examples
27+
docs/_build/
28+
docs/**/_autosummary
29+
docs/source/examples/*
30+
docs/build_errors.txt
2931

3032
# pip files
3133
*.egg-info
@@ -34,4 +36,8 @@ dist/
3436

3537
# emacs temp files
3638
*~
37-
.#*
39+
.#*
40+
41+
# coverage
42+
.cov/
43+
.coverage

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 22.6.0
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/pycqa/isort
8+
rev: 5.10.1
9+
hooks:
10+
- id: isort
11+
args: [
12+
"--profile", "black",
13+
"--force-sort-within-sections",
14+
"--skip-glob", "*__init__.py",
15+
]
16+
17+
- repo: https://gitlab.com/PyCQA/flake8
18+
rev: 5.0.4
19+
hooks:
20+
- id: flake8
21+
22+
- repo: https://github.com/codespell-project/codespell
23+
rev: v2.2.1
24+
hooks:
25+
- id: codespell
26+
args: [
27+
"docs src",
28+
"*.py *.rst *.md",
29+
]
30+
31+
- repo: https://github.com/pycqa/pydocstyle
32+
rev: 6.1.1
33+
hooks:
34+
- id: pydocstyle
35+
additional_dependencies: [toml]
36+
exclude: ^(tests|examples)/
37+
args:
38+
# http://www.pydocstyle.org/en/latest/error_codes.html
39+
- --ignore=D203,D213,D401,D404,D406,D413
40+
41+
- repo: https://github.com/pre-commit/pre-commit-hooks
42+
rev: v4.3.0
43+
hooks:
44+
- id: check-merge-conflict
45+
- id: debug-statements
46+
47+
# this validates our github workflow files
48+
- repo: https://github.com/python-jsonschema/check-jsonschema
49+
rev: 0.17.1
50+
hooks:
51+
- id: check-github-workflows

Makefile

Lines changed: 0 additions & 37 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ files as well as several neutral formats (csv, hdf5, vtk,
1111
etc.). Various operators are available allowing the manipulation and
1212
the transformation of this data.
1313

14-
The Python `ansys.dpf.post` package provides an simplified Python
15-
interface to DPF, thus enabling rapid post-processing, without ever
14+
The Python `ansys-dpf-post` package provides a simplified Python
15+
interface to DPF, thus enabling rapid postprocessing without ever
1616
leaving a Python environment.
1717

18-
This module leverages the DPF-Core project's ``ansys.dpf.core``
19-
package and can be found by visiting [DPF-Core GitHub](https://github.com/pyansys/DPF-Core). Use ``ansys.dpf.core``
20-
for building more advanced and customized workflows using Ansys's DPF.
18+
This module leverages the DPF-Core project's ``ansys-dpf-core`` package and can
19+
be found by visiting [PyDPF-Core
20+
GitHub](https://github.com/pyansys/pydpf-core). Use ``ansys-dpf-core`` for
21+
building more advanced and customized workflows using Ansys's DPF.
2122

2223
Visit the [DPF-Post Documentation](https://postdocs.pyansys.com) for a
2324
detailed description of the package, or see the [Examples
@@ -36,8 +37,8 @@ pip install ansys-dpf-post
3637
You can also clone and install this repository with:
3738

3839
```
39-
git clone https://github.com/pyansys/DPF-Post
40-
cd DPF-Post
40+
git clone https://github.com/pyansys/pydpf-post
41+
cd pydpf-post
4142
pip install . --user
4243
```
4344

@@ -89,9 +90,10 @@ operators. This allows for fast post-processing of potentially
8990
multi-gigabyte models in a short script. DPF-Post also details the
9091
usage of the operators used when computing the results so you can also
9192
build your own custom, low level scripts using the
92-
[DPF-Core](https://github.com/pyansys/DPF-Core) module.
93+
[DPF-Core](https://github.com/pyansys/pydpf-core) module.
9394

9495

9596
### License
9697

97-
``DPF-Post`` is licensed under the MIT license. Please see the [LICENSE](https://github.com/pyansys/dpf-post/raw/master/LICENSE) for more details.
98+
``PyDPF-Post`` is licensed under the MIT license. For more information, see the
99+
[LICENSE](https://github.com/pyansys/dpf-post/raw/master/LICENSE).

ansys/dpf/post/__init__.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

ansys/dpf/post/_version.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

ansys/dpf/post/examples/__init__.py~

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)