Skip to content

Commit

Permalink
Merge branch 'master' into feat/any_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cbellot000 authored Nov 18, 2024
2 parents f9b0876 + 342adfb commit 223033d
Show file tree
Hide file tree
Showing 33 changed files with 458 additions and 68 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ body:
label: Which DPF/Ansys version are you using?
multiple: true
options:
- 'DPF Server 2025.2.pre0'
- 'Ansys 2025 R1'
- 'DPF Server 2025.1.pre0'
- 'Ansys 2024 R2'
- 'DPF Server 2024.2.pre1'
Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
description: "ANSYS version"
required: false
type: string
default: "251"
default: "252"
standalone_branch_suffix:
description: 'Suffix of the branch on standalone'
required: false
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
uses: ./.github/workflows/tests.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: false
Expand All @@ -116,7 +116,7 @@ jobs:
uses: ./.github/workflows/tests.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: false
Expand All @@ -129,7 +129,7 @@ jobs:
uses: ./.github/workflows/test_docker.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit

Expand All @@ -138,7 +138,7 @@ jobs:
uses: ./.github/workflows/examples_docker.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
python_versions: '["3.9"]'
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit
Expand All @@ -148,7 +148,7 @@ jobs:
uses: ./.github/workflows/docs.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
event_name: ${{ github.event_name }}
secrets: inherit
Expand All @@ -173,11 +173,22 @@ jobs:
uses: ./.github/workflows/examples.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
python_versions: '["3.9"]'
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
secrets: inherit

retro_251:
name: "retro 251"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "251"
python_versions: '["3.9"]'
DOCSTRING: false
standalone_suffix: ''
secrets: inherit

retro_242:
name: "retro 242"
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
Expand Down Expand Up @@ -237,7 +248,7 @@ jobs:
uses: ./.github/workflows/pydpf-post.yml
needs: pick_server_suffix
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '252' }}
post_branch: "master"
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
test_docstrings: "true"
Expand Down
33 changes: 27 additions & 6 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,43 @@ jobs:
name: ${{ steps.wheel.outputs.wheel_name }}
path: dist/${{ steps.wheel.outputs.wheel_name }}

tests_3_9:
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: true
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
secrets: inherit

tests:
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9", "3.10", "3.11"]'
wheel: ${{ matrix.python-version == '3.9' }}
python_versions: '["3.10", "3.11"]'
wheel: false
wheelhouse: true
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
secrets: inherit

tests_any_3_9:
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9"]'
wheel: true
wheelhouse: false
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
test_any: true
secrets: inherit

tests_any:
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.9", "3.10", "3.11"]'
wheel: ${{ matrix.python-version == '3.9' }}
python_versions: '["3.10", "3.11"]'
wheel: false
wheelhouse: false
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
test_any: true
Expand Down Expand Up @@ -211,11 +232,11 @@ jobs:
draft_release:
name: "Draft Release"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [style, tests, docs, examples, retro_232, retro_231, retro_222, docker_tests]
needs: [style, tests, tests_3_9, tests_any, tests_any_3_9, docs, examples, retro_232, retro_231, retro_222, docker_tests]
runs-on: ubuntu-latest
steps:
- name: "Download artifacts"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4

- name: "Display downloaded files"
run: ls -R
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ on:
description: 'Release tag'
default: 'latest'
type: string
checkout_ref:
description: 'Ref to checkout for doc index (default to current branch)'
default: ''
type: string

env:
DOCUMENTATION_CNAME: 'dpf.docs.pyansys.com'
Expand Down Expand Up @@ -93,6 +89,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
decompress-artifact: true
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

update_ansys_lab_examples:
uses: ./.github/workflows/ansys_lab.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
- name: "Upload wheel to artifacts"
if: (inputs.wheel == 'true') && !(inputs.test_any && (matrix.os == 'ubuntu-latest') )
if: (inputs.wheel == 'true') && !( (inputs.test_any == 'true') && (matrix.os == 'ubuntu-latest') )
uses: actions/upload-artifact@v4
with:
name: ${{ steps.wheel.outputs.wheel_name }}
Expand Down
54 changes: 27 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ exclude: >
)
repos:

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.3
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.3
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words=./doc/styles/config/vocabularies/ANSYS/accept.txt"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words=./doc/styles/config/vocabularies/ANSYS/accept.txt"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: requirements-txt-fixer
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: requirements-txt-fixer

- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.4.3
hooks:
- id: add-license-headers
args:
- --start_year=2020
- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.4.4
hooks:
- id: add-license-headers
args:
- --start_year=2020

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.2
hooks:
- id: check-github-workflows
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
8 changes: 4 additions & 4 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def reset_servers(gallery_conf, fname, when):
"image_dark": pyansys_logo_dark_mode,
"image_light": pyansys_logo_light_mode,
},
"logo_link": "https://docs.pyansys.com",
"github_url": "https://github.com/ansys/pydpf-core",
"show_prev_next": False,
"show_breadcrumbs": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# Import necessary modules
from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.gate.errors import DPFServerException


###############################################################################
Expand All @@ -59,7 +60,7 @@
# Starting with DPF 2025.1.pre1
cs = dpf.operators.result.coordinate_system()
cs.inputs.data_sources.connect(model)
except (KeyError, ansys.dpf.gate.errors.DPFServerException) as e:
except (KeyError, DPFServerException) as e:
# For previous DPF versions
cs = model.operator(r"mapdl::rst::CS")

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = ["setuptools>=61.0.0", "wheel"]
[project]
# Check https://setuptools.pypa.io/en/stable/userguide/quickstart.html for all available sections
name = "ansys-dpf-core"
version = "0.13.1.dev0"
version = "0.13.3.dev0"
description = "Data Processing Framework - Python Core "
readme = "README.md"
requires-python = ">=3.9, <4"
Expand All @@ -30,7 +30,7 @@ dependencies = [
"google-api-python-client",
"grpcio >=1.63.0",
"importlib-metadata >=4.0",
"numpy<2",
"numpy",
"packaging",
"protobuf",
"psutil",
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pytest-sphinx==0.6.3
pyvista==0.44.1
sphinx==7.1.0
sphinx-copybutton==0.5.2
sphinx-gallery==0.17.1
sphinx-gallery==0.18.0
sphinx-notfound-page==1.0.4
sphinx-reredirects==0.1.3
sphinx_design==0.6.1
Expand Down
6 changes: 3 additions & 3 deletions requirements/requirements_install.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
importlib-metadata==8.5.0
numpy==2.1.2
packaging==24.0
numpy==2.1.3
packaging==24.2
psutil==6.1.0
tqdm==4.66.1
tqdm==4.67.0
2 changes: 1 addition & 1 deletion requirements/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansys-platform-instancemanagement==1.1.2
coverage==7.6.4
coverage==7.6.5
imageio==2.36.0
imageio-ffmpeg==0.5.1
pytest==8.3.3
Expand Down
1 change: 1 addition & 0 deletions src/ansys/dpf/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ServerToAnsysVersion:
"8.2": "2024R2",
"9.0": "2025R1",
"9.1": "2025R1",
"10.0": "2025R2",
}

def __getitem__(self, item):
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/custom_fields_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class BodyFieldsContainer(FieldsContainer):
>>> model = dpf.Model(examples.download_all_kinds_of_complexity_modal())
>>> fc = model.results.displacement.on_all_time_freqs.split_by_body.eval()
>>> fc.get_mat_scoping().ids[3]
45
np.int32(45)
>>> len(fc.get_fields_by_mat_id(45))
45
>>> f_time_2 = fc.get_field_by_mat_id(45, timeid=2)
Expand Down
Loading

0 comments on commit 223033d

Please sign in to comment.