Skip to content

Commit

Permalink
Merge branch 'master' into fix/select_on_dataframe_with_no_set_index
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi authored Nov 19, 2024
2 parents f750f5a + 11ffa75 commit 48dbbb0
Show file tree
Hide file tree
Showing 23 changed files with 603 additions and 171 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
MODULE: 'post'
DOCUMENTATION_CNAME: 'post.docs.pyansys.com'
MAIN_PYTHON_VERSION: '3.10'
ANSYS_VERSION: '251'
ANSYS_VERSION: '252'

jobs:
debug:
Expand All @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v4

- name: "Setup Python"
uses: actions/setup-python@v5.2.0
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
path: tests/junit/test-results.xml

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

retro:
name: "Retro-compatibility"
Expand All @@ -131,7 +131,7 @@ jobs:
matrix:
python-version: ["3.10"]
os: ["windows-latest", "ubuntu-latest"]
ANSYS_VERSION: ["242", "241", "232", "231", "222"]
ANSYS_VERSION: ["251", "242", "241", "232", "231", "222"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -182,13 +182,13 @@ jobs:
if: always()

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

examples:
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/examples.yml
with:
ANSYS_VERSION: "251"
ANSYS_VERSION: "252"
python_versions: '["3.10"]'
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
secrets: inherit
Expand All @@ -197,7 +197,7 @@ jobs:
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
uses: ./.github/workflows/docs.yml
with:
ANSYS_VERSION: "251"
ANSYS_VERSION: "252"
python_version: "3.10"
standalone_suffix: ${{ inputs.standalone_suffix || ''}}
event_name: ${{ github.event_name }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v4

- name: "Setup Python"
uses: actions/setup-python@v5.2.0
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
path: tests/junit/test-results.xml

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

retro:
name: "Retro-compatibility"
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
if: always()

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5

examples:
uses: ./.github/workflows/examples.yml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
ANSYS_VERSION:
required: false
type: string
default: "251"
default: "252"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
Expand Down Expand Up @@ -42,7 +42,7 @@ on:
description: "ANSYS version"
required: true
type: string
default: "251"
default: "252"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v5.2.0
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ inputs.python_version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
ANSYS_VERSION:
required: false
type: string
default: "251"
default: "252"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
Expand All @@ -29,7 +29,7 @@ on:
description: "ANSYS version to run."
required: true
type: string
default: "251"
default: "252"
standalone_suffix:
description: "Suffix of the branch on standalone"
required: false
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v5.2.0
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 1 addition & 5 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: 'post.docs.pyansys.com'
Expand Down Expand Up @@ -66,7 +62,7 @@ jobs:

upload_docs_release:
name: "Upload release documentation"
needs: [Publish_to_PyPI]
needs: [Publish_to_PyPI, get_latest_tag]
runs-on: ubuntu-latest
steps:
- name: "Download Release Asset - HTML"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ or later or of the standalone DPF Server.
For more information on getting a licensed copy of Ansys, visit the
`Ansys website <https://www.ansys.com/>`_.
For more information on getting the standalone DPF Server, visit the
`PyDPF-Core documentation <https://dpf.docs.pyansys.com/dev/user_guide/getting_started_with_dpf_server.html>`_.
`PyDPF-Core documentation <https://dpf.docs.pyansys.com/version/stable/getting_started/dpf_server.html>`_.


.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
[project]
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
name = "ansys-dpf-post"
version = "0.9.1.dev0"
version = "0.9.3.dev0"
description = "PyDPF-Post Python library."
readme = "README.md"
requires-python = ">=3.9,<4.0"
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_build.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
wheel==0.44.0
wheel==0.45.0
2 changes: 1 addition & 1 deletion requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ pytest-sphinx==0.6.3
sphinx-notfound-page==1.0.4
sphinx-copybutton==0.5.0
sphinx-gallery==0.18.0
ansys_sphinx_theme==1.1.6
ansys_sphinx_theme==1.2.1
sphinx-autodoc-typehints==2.5.0
pyvista==0.44.1
4 changes: 2 additions & 2 deletions requirements/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coverage==7.6.3
pytest-cov==5.0.0
coverage==7.6.7
pytest-cov==6.0.0
pytest-rerunfailures==14.0
pytest==8.3.3
pyvista==0.44.1
5 changes: 3 additions & 2 deletions src/ansys/dpf/post/fluid_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
_create_components,
)
from ansys.dpf.post.result_workflows._connect_workflow_inputs import (
_connect_initial_results_inputs,
_connect_workflow_inputs,
)
from ansys.dpf.post.result_workflows._sub_workflows import _create_norm_workflow
from ansys.dpf.post.result_workflows._utils import AveragingConfig, _append_workflows
Expand Down Expand Up @@ -252,9 +252,10 @@ def _get_result_workflow(
"mesh_scoping", initial_result_op.inputs.mesh_scoping
)

_connect_initial_results_inputs(
_connect_workflow_inputs(
initial_result_workflow=initial_result_workflow,
split_by_body_workflow=None,
rescoping_workflow=None,
force_elemental_nodal=False,
location=location,
selection=selection,
Expand Down
20 changes: 15 additions & 5 deletions src/ansys/dpf/post/harmonic_mechanical_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
----------------------------
"""
from typing import List, Tuple, Union
from typing import List, Optional, Tuple, Union
import warnings

from ansys.dpf import core as dpf
Expand All @@ -28,9 +28,13 @@
)
from ansys.dpf.post.result_workflows._connect_workflow_inputs import (
_connect_averaging_eqv_and_principal_workflows,
_connect_initial_results_inputs,
_connect_workflow_inputs,
)
from ansys.dpf.post.result_workflows._utils import (
AveragingConfig,
_append_workflows,
_Rescoping,
)
from ansys.dpf.post.result_workflows._utils import AveragingConfig, _append_workflows
from ansys.dpf.post.selection import Selection, _WfNames
from ansys.dpf.post.simulation import MechanicalSimulation

Expand All @@ -51,6 +55,7 @@ def _get_result_workflow(
expand_cyclic: Union[bool, List[Union[int, List[int]]]] = True,
phase_angle_cyclic: Union[float, None] = None,
averaging_config: AveragingConfig = AveragingConfig(),
rescoping: Optional[_Rescoping] = None,
) -> (dpf.Workflow, Union[str, list[str], None], str):
"""Generate (without evaluating) the Workflow to extract results."""
result_workflow_inputs = _create_result_workflow_inputs(
Expand All @@ -64,15 +69,17 @@ def _get_result_workflow(
amplitude=amplitude,
sweeping_phase=sweeping_phase,
averaging_config=averaging_config,
rescoping=rescoping,
)
result_workflows = _create_result_workflows(
server=self._model._server,
create_operator_callable=self._model.operator,
create_workflow_inputs=result_workflow_inputs,
)
_connect_initial_results_inputs(
_connect_workflow_inputs(
initial_result_workflow=result_workflows.initial_result_workflow,
split_by_body_workflow=result_workflows.split_by_bodies_workflow,
rescoping_workflow=result_workflows.rescoping_workflow,
selection=selection,
data_sources=self._model.metadata.data_sources,
streams_provider=self._model.metadata.streams_provider,
Expand All @@ -91,6 +98,7 @@ def _get_result_workflow(
result_workflows.component_extraction_workflow,
result_workflows.sweeping_phase_workflow,
result_workflows.norm_workflow,
result_workflows.rescoping_workflow,
],
output_wf,
)
Expand Down Expand Up @@ -235,7 +243,7 @@ def _get_result(
"and node_ids are mutually exclusive"
)

selection = self._build_selection(
selection, rescoping = self._build_selection(
base_name=base_name,
category=category,
selection=selection,
Expand All @@ -249,6 +257,7 @@ def _get_result(
location=location,
external_layer=external_layer,
skin=skin,
average_per_body=averaging_config.average_per_body,
)

wf, comp, base_name = self._get_result_workflow(
Expand All @@ -263,6 +272,7 @@ def _get_result(
expand_cyclic=expand_cyclic,
phase_angle_cyclic=phase_angle_cyclic,
averaging_config=averaging_config,
rescoping=rescoping,
)

# Evaluate the workflow
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/dpf/post/mesh_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def face_zones(self) -> dict:
string_field = self._core_object.get_property("face_zone_names")
for zone_id in string_field.scoping.ids:
zone_name = string_field.get_entity_data_by_id(zone_id)[0]
zones[zone_id] = zone_name
zones[zone_id.item()] = zone_name
self._face_zones = zones
return self._face_zones

Expand All @@ -164,7 +164,7 @@ def cell_zones(self) -> dict:
string_field = self._core_object.body_names
for zone_id in string_field.scoping.ids:
zone_name = string_field.get_entity_data_by_id(zone_id)[0]
zones[zone_id] = zone_name
zones[zone_id.item()] = zone_name
self._cell_zones = zones
return self._cell_zones

Expand Down Expand Up @@ -192,6 +192,6 @@ def cell_zones_to_face_zones(self) -> dict:
face_zone_ids = property_field.get_entity_data_by_id(
cell_zone_id
).tolist()
result[cell_zone_id] = face_zone_ids
result[cell_zone_id.item()] = face_zone_ids
self._cell_zones_to_face_zones = result
return self._cell_zones_to_face_zones
Loading

0 comments on commit 48dbbb0

Please sign in to comment.