Skip to content

Commit

Permalink
Merge branch 'master' into doc/new-tutorials-section
Browse files Browse the repository at this point in the history
  • Loading branch information
luisaFelixSalles authored Dec 3, 2024
2 parents 42c47eb + ce858d8 commit 991b95a
Show file tree
Hide file tree
Showing 27 changed files with 663 additions and 139 deletions.
6 changes: 3 additions & 3 deletions .ci/run_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
print(file)
minimum_version_str = get_example_required_minimum_dpf_version(file)
if float(server_version) - float(minimum_version_str) < -0.05:
print(f"Example skipped as it requires DPF {minimum_version_str}.")
print(f"Example skipped as it requires DPF {minimum_version_str}.", flush=True)
continue
try:
out = subprocess.check_output([sys.executable, file])
except subprocess.CalledProcessError as e:
sys.stderr.write(str(e.args))
if e.returncode != 3221225477:
print(out)
print(out, flush=True)
raise e
print("PASS")
print("PASS", flush=True)
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ body:
id: installed-packages
attributes:
label: Installed packages
description: Run `python -m pip list` to list installed packages
placeholder: Paste the output of `python -m pip list` here
description: Run `python -m pip freeze` to list installed packages
placeholder: Paste the output of `python -m pip freeze` here
validations:
required: true
11 changes: 11 additions & 0 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.10", "3.11"]'
DOCSTRING: false
wheel: false
wheelhouse: true
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
Expand All @@ -109,6 +110,7 @@ jobs:
with:
ANSYS_VERSION: ${{ github.event.inputs.ansys_version || '251' }}
python_versions: '["3.10", "3.11"]'
DOCSTRING: false
wheel: false
wheelhouse: false
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
Expand All @@ -131,6 +133,15 @@ jobs:
standalone_suffix: ${{ github.event.inputs.standalone_branch_suffix || '.pre0' }}
secrets: inherit

retro_242:
name: "retro 242"
uses: ./.github/workflows/tests.yml
with:
ANSYS_VERSION: "242"
python_versions: '["3.9"]'
DOCSTRING: false
secrets: inherit

retro_241:
name: "retro 241"
uses: ./.github/workflows/tests.yml
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ jobs:
shell: bash
working-directory: .ci
run: |
echo on
python run_examples.py
- name: "Kill all servers"
Expand Down
8 changes: 4 additions & 4 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions doc/source/dpf_ansys_file_support_table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _ref_dpf_ansys_file_support_table:

.. table:: DPF support of ANSYS files
:widths: auto
:align: center

+--------------------+------------------------+----------------------------------+----------------------------------+
| **Solver** | **File format** | **Server version** | **DPF examples** |
+====================+========================+==================================+==================================+
| | .rst, .mode | **1.0** and later | :ref:`ref_basic_example` |
| MAPDL | .rfrq, .rdsp | (*Ansys 2021 R1*) | |
| +------------------------+----------------------------------+----------------------------------+
| | .psd, .prs | **10.0** and later | |
| | | (*Ansys 2025 R2 pre0*) | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| LS DYNA | .d3plot, .binout | **4.0** and later | :ref:`examples_lsdyna` |
| | | (*Ansys 2022 R2*) | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| | *CFF restart files* | | :ref:`ref_fluids_model` |
| | .cas/dat.h5 | +----------------------------------+
| | | **7.0** and later | :ref:`ref_fluids_mesh` |
| Fluent +------------------------+ (*Ansys 2024 R1 pre0*) +----------------------------------+
| | *Project files* | | :ref:`ref_fluids_results` |
| | .flprj | | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| | *CFF files* | | :ref:`examples_cfx` |
| | .cas/dat.cff | +----------------------------------+
| | .res | **7.0** and later | :ref:`ref_fluids_model` |
| CFX +------------------------+ (*Ansys 2024 R1 pre0*) +----------------------------------+
| | *Project files* | | :ref:`ref_fluids_mesh` |
| | .flprj | +----------------------------------+
| | | | :ref:`ref_fluids_results` |
+--------------------+------------------------+----------------------------------+----------------------------------+
29 changes: 1 addition & 28 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,7 @@ apps for both data input and data output, including visualization and
result plots. The following table shows an exhaustive list of supported
apps by DPF and their related formats:

.. table:: Truth table for "not"
:widths: auto
:align: center

+--------------------+------------------------+----------------------------------+----------------------------------+
| **Solver** | **File format** | **Server version** | **DPF examples** |
+====================+========================+==================================+==================================+
| || .rst, .mode || **1.0** and later | :ref:`ref_basic_example` |
| MAPDL || .rfrq, .rdsp || (*Ansys 2021 R1*) | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| LS DYNA | .d3plot, .binout || **4.0** and later | :ref:`examples_lsdyna` |
| | || (*Ansys 2022 R2*) | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| || *CFF restart files* || | :ref:`ref_fluids_model` |
| || .cas/dat.h5 || +----------------------------------+
| | || **7.0** and later | :ref:`ref_fluids_mesh` |
| Fluent +------------------------+| (*Ansys 2024 R1 pre0*) +----------------------------------+
| || *Project files* | | :ref:`ref_fluids_results` |
| || .flprj | | |
+--------------------+------------------------+----------------------------------+----------------------------------+
| || *CFF files* || | :ref:`examples_cfx` |
| || .cas/dat.cff || +----------------------------------+
| || .res || **7.0** and later | :ref:`ref_fluids_model` |
| CFX +------------------------+| (*Ansys 2024 R1 pre0*) +----------------------------------+
| || *Project files* | | :ref:`ref_fluids_mesh` |
| || .flprj | +----------------------------------+
| || | | :ref:`ref_fluids_results` |
+--------------------+------------------------+----------------------------------+----------------------------------+
.. include:: dpf_ansys_file_support_table.rst

Visualisation is ensured by VTK and leverages `PyVista tools
<https://docs.pyvista.org>`_.
Expand Down
2 changes: 1 addition & 1 deletion examples/04-advanced/13-manage_licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# license increment is used, and for what maximum duration.

# Use the LicenseContextManager to block a specific increment for a limited duration
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=1.0) as lic:
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=5.0) as lic:
# Instantiate the licensed operator
out = op_premium.eval()
print(out)
12 changes: 2 additions & 10 deletions examples/08-python-operators/00-wrapping_numpy_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,9 @@
#
# Download and display the Python script.

from ansys.dpf.core import examples
from ansys.dpf import core as dpf

from ansys.dpf.core.examples import download_easy_statistics

GITHUB_SOURCE_URL = (
"https://github.com/ansys/pydpf-core/" "raw/examples/first_python_plugins/python_plugins"
)
EXAMPLE_FILE = GITHUB_SOURCE_URL + "/easy_statistics.py"
operator_file_path = examples.downloads._retrieve_file(
EXAMPLE_FILE, "easy_statistics.py", "python_plugins"
)
operator_file_path = download_easy_statistics()

with open(operator_file_path, "r") as f:
for line in f.readlines():
Expand Down
26 changes: 1 addition & 25 deletions examples/08-python-operators/01-package_python_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,9 @@
#
# Download the ``average_filter_plugin`` plug-in package that has already been
# created for you.

import os

from ansys.dpf.core import examples
from ansys.dpf import core as dpf


print("\033[1m average_filter_plugin")
file_list = ["__init__.py", "operators.py", "operators_loader.py", "common.py"]
plugin_folder = None
GITHUB_SOURCE_URL = (
"https://github.com/ansys/pydpf-core/raw/"
"examples/first_python_plugins/python_plugins/average_filter_plugin"
)

for file in file_list:
EXAMPLE_FILE = GITHUB_SOURCE_URL + "/average_filter_plugin/" + file
operator_file_path = examples.downloads._retrieve_file(
EXAMPLE_FILE, file, "python_plugins/average_filter_plugin"
)
plugin_folder = os.path.dirname(operator_file_path)
print(f"\033[1m {file}:\n \033[0m")
with open(operator_file_path, "r") as f:
for line in f.readlines():
print("\t\t\t" + line)
print("\n\n")

plugin_folder = examples.download_average_filter_plugin()

###############################################################################
# Load the plug-in package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,40 +60,9 @@
import os

from ansys.dpf.core import examples
from ansys.dpf import core as dpf


print("\033[1m gltf_plugin")
file_list = [
"gltf_plugin/__init__.py",
"gltf_plugin/operators.py",
"gltf_plugin/operators_loader.py",
"gltf_plugin/requirements.txt",
"gltf_plugin/gltf_export.py",
"gltf_plugin/texture.png",
"gltf_plugin.xml",
]
import os

plugin_path = examples.download_gltf_plugin()
folder_root = os.path.join(os.getcwd().rsplit("pydpf-core", 1)[0], "pydpf-core")
source_path_in_repo = r"doc\source\examples\07-python-operators\plugins"
operator_folder = os.path.join(folder_root, source_path_in_repo)
print(operator_folder)
plugin_path = None

for file in file_list:
operator_file_path = os.path.join(operator_folder, file)

print(f"\033[1m {file}\n \033[0m")
if (
os.path.splitext(file)[1] == ".py" or os.path.splitext(file)[1] == ".xml"
) and file != "gltf_plugin/gltf_export.py":
with open(operator_file_path, "r") as f:
for line in f.readlines():
print("\t\t\t" + line)
print("\n\n")
if plugin_path is None:
plugin_path = os.path.dirname(operator_file_path)

# %%
# To add third-party modules as dependencies to a plug-in package, you must
Expand Down
3 changes: 2 additions & 1 deletion 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.3.dev0"
version = "0.13.4.dev0"
description = "Data Processing Framework - Python Core "
readme = "README.md"
requires-python = ">=3.9, <4"
Expand Down Expand Up @@ -44,6 +44,7 @@ plotting = [
"matplotlib>=3.2",
# 3D plotting
"pyvista>=0.32.0",
"vtk!=9.4.0",
# Animations
"imageio < 2.28.1",
"imageio-ffmpeg",
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_build.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==24.10.0
build==1.2.2.post1
chevron==0.14.0
wheel==0.45.0
wheel==0.45.1
2 changes: 1 addition & 1 deletion requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jupyter_sphinx==0.5.3
nbsphinx==0.9.5
pypandoc==1.14
pytest-sphinx==0.6.3
pyvista==0.44.1
pyvista==0.44.2
sphinx==7.1.0
sphinx-copybutton==0.5.2
sphinx-gallery==0.18.0
Expand Down
6 changes: 3 additions & 3 deletions requirements/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ansys-platform-instancemanagement==1.1.2
coverage==7.6.7
coverage==7.6.8
imageio==2.36.0
imageio-ffmpeg==0.5.1
pytest==8.3.3
pytest==8.3.4
pytest-cov==5.0.0
pytest-order==1.3.0
pytest-rerunfailures==15.0
pyvista==0.44.1
pyvista==0.44.2
vtk==9.3.1
Loading

0 comments on commit 991b95a

Please sign in to comment.