From ba497660f6853b46e3b1c1055ebb78a0b0a39100 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:13:26 +0200 Subject: [PATCH] Update documentation for 2025.1.pre0 (#1675) * Update Compatibility for 2025.1.pre0 Signed-off-by: paul.profizi * Update dpf_server.rst for 2025.1.pre0 Signed-off-by: paul.profizi * Update doc/source/getting_started/compatibility.rst * Fix typing in collection_base.py Signed-off-by: paul.profizi * Fix docstring in plugins.py Signed-off-by: paul.profizi * Fix example references for hdf5 Signed-off-by: paul.profizi * Fix example references for modal cyclic Signed-off-by: paul.profizi * Fix example 03-fluids_isosurface.py formatting Signed-off-by: paul.profizi * Fix formatting in licensing.rst Signed-off-by: paul.profizi * Remove direct references to getting_started_with_dpf_server Signed-off-by: paul.profizi --------- Signed-off-by: paul.profizi --- README.md | 2 +- doc/source/getting_started/compatibility.rst | 12 +++++++++++- doc/source/getting_started/dpf_server.rst | 12 ++++++------ doc/source/getting_started/licensing.rst | 6 ++++++ doc/source/user_guide/how_to.rst | 2 +- .../05-file-IO/00-hdf5_double_float_comparison.py | 2 +- examples/05-file-IO/02-hdf5_serialize_and_read.py | 2 +- .../02-python_operators_with_dependencies.py | 2 +- examples/12-fluids/03-fluids_isosurface.py | 14 +++++++------- src/ansys/dpf/core/collection_base.py | 5 ++++- src/ansys/dpf/core/operator_specification.py | 2 +- src/ansys/dpf/core/plugins.py | 7 +++++-- src/ansys/dpf/core/server_context.py | 3 +-- 13 files changed, 46 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ab1335e008..573668ba4a 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ To reach the project support team, email [pyansys.core@ansys.com](mailto:pyansys PyDPF-Core requires DPF to be available. You can either have a compatible Ansys version installed or install the standalone ``ansys-dpf-server`` server package. For more information, see -[Getting Started with DPF Server](https://dpf.docs.pyansys.com/version/stable/user_guide/getting_started_with_dpf_server.html) +[Getting Started with DPF Server](https://dpf.docs.pyansys.com/version/stable/getting_started/dpf_server.html) in the PyDPF-Core documentation. For the compatibility between PyDPF-Core and Ansys, see diff --git a/doc/source/getting_started/compatibility.rst b/doc/source/getting_started/compatibility.rst index ebb19e327b..c1252e8048 100644 --- a/doc/source/getting_started/compatibility.rst +++ b/doc/source/getting_started/compatibility.rst @@ -49,6 +49,16 @@ package should also be synchronized with the server version. - ``ansys.grpc.dpf`` Python module version - ``ansys.dpf.gatebin`` binaries Python module version - ``ansys.dpf.gate`` Python module version + * - 9.0 (Ansys 2025 R1 pre0) + - 0.13.0 and later + - None + - None + - None + * - 8.2 (Ansys 2024 R2) + - 0.12.1 and later + - None + - None + - None * - 8.1 (Ansys 2024 R2 pre1) - 0.12.0 and later - None @@ -124,7 +134,7 @@ package should also be synchronized with the server version. - None - None * - 2.0 (Ansys 2021 R2) - - 0.3.0 and later** + - 0.3.0 to 0.9.0** - 0.3.0 - None - None diff --git a/doc/source/getting_started/dpf_server.rst b/doc/source/getting_started/dpf_server.rst index 05d3cfa9e9..b45ff7fe6d 100644 --- a/doc/source/getting_started/dpf_server.rst +++ b/doc/source/getting_started/dpf_server.rst @@ -25,11 +25,11 @@ Install DPF Server .. _target_installing_server: -#. Download the ``ansys_dpf_server_win_v2024.2.pre0.zip`` or ``ansys_dpf_server_lin_v2024.2.pre0.zip`` file as appropriate. +#. Download the ``ansys_dpf_server_win_v2025.1.pre0.zip`` or ``ansys_dpf_server_lin_v2025.1.pre0.zip`` file as appropriate. #. Unzip the package. #. Optional: download any other plugin ZIP file as appropriate and unzip the package. For example, to access the ``composites`` plugin for Linux, - download ``ansys_dpf_composites_lin_v2024.2.pre0.zip`` and unzip the package in the same location as ``ansys_dpf_server_lin_v2024.2.pre0.zip``. -#. Change to the root folder (``ansys_dpf_server_win_v2024.2.pre0``) of the unzipped package. + download ``ansys_dpf_composites_lin_v2025.1.pre0.zip`` and unzip the package in the same location as ``ansys_dpf_server_lin_v2025.1.pre0.zip``. +#. Change to the root folder (``ansys_dpf_server_win_v2025.1.pre0``) of the unzipped package. #. In a Python environment, run this command: .. code:: @@ -107,15 +107,15 @@ Run DPF Server in a Docker container ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DPF Server can be run in a Docker container. -#. Along with the ``ansys_dpf_server_lin_v2024.2.pre0.zip`` file mentioned earlier +#. Along with the ``ansys_dpf_server_lin_v2025.1.pre0.zip`` file mentioned earlier in :ref:`Install DPF Server `, download the ``Dockerfile`` file. #. Optional: download any other plugin ZIP file as appropriate. For example, to access the ``composites`` plugin for Linux, - download ``ansys_dpf_composites_lin_v2024.2.pre0.zip``. + download ``ansys_dpf_composites_lin_v2025.1.pre0.zip``. #. Copy all the ZIP files and ``Dockerfile`` file in a folder and navigate into that folder. #. To build the DPF Docker container, run the following command: .. code:: - docker build . -t dpf-core:v2024.2.pre0 --build-arg DPF_VERSION=242 + docker build . -t dpf-core:v2025.1.pre0 --build-arg DPF_VERSION=251 5. To run the DPF Docker container, license it. For more information, see :ref:`DPF Preview License Agreement`. diff --git a/doc/source/getting_started/licensing.rst b/doc/source/getting_started/licensing.rst index fd09b1ecb9..7138da7025 100644 --- a/doc/source/getting_started/licensing.rst +++ b/doc/source/getting_started/licensing.rst @@ -16,6 +16,7 @@ For more information on installing DPF Server, see :ref:`ref_dpf_server`. .. _target_to_license_terms: + License terms ------------- @@ -46,6 +47,7 @@ existing license for the edition and version of DPF Server that you intend to us .. _configure_licensing: + Configure licensing ------------------- @@ -78,6 +80,7 @@ the Ansys license mechanism that is used with DPF Server. .. _target_to_ansys_license_mechanism: + License checks and usage ------------------------ @@ -119,6 +122,7 @@ location is not the native result location. In that case, averaging occurs which as data transformation (such as elemental to nodal, nodal to elemental, or any other location change). .. _licensing_server_context: + Server context ~~~~~~~~~~~~~~ @@ -137,6 +141,7 @@ To update the context, apply a new server context: server.apply_context(dpf.AvailableServerContexts.premium) .. _licensing_errors: + Licensing errors ~~~~~~~~~~~~~~~~ @@ -153,6 +158,7 @@ The following user actions may fail due to licensing: .. _target_to_ansys_license_increments_list: + Compatible Ansys license increments ----------------------------------- diff --git a/doc/source/user_guide/how_to.rst b/doc/source/user_guide/how_to.rst index bc28573411..8d4247b932 100644 --- a/doc/source/user_guide/how_to.rst +++ b/doc/source/user_guide/how_to.rst @@ -8,7 +8,7 @@ How-tos plotting.rst custom_operators.rst - getting_started_with_dpf_server.rst + dpf_server.rst server_types.rst server_context.rst xmlfiles.rst diff --git a/examples/05-file-IO/00-hdf5_double_float_comparison.py b/examples/05-file-IO/00-hdf5_double_float_comparison.py index 1df96bf3e3..b39ed91817 100644 --- a/examples/05-file-IO/00-hdf5_double_float_comparison.py +++ b/examples/05-file-IO/00-hdf5_double_float_comparison.py @@ -1,6 +1,6 @@ # noqa: D400 """ -.. _ref_basic_hdf5: +.. _ref_io_hdf5_export_precision: HDF5 export and compare precision ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/05-file-IO/02-hdf5_serialize_and_read.py b/examples/05-file-IO/02-hdf5_serialize_and_read.py index 69dae16476..388269943b 100644 --- a/examples/05-file-IO/02-hdf5_serialize_and_read.py +++ b/examples/05-file-IO/02-hdf5_serialize_and_read.py @@ -1,5 +1,5 @@ """ -.. _ref_basic_hdf5: +.. _ref_io_hdf5_import_export: HDF5 export and import operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/08-python-operators/02-python_operators_with_dependencies.py b/examples/08-python-operators/02-python_operators_with_dependencies.py index 1c72c0a098..65038a566c 100644 --- a/examples/08-python-operators/02-python_operators_with_dependencies.py +++ b/examples/08-python-operators/02-python_operators_with_dependencies.py @@ -264,4 +264,4 @@ dpf.download_file(os.path.join(tmp, "out.glb"), os.path.join(os.getcwd(), "out.glb")) # %% -# You can download :download:`output ` from the ``gltf`` operator. +# You can download :download:`output ` from the ``gltf`` operator. diff --git a/examples/12-fluids/03-fluids_isosurface.py b/examples/12-fluids/03-fluids_isosurface.py index 994584b835..1dd2ac8d7d 100644 --- a/examples/12-fluids/03-fluids_isosurface.py +++ b/examples/12-fluids/03-fluids_isosurface.py @@ -2,7 +2,7 @@ .. _ref_fluids_isosurface: Compute iso-surfaces on fluid models ------------------------------------------- +------------------------------------ This example demonstrates how to compute iso-surfaces on fluid models. @@ -14,7 +14,7 @@ ############################################################################### # Import the ``dpf-core`` module and its examples files. -# ~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import ansys.dpf.core as dpf from ansys.dpf.core import examples @@ -22,7 +22,7 @@ ############################################################################### # Specify the file path. -# ~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~ # We work on a cas/dat.h5 file with only nodal variables. path = examples.download_cfx_heating_coil() @@ -33,7 +33,7 @@ ############################################################################### # Whole mesh scoping. -# ~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~ # We evaluate the mesh with the mesh_provider operator to scope the mesh_cut operator # with the whole mesh. @@ -44,7 +44,7 @@ ############################################################################### # Extract the physics variable -# ~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Here we choose to work with the static pressure by default which is a scalar and # nodal variable without multi-species/phases. With a multi-species case, # select one using qualifier ellipsis pins and connecting a LabelSpace "species"/"phase". @@ -63,7 +63,7 @@ ############################################################################### # Evaluate iso-surfaces -# ~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~ # We can finally use the iso_surfaces operator on this specific variable. # We choose to cut the whole mesh with 9 iso-surface manually selected between # the min and max of the static_pressure variable. @@ -102,7 +102,7 @@ ############################################################################### # Important note -# ------------------------------ +# -------------- # Iso-surfaces computation through the `mesh_cut` operator are only supported for Nodal Fields. # For Elemental variables, you must perform an averaging operation on the Nodes before # running the `mesh_cut` operator. This can be done by chaining the `elemental_to_nodal` operator diff --git a/src/ansys/dpf/core/collection_base.py b/src/ansys/dpf/core/collection_base.py index 9438d319a6..765fd89c48 100644 --- a/src/ansys/dpf/core/collection_base.py +++ b/src/ansys/dpf/core/collection_base.py @@ -24,7 +24,10 @@ dpf_vector, dpf_array, ) -from typing import Optional, Generic, TypeVar +from typing import Optional, Generic, TypeVar, TYPE_CHECKING + +if TYPE_CHECKING: + from ansys.dpf.core.support import Support from ansys.dpf.gate.integral_types import MutableListInt32 diff --git a/src/ansys/dpf/core/operator_specification.py b/src/ansys/dpf/core/operator_specification.py index 3ad053c9c4..6e7782849c 100644 --- a/src/ansys/dpf/core/operator_specification.py +++ b/src/ansys/dpf/core/operator_specification.py @@ -496,7 +496,7 @@ class SpecificationProperties: Optional license name to check out that is used to run the operator. The value "any_dpf_supported_increments" tells DPF than any DPF-accepted license is accepted by this operator (see `here - `_). # noqa + `_). # noqa """ diff --git a/src/ansys/dpf/core/plugins.py b/src/ansys/dpf/core/plugins.py index 90e5609ed9..a3880ff008 100644 --- a/src/ansys/dpf/core/plugins.py +++ b/src/ansys/dpf/core/plugins.py @@ -1,8 +1,8 @@ """ Python DPF plugins utilities ============================ - Contains the utilities specific to installing and using Python DPF plugins. + """ import os.path try: @@ -17,7 +17,7 @@ def load_plugin_on_server(plugin, server=None, symbol="load_operators", generate_operators=False): """Load a DPF Python plugin on the global or given DPF server. - Parameters + Parameters ---------- plugin: DPF Python plugin to load. @@ -25,6 +25,9 @@ def load_plugin_on_server(plugin, server=None, symbol="load_operators", generate DPF server to load the plugin onto. symbol: Name of the function recording the operators in the plugin. + generate_operators: + Whether to generate the Python code for the operators in the plugin. + """ server = server_module.get_or_create_server(server) plugin_name = plugin.split("-")[-1] diff --git a/src/ansys/dpf/core/server_context.py b/src/ansys/dpf/core/server_context.py index 3379100c01..adfc0379a9 100644 --- a/src/ansys/dpf/core/server_context.py +++ b/src/ansys/dpf/core/server_context.py @@ -61,8 +61,7 @@ class LicenseContextManager: License increment to check out. To improve script efficiency, this license increment should be consistent with the increments required by the following Operators. If ``None``, the first available increment of this - `list `_ + `list `_ is checked out. license_timeout_in_seconds: float, optional If an increment is not available by the maximum time set here, check out fails. Default is: