From 8aa60fc2fd4996d87ef28d6bb1e786176e822b3a Mon Sep 17 00:00:00 2001 From: Prithwish Mukherjee Date: Wed, 17 Sep 2025 13:21:30 +0530 Subject: [PATCH 1/2] docs: Update Field data queries [skip tests] --- doc/source/user_guide/fields/field_data.rst | 45 +++++++++++++++------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/doc/source/user_guide/fields/field_data.rst b/doc/source/user_guide/fields/field_data.rst index 07c1859c79b9..698f1afd7f02 100644 --- a/doc/source/user_guide/fields/field_data.rst +++ b/doc/source/user_guide/fields/field_data.rst @@ -231,13 +231,17 @@ Retrieve data using ``get_field_data``, either by reusing or modifying request o .. note:: ``PathlinesFieldDataRequest`` allows only one unique ``field_name`` per batch. -Allowed values --------------- -Additionally there is an ``allowed_values`` method provided on all of -``field_name``, ``surface_name`` and ``surface_ids`` which tells you what object -names are accessible. +Queries +------- + +Several query methods are available for exploring data, checking status, +and retrieving information. -Some sample use cases are demonstrated below: + +Allowed values +~~~~~~~~~~~~~~ +The ``allowed_values()`` method is provided on ``fields``, ``surface_name``, +and ``surface_ids``. It returns the set of accessible object names or IDs. .. code-block:: python @@ -249,6 +253,20 @@ Some sample use cases are demonstrated below: >>> field_data.vector_fields.allowed_values() ['velocity', 'relative-velocity'] + >>> field_data.surfaces.allowed_values() + ['in1', 'in2', 'in3', 'inlet', 'inlet1', 'inlet2', 'out1', 'outlet', 'solid_up:1', 'solid_up:1:830', 'solid_up:1:830-shadow'] + + >>> field_data.surface_ids.allowed_values() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + + +Active status +~~~~~~~~~~~~~ + +The ``is_active()`` method checks whether a particular variable is available. + +.. code-block:: python + >>> from ansys.units import VariableCatalog >>> field_data.vector_fields.is_active(VariableCatalog.VELOCITY) True @@ -256,14 +274,17 @@ Some sample use cases are demonstrated below: False >>> field_data.scalar_fields.is_active(VariableCatalog.VELOCITY_MAGNITUDE) True - >>> field_data.scalar_fields.range("cell-weight") - [8.0, 24.0] - >>> field_data.surfaces.allowed_values() - ['in1', 'in2', 'in3', 'inlet', 'inlet1', 'inlet2', 'out1', 'outlet', 'solid_up:1', 'solid_up:1:830', 'solid_up:1:830-shadow'] - >>> field_data.surface_ids.allowed_values() - [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] +Value ranges +~~~~~~~~~~~~ + +The ``range()`` method returns the numeric range of values for a given variable. + +.. code-block:: python + + >>> field_data.scalar_fields.range("cell-weight") + [8.0, 24.0] Field data streaming From 3fa3eca2193c193b81949fc13a9cba30a2890eb0 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 17 Sep 2025 07:56:26 +0000 Subject: [PATCH 2/2] chore: adding changelog file 4478.documentation.md [dependabot-skip] --- doc/changelog.d/4478.documentation.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/4478.documentation.md diff --git a/doc/changelog.d/4478.documentation.md b/doc/changelog.d/4478.documentation.md new file mode 100644 index 000000000000..f9ce2db767f0 --- /dev/null +++ b/doc/changelog.d/4478.documentation.md @@ -0,0 +1 @@ +Update Field data queries [skip tests]