diff --git a/examples/006_filter_composite_data_example.py b/examples/006_filter_composite_data_example.py index 6b20c3a7b..3568a7777 100644 --- a/examples/006_filter_composite_data_example.py +++ b/examples/006_filter_composite_data_example.py @@ -8,10 +8,10 @@ layered composites. You can filter strains and stresses by material, layer, or analysis ply. Filtering by analysis ply is implemented on the server side and exposed with the :func:`.get_ply_wise_data` function. In this case, the data is -filtered (and reduced) on the server side, and only the resulting field is returned +filtered (and reduced) on the server side and only the resulting field is returned to the client. This is the recommended way to filter data if possible. For more complex filtering, the data is transferred to the client side and filtered -using NumPy functionality. +using numpy functionality. The examples show filtering data by layer, spot, and node, as well as material or analysis ply ID. To learn more about how layered result data is organized, see :ref:`select_indices`. @@ -69,20 +69,20 @@ # %% # The easiest way to filter data by analysis ply is to use the :func:`.get_ply_wise_data` function. -# This function supports different reduction strategies such as computing the average -# or maximum/minimum over the spot locations. +# This function supports different reduction strategies such as computing the average, +# maximum, or minimum over the spot locations. # It also supports selecting a specific spot (TOP, MID, BOT) directly. # This example selects the maximum value over all spots for each node and then requests -# the elemental location that implies averaging over all nodes in an element. -# Using the :func:`.get_ply_wise_data` function has the advantage that all the averaging and -# filtering is done on the server side. +# the elemental location, which implies averaging over all nodes in an element. +# Using the :func:`.get_ply_wise_data` function has the advantage that all the averaging +# and filtering is done on the server side. if version_equal_or_later(server, "8.0"): elemental_max = get_ply_wise_data( field=stress_field, ply_name="P1L1__ud_patch ns1", mesh=composite_model.get_mesh(), component=Sym3x3TensorComponent.TENSOR11, - spot_reduction_strategy=SpotReductionStrategy.MAX, + reduction_strategy=SpotReductionStrategy.MAX, requested_location=dpf.locations.elemental, ) @@ -94,7 +94,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # This example shows how to filter data by layer, spot, and node using the generic filtering on # the client side. -# It plots stress values in the material direction for the first node and top spot. +# This code plots stress values in the material direction for the first node and top spot. # %% # Get element information for all elements and show the first one as an example. diff --git a/poetry.lock b/poetry.lock index 09e96edc0..39ad21b16 100644 --- a/poetry.lock +++ b/poetry.lock @@ -164,13 +164,13 @@ plotting = ["imageio (<2.28.1)", "imageio-ffmpeg", "matplotlib (>=3.2)", "pyvist [[package]] name = "ansys-sphinx-theme" -version = "0.12.5" +version = "0.13.0" description = "A theme devised by ANSYS, Inc. for Sphinx documentation." optional = true python-versions = ">=3.9,<4" files = [ - {file = "ansys_sphinx_theme-0.12.5-py3-none-any.whl", hash = "sha256:8b18c2c5b6eeffc382bd1b9fa4a860783a4a785a859c3530fce3bef06ebb7f80"}, - {file = "ansys_sphinx_theme-0.12.5.tar.gz", hash = "sha256:81e50f7cc9812a39ed02a4f3894c9a64bec2ff8d0402877cd90c6cc988ddac6d"}, + {file = "ansys_sphinx_theme-0.13.0-py3-none-any.whl", hash = "sha256:b62368ff2fc2066951980c260ce8307bf06331ef26517b4c5a0632712c180aaa"}, + {file = "ansys_sphinx_theme-0.13.0.tar.gz", hash = "sha256:93921a4db74eb7091445b44b1c6c6b39b791580b63869f8ee58be7726d95a83f"}, ] [package.dependencies] diff --git a/src/ansys/dpf/composites/server_helpers/_connect_to_or_start_server.py b/src/ansys/dpf/composites/server_helpers/_connect_to_or_start_server.py index 5c40384ae..0e303db1e 100644 --- a/src/ansys/dpf/composites/server_helpers/_connect_to_or_start_server.py +++ b/src/ansys/dpf/composites/server_helpers/_connect_to_or_start_server.py @@ -4,7 +4,7 @@ from ansys.dpf.core import connect_to_server from ansys.dpf.core import server as _dpf_server -from ansys.dpf.core import server_context, start_local_server +from ansys.dpf.core import start_local_server from ansys.dpf.composites.server_helpers._load_plugin import load_composites_plugin @@ -77,16 +77,10 @@ def connect_to_or_start_server( if len(list(connect_kwargs.keys())) > 0: server = connect_to_server( **connect_kwargs, - context=_dpf_server.server_context.ServerContext( - server_context.LicensingContextType.premium - ), ) else: server = start_local_server( ansys_path=ansys_path, - context=_dpf_server.server_context.ServerContext( - server_context.LicensingContextType.premium - ), ) required_version = "6.0" diff --git a/tests/conftest.py b/tests/conftest.py index eb6af7b30..0a6c5686e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -194,11 +194,7 @@ def __init__(self, ansys_path: str): self.ansys_path = ansys_path def __enter__(self): - context = dpf.server.server_context.ServerContext( - dpf.server_context.LicensingContextType.premium - ) - - server = dpf.start_local_server(ansys_path=self.ansys_path, context=context) + server = dpf.start_local_server(ansys_path=self.ansys_path) return ServerContext(port=None, platform=sys.platform, server=server) def __exit__(self, *args): @@ -300,9 +296,7 @@ def start_server(): server = _try_until_timeout(start_server, "Failed to start server.") _wait_until_server_is_up(server) - server.apply_context( - dpf.server.server_context.ServerContext(dpf.server_context.LicensingContextType.premium) - ) + load_composites_plugin(server, ansys_path=installer_path) yield server