Skip to content

Commit 49b8eef

Browse files
authored
Propagate Premium ServerContext as default (#345)
* Remove setting context as Premium in examples/legacy/08-result_on_path_of_coordinates.py * Update documentation * Remove useless set of env ANSYS_DPF_SERVER_CONTEXT
1 parent a33d8f3 commit 49b8eef

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ jobs:
9797
run: |
9898
echo "ANSYS_DPF_ACCEPT_LA=Y" >> $GITHUB_ENV
9999
echo "ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}" >> $GITHUB_ENV
100-
echo "ANSYS_DPF_SERVER_CONTEXT=PREMIUM" >> $GITHUB_ENV
101100
102101
- name: Setup Python
103102
uses: actions/[email protected]

docs/source/user_guide/server_context.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ Server context
77
When using a DPF Server released after Ansys 2023 R1, a distinction is introduced between two
88
types of interaction with Ansys licenses:
99

10-
- When the **Entry** DPF Server context is active, underlying operations check if a valid Ansys
11-
license exists, but are not allowed to check-out any license. This means that operations requiring
12-
to check-out a license are not be available and raise an error.
1310
- When the **Premium** DPF Server context is active, underlying operations check if a valid
1411
Ansys license exists, and are allowed to check-out this license if needed. This means that all DPF
1512
features are available, but a license may be checked-out.
13+
- When the **Entry** DPF Server context is active, underlying operations check if a valid Ansys
14+
license exists, but are not allowed to check-out any license. This means that operations requiring
15+
to check-out a license are not be available and raise an error.
1616

17-
By default, using PyDPF-Post starts a DPF Server with the **Entry** context active.
17+
By default, using PyDPF-Post starts a DPF Server with the **Premium** context active.
1818
To learn more, see the `PyDPF-Core documentation <https://dpf.docs.pyansys.com/dev/user_guide/server_context.html>`_.
1919

2020
Change the default server context
2121
---------------------------------
2222

23-
The default context for the server is **Entry**. You can change the context using
23+
The default context for the server is **Premium**. You can change the context using
2424
the ``ANSYS_DPF_SERVER_CONTEXT`` environment variable. For more information, see
2525
the `ServerContext class documentation <https://dpf.docs.pyansys.com/dev/api/ansys.dpf.core.server_context.html>`_.
2626
You can also change the server context with this code:
2727

2828
.. code-block::
2929
3030
from ansys.dpf import post
31-
post.set_default_server_context(post.AvailableServerContexts.premium)
31+
post.set_default_server_context(post.AvailableServerContexts.entry)
3232
3333
3434
Release history

examples/02-Legacy/08-result_on_path_of_coordinates.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
This example shows how you can request a result on a
77
specific path of coordinates.
88
9-
.. note::
10-
This example requires the Premium Server Context.
11-
For more information, see :ref:`user_guide_server_context`.
12-
139
"""
1410

1511
###############################################################################
@@ -20,8 +16,6 @@
2016
from ansys.dpf import post
2117
from ansys.dpf.post import examples
2218

23-
post.set_default_server_context(post.AvailableServerContexts.premium)
24-
2519
###############################################################################
2620
# Get ``Solution`` object
2721
# -----------------------

tests/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,3 @@ def close_servers():
164164
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_5_0 = meets_version(
165165
get_server_version(core._global_server()), "5.0"
166166
)
167-
168-
# to call at the end
169-
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_0:
170-
core.server.shutdown_all_session_servers()
171-
try:
172-
core.set_default_server_context(core.AvailableServerContexts.premium)
173-
except core.errors.DpfVersionNotSupported:
174-
pass

0 commit comments

Comments
 (0)