Skip to content

Commit 5f9f897

Browse files
Doc/corrections to premium as default (#867)
* Corrections from comments on initial PR * Improve description of the LicenseContextManager in the example. * Update examples/00-basic/13-manage_licensing.py Co-authored-by: JennaPaikowsky <[email protected]> --------- Co-authored-by: JennaPaikowsky <[email protected]>
1 parent 2c000e3 commit 5f9f897

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

docs/source/user_guide/getting_started_with_dpf_server.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ DPF Server is protected by an Ansys licensing mechanism.
133133

134134
DPF capabilities are available through the following main contexts:
135135

136-
- **Premium:** This context, which is the default, allows DPF to perform license checkouts,
136+
- **Premium:** This default context allows DPF to perform license checkouts,
137137
making licensed DPF operators available.
138138
- **Entry:** This context does not allow DPF to perform any license checkout,
139139
meaning that licensed DPF operators fail.

docs/source/user_guide/server_context.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class and :ref:`user_guide_xmlfiles`.
1818

1919
Two main licensing context type capabilities are available:
2020

21-
- **Premium:** This context, which is the default, allows DPF to perform license checkouts,
21+
- **Premium:** This default context allows DPF to perform license checkouts,
2222
making licensed DPF operators available.
2323
- **Entry:** This context does not allow DPF to perform any license checkout,
2424
meaning that licensed DPF operators fail.
@@ -82,11 +82,11 @@ with this code:
8282
Server Context of type LicensingContextType.entry with no xml path
8383
8484
.. warning::
85-
As starting an ``InProcess`` server means linking the DPF binaries to your current python
85+
As starting an ``InProcess`` server means linking the DPF binaries to your current Python
8686
process, you cannot start a new ``InProcess`` server. Thus, if your local ``InProcess`` server
8787
is already **Premium**, you cannot set it back as **Entry**.
8888
``InProcess`` being the default server type, the proper commands to work as **Entry** should be
89-
set right at the beginning of your script.
89+
set at the start of your script.
9090

9191

9292

examples/00-basic/13-manage_licensing.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
"""
22
.. _ref_manage_licensing:
33
4-
Manage the DPF licensing logic via the server context
5-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
Manage the DPF licensing logic using the server context
5+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66
7-
This examples shows how to manage the licensing logic of a DPF server using a `ServerContext`.
7+
This example shows how to manage the licensing logic of a DPF server using a `ServerContext`.
88
9-
Preventing DPF from checking licenses out and blocking increments is possible
10-
with the **Entry** context.
9+
You can prevent DPF from checking licenses out and blocking increments by using the
10+
**Entry** context.
1111
1212
.. warning::
13-
As starting an ``InProcess`` server means linking the DPF binaries to your current python
14-
process, you cannot start a new ``InProcess`` server. Thus, if your local ``InProcess`` server
15-
is already **Premium**, you cannot set it back as **Entry**.
16-
``InProcess`` being the default server type, the proper commands to work as **Entry** should be
17-
set right at the beginning of your script.
13+
You cannot start a new ``InProcess`` server, as starting an ``InProcess`` server means linking
14+
the DPF binaries to your current Python process. If your local ``InProcess`` server is already
15+
set to **Premium**, you cannot set it back to **Entry**.
16+
Since ``InProcess`` is the default server type, put the commands to set the **Entry** server
17+
context at the start of your script.
1818
1919
.. note::
2020
This example requires DPF 6.1 (Ansys 2023R2) or above.
@@ -35,7 +35,7 @@
3535
# The context is shown as Entry
3636
print(server.context)
3737

38-
# A server of type InProcess being linked to the current python process,
38+
# A server of type InProcess being linked to the current Python process,
3939
# if an InProcess server already exists as Premium, you cannot set it back as Entry.
4040

4141
#######################################################################################
@@ -75,8 +75,10 @@
7575
out = op_premium.eval()
7676
print(out)
7777

78-
###############################################################################################
79-
# When Premium, using a LicenseContextManaged allows to control your interaction with a license
78+
###################################################################################################
79+
# When Premium, using a LicenseContextManaged allows you to control your interaction with a license
80+
# It gives direct control over when the license check-out and check-in occur, as well as which
81+
# license increment is used, and for what maximum duration.
8082

8183
# Use the LicenseContextManager to block a specific increment for a limited duration
8284
with dpf.LicenseContextManager(increment_name="preppost", license_timeout_in_seconds=1.0) as lic:

src/ansys/dpf/core/operator_specification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class SpecificationProperties:
461461
Snake case name of the plugin it belongs to.
462462
463463
license: str
464-
Optional license name to check out to run the operator.
464+
Optional license name to check out that is used to run the operator.
465465
The value "any_dpf_supported_increments" tells DPF than any DPF-accepted license
466466
is accepted by this operator (see `here
467467
<https://dpf.docs.pyansys.com/version/stable/user_guide/getting_started_with_dpf_server.html#ansys-licensing>`_). # noqa

src/ansys/dpf/core/server_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
=============
44
55
Gives the ability to choose the context with which the server should be started.
6-
The context allows to choose the licensing logic for operators.
6+
The context allows you to choose the licensing logic for operators.
77
For every context, DPF always checks if an Ansys license is available.
88
By default, a **Premium** type of :class:`ServerContext` is used,
99
meaning that any operator requiring a license check-out can do so.

0 commit comments

Comments
 (0)