Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More docs and url renaming #316

Merged
merged 7 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@ doc/source/api/schemas
test_results*.xml
mapdl_motorbike_frame.zip
examples/mapdl_motorbike_frame/task_input_file*
build_info.*
build_info.*
doc/source/api/ansys
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The PyHPS documentation contains these sections:
- `User guide <https://hps.docs.pyansys.com/version/dev/user_guide/index.html>`_: Describes the basics
of how to use PyHPS to interact with Ansys HPS.
- `Examples <https://hps.docs.pyansys.com/version/dev/examples/index.html>`_: Provides examples of how
to interact with a Remote Execution Platform (REP) server in Python using PyHPS.
to interact with Ansys HPS in Python using PyHPS.
- `API reference <https://hps.docs.pyansys.com/version/dev/api/index.html>`_: Describes PyHPS functions,
classes, methods, and their parameters and return values so that you can understand how to
interact with them programmatically
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

`Keycloak <https://www.keycloak.org>`_ is used for identity and access management. This open source
solution provides a variety of options for authentication and authorization. Users authenticate
with Keycloak rather than with the application, allowing flexibility in how the sign-in experience

Check warning on line 6 in doc/source/api/auth.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api/auth.rst#L6

[Google.WordList] Use 'app' instead of 'application'.
Raw output
{"message": "[Google.WordList] Use 'app' instead of 'application'.", "location": {"path": "doc/source/api/auth.rst", "range": {"start": {"line": 6, "column": 36}}}, "severity": "WARNING"}
is delivered.

Keycloak is exposed at ``https://hostname:port/rep/auth/api``, which is what the ``ansys.hps.client.auth``
Keycloak is exposed at ``https://hostname:port/hps/auth/api``, which is what the ``ansys.hps.client.auth``
module wraps around.

Authentication function
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ HTTP requests returning an unsuccessful status code raise one of these exception
* :exc:`ansys.hps.client.APIError` for server errors (5xx status code), such as for internal server
errors or not implemented.

All exceptions that an Ansys REP client explicitly raises are inherited from the :exc:`ansys.hps.client.HPSError`
All exceptions that a PyHPS client explicitly raises are inherited from the :exc:`ansys.hps.client.HPSError`
base class.

.. autoexception:: ansys.hps.client.HPSError
Expand Down
4 changes: 2 additions & 2 deletions doc/source/api/jms.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Job Management Service (JMS)
============================

Ansys REP includes the Job Management Service (JMS), which is the main service for storing
Ansys HPS includes the Job Management Service (JMS), which is the main service for storing
and evaluating jobs using multiple heterogeneous compute resources.

The ``ansys.hps.client.jms`` Python subpackage wraps around the JMS REST API,
which is available at ``https://hostname:port/rep/jms/api``.
which is available at ``https://hostname:port/hps/jms/api``.

APIs
----
Expand Down
4 changes: 2 additions & 2 deletions doc/source/api/rms.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Resource Management Service (RMS)
=================================

Ansys REP includes the Resource Management Service (RMS), which is the main service
Ansys HPS includes the Resource Management Service (RMS), which is the main service
for managing heterogeneous compute resources.

The ``ansys.hps.client.rms`` Python subpackage wraps around the RMS REST API, which
is available at ``https://hostname:port/rep/rms/api``.
is available at ``https://hostname:port/hps/rms/api``.

APIs
----
Expand Down
2 changes: 2 additions & 0 deletions doc/source/examples/ex_cfx_static_mixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/cfx_static_mixer/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py

This example uses this ``exec_cfx.py`` execution script instead of a solver command line:

.. literalinclude:: ../../../examples/cfx_static_mixer/exec_cfx.py
:language: python
:lines: 23-
:caption: exec_cfx.py
1 change: 1 addition & 0 deletions doc/source/examples/ex_fluent_2d_heat_exchanger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/fluent_2d_heat_exchanger/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py
4 changes: 3 additions & 1 deletion doc/source/examples/ex_fluent_nozzle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Fluent nozzle
=============

This example shows how to submit a Fluent nozzle model for solving on REP.
This example shows how to submit a Fluent nozzle model for solving on HPS.

.. only:: builder_html

Expand All @@ -15,10 +15,12 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/fluent_nozzle/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py

The example uses an ``exec_fluent.py`` execution script instead of a solver command line.

.. literalinclude:: ../../../examples/fluent_nozzle/exec_fluent.py
:language: python
:lines: 23-
:caption: exec_fluent.py
1 change: 1 addition & 0 deletions doc/source/examples/ex_lsdyna_job.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/lsdyna_cylinder_plate/lsdyna_job.py
:language: python
:lines: 23-
:caption: lsdyna_job.py
3 changes: 2 additions & 1 deletion doc/source/examples/ex_mapdl_linked_analyses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAPDL linked analyses
=====================

This example shows how to submit an MAPDL linked analysis workflow (prestress-modal-harmonic)
as a multi-task job to REP. The script shows two possible ways to submit the individual tasks:
as a multi-task job to HPS. The script shows two possible ways to submit the individual tasks:

- All-at-once: All three tasks are defined and included in the job definition before pushing it
out to the server. When the job is created, it already has three tasks.
Expand Down Expand Up @@ -32,4 +32,5 @@ Here is the ``project_setup.py`` file for this project:.

.. literalinclude:: ../../../examples/mapdl_linked_analyses/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py
3 changes: 2 additions & 1 deletion doc/source/examples/ex_mapdl_tire_performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MAPDL tire performance
=======================

This example shows how to submit an MAPDL solver job to a REP server. The MAPDL model is the tire
This example shows how to submit an MAPDL solver job to HPS. The MAPDL model is the tire
performance simulation example included in the technology demonstration guide (td-57).
Solution convergence (GST) and contact status (CND) tracking files are periodically collected
while the job is running.
Expand All @@ -17,4 +17,5 @@ Here is the ``project_setup.py`` file for this project:

.. literalinclude:: ../../../examples/mapdl_tyre_performance/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py
3 changes: 2 additions & 1 deletion doc/source/examples/ex_motorbike_frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MAPDL motorbike frame: Project creation
=======================================

This example shows how to create from scratch a REP project consisting of an Ansys APDL beam model
This example shows how to create from scratch an HPS project consisting of an Ansys APDL beam model
of a tubular steel trellis motorbike frame. After creating the project's job definition, 10 design
points with randomly chosen parameter values are created and set to pending.

Expand Down Expand Up @@ -32,4 +32,5 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/mapdl_motorbike_frame/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py
1 change: 1 addition & 0 deletions doc/source/examples/ex_motorbike_frame_query.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Here is the ``project_setup.py`` file for this project:

.. literalinclude:: ../../../examples/mapdl_motorbike_frame/project_query.py
:language: python
:lines: 23-
:caption: project_query.py
3 changes: 2 additions & 1 deletion doc/source/examples/ex_python_two_bar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Two-bar truss
=============

This example shows how to create a REP project solving a two-bar truss problem with Python.
This example shows how to create an HPS project solving a two-bar truss problem with Python.

For the original problem description, see R.L. Fox, *Optimization Methods in Engineering Design*, Addison Wesley, 1971.
Also see `Optimization Methods for Engineering Design <https://apmonitor.com/me575/uploads/Main/optimization_book.pdf>`_.
Expand All @@ -17,4 +17,5 @@ Here is the ``project_setup.py`` script for this example:

.. literalinclude:: ../../../examples/python_two_bar_truss_problem/project_setup.py
:language: python
:lines: 23-
:caption: project_setup.py
20 changes: 10 additions & 10 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You start by connecting to an HPS deployment running on the localhost with the d
from ansys.hps.client import Client
from ansys.hps.client.jms import JmsApi, ProjectApi

client = Client(url="https://localhost:8443/rep", username="repuser", password="repuser")
client = Client(url="https://localhost:8443/hps", username="repuser", password="repuser")

# check which JMS version the server is running
jms_api = JmsApi(client)
Expand Down Expand Up @@ -60,8 +60,8 @@ example.
$ python path_to_download_folder\mapdl_motorbike_frame\project_setup.py

.. note::
By default, the script tries to connect to the REP server running on the localhost with the default
username and password. If your REP server is hosted at a different URL or you want to specify different
By default, the script tries to connect to the HPS server running on the localhost with the default
username and password. If your HPS server is hosted at a different URL or you want to specify different
credentials, adjust the script before running it.

Query parameters
Expand Down Expand Up @@ -264,14 +264,14 @@ Query for all jobs that have timed out and then delete them.
Query the number of evaluators
------------------------------

Query for the number of Windows and Linux evaluators connected to the REP server:
Query for the number of Windows and Linux evaluators connected to the HPS server:

.. code-block:: python

rms_api = RmsApi(client)
evaluators = rms_api.get_evaluators()

# print number of Windows and Linux evaluators connected to the REP server
# print number of Windows and Linux evaluators connected to the HPS server
print( len([e for e in evaluators if e.platform == "windows" ]) )
print( len([e for e in evaluators if e.platform == "linux" ]) )

Expand Down Expand Up @@ -299,7 +299,7 @@ Administrative users with the Keycloak "manage-users" role can create users as w
from ansys.hps.client import Client
from ansys.hps.client.auth import AuthApi, User

client = Client(url="https://localhost:8443/rep/", username="repadmin", password="repadmin")
client = Client(url="https://localhost:8443/hps/", username="repadmin", password="repadmin")
auth_api = AuthApi(client)

# modify the default password of the repadmin user
Expand All @@ -324,7 +324,7 @@ Administrative users with the Keycloak "manage-users" role can create users as w
Exception handling
------------------

All exceptions that the Ansys REP client explicitly raises inherit from the :exc:`ansys.hps.client.HPSError`
All exceptions that the Ansys HPS client explicitly raises inherit from the :exc:`ansys.hps.client.HPSError`
base class. Client errors are raised for 4xx HTTP status codes, while API errors are raised for 5xx HTTP
status codes (server-side errors).

Expand All @@ -335,12 +335,12 @@ For example, instantiating a client with invalid credentials returns a 401 clien
from ansys.hps.client import Client, HPSError

try:
client = Client(url="https://localhost:8443/rep/", username="repuser", password="wrong_psw")
client = Client(url="https://localhost:8443/hps/", username="repuser", password="wrong_psw")
except HPSError as e:
print(e)

#Output:
# 401 Client Error: invalid_grant for: POST https://localhost:8443/rep/auth/realms/rep/protocol/openid-connect/token
# 401 Client Error: invalid_grant for: POST https://localhost:8443/hps/auth/realms/rep/protocol/openid-connect/token
# Invalid user credentials

A *get* call on a non-existing resource returns a 404 client error:
Expand All @@ -356,4 +356,4 @@ A *get* call on a non-existing resource returns a 404 client error:
print(e)

#Output:
#404 Client Error: Not Found for: GET https://localhost:8443/rep//jms/api/v1/projects/non_existing_project
#404 Client Error: Not Found for: GET https://localhost:8443/hps//jms/api/v1/projects/non_existing_project
4 changes: 2 additions & 2 deletions examples/authorization_grant/authorization_grant.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

client_id = "rep-cli"
scope = "openid"
base_url = "https://localhost:8443/rep/auth/realms/rep"
base_url = "https://localhost:8443/hps/auth/realms/rep"
authorization_endpoint = f"{base_url}/protocol/openid-connect/auth"
token_endpoint = f"{base_url}/protocol/openid-connect/token"

Expand Down Expand Up @@ -136,7 +136,7 @@ async def on_get(self, req, resp):
if args.mode == "web":
redirect_uri = "http://localhost:9999/token-info"
else:
redirect_uri = "https://localhost:8443/rep/jms/api/v1"
redirect_uri = "https://localhost:8443/hps/jms/api/v1"

client = AsyncOAuth2Client(client_id, scope=scope, verify=False)
uri, state = client.create_authorization_url(authorization_endpoint, redirect_uri=redirect_uri)
Expand Down
2 changes: 1 addition & 1 deletion examples/cfx_static_mixer/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--name", type=str, default="cfx_static_mixer")
parser.add_argument("-j", "--num-jobs", type=int, default=1)
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/hps")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
Expand Down
2 changes: 1 addition & 1 deletion examples/fluent_2d_heat_exchanger/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def create_project(
parser = argparse.ArgumentParser()
parser.add_argument("-n", "--name", type=str, default="Fluent 2D Heat Exchanger")
parser.add_argument("-es", "--use-exec-script", default=False, type=bool)
parser.add_argument("-U", "--url", default="https://localhost:8443/rep")
parser.add_argument("-U", "--url", default="https://localhost:8443/hps")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
Expand Down
2 changes: 1 addition & 1 deletion examples/fluent_nozzle/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
parser.add_argument("-n", "--name", type=str, default="fluent_nozzle")
parser.add_argument("-j", "--num-jobs", type=int, default=1)
parser.add_argument("-es", "--use-exec-script", default=True, action="store_true")
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/hps")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
Expand Down
Loading
Loading