-
Notifications
You must be signed in to change notification settings - Fork 0
Readme: update basic usage and add more Doc for examples #200
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2b9cbb5
Update README
saimanikant d6c1e33
Update examples
saimanikant 3cf4515
fix code style issues
saimanikant 2e989f7
Merge branch 'main' into maint/readme
saimanikant 8e9175a
Apply suggestions from code review
saimanikant d300868
Merge branch 'main' into maint/readme
saimanikant d545f37
Address comments
saimanikant 206beda
fix pre-commit issues
saimanikant bbd365b
Update examples/basic/async_data_transfer_client.py
saimanikant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,6 @@ Installation | |
^^^^^^^^^^^^ | ||
|
||
You can use `pip <https://pypi.org/project/pip/>`_ to install PyHPS Data Transfer. | ||
Note: This will be available only after released. For now, please install from git | ||
|
||
.. code:: bash | ||
|
||
|
@@ -61,14 +60,40 @@ For more information, see `Getting Started`_. | |
Basic usage | ||
^^^^^^^^^^^ | ||
|
||
This code shows how to import PyHPS Data Transfer and use some basic capabilities: | ||
The following sections show how to import PyHPS Data Transfer and use some basic capabilities. | ||
|
||
Request access token | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The client library requires an access token to connect to the HPS Data Transfer service. | ||
|
||
.. code:: python | ||
|
||
from ansys.hps.data_transfer.client.authenticate import authenticate | ||
|
||
auth_url = "https://localhost:8443/hps/auth/realms/rep" | ||
|
||
token = authenticate(username="repadmin", password="repadmin", verify=False, url=auth_url) | ||
token = token.get("access_token", None) | ||
|
||
Connect to data transfer service client | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
After obtaining the access token, you can connect to the data transfer service client: | ||
|
||
.. code:: python | ||
|
||
from ansys.hps.data_transfer.client import Client # Import the Client class | ||
dt_url = f"https://localhost:8443/hps/dt/api/v1" | ||
client = Client() # Create a client object | ||
client.binary_config.update(verbosity=3, debug=True, insecure=True, token=token, data_transfer_url=dt_url, log=True) | ||
client.start() | ||
|
||
api = DataTransferApi(client) | ||
api.status(wait=True) | ||
|
||
|
||
For comprehensive usage information, see `Examples`_ in the `PyHPS Data Transfer documentation`_. | ||
For comprehensive usage information, see `Examples`_. | ||
|
||
Documentation and issues | ||
^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
@@ -87,6 +112,6 @@ To reach the project support team, email `[email protected] <mailto:pyansys | |
|
||
|
||
.. LINKS AND REFERENCES | ||
.. _Getting Started: https://hps.docs.pyansys.com/version/stable/getting_started/index.html | ||
.. _Examples: https://hps.docs.pyansys.com/version/stable/examples.html | ||
.. _PyHPS Data Transfer documentation: https://hps.docs.pyansys.com/version/stable/index.html | ||
.. _Getting Started: https://data-transfer.hps.docs.pyansys.com/version/stable/getting_started/index.html | ||
.. _Examples: https://data-transfer.hps.docs.pyansys.com/version/stable/examples/index.html | ||
.. _PyHPS Data Transfer documentation: https://data-transfer.hps.docs.pyansys.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.