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

Update docs considering changes on Rocky 24R2 #63

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributing
igortg marked this conversation as resolved.
Show resolved Hide resolved

For contributing to this project, please refer to the [PyAnsys Developer's Guide].
For contributing to this project, please refer to the [PyRocky Developer's Guide].
igortg marked this conversation as resolved.
Show resolved Hide resolved

[PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/how-to/contributing.html
[PyRocky Developer's Guide]: https://rocky.docs.pyansys.com/version/dev/contributing.html
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ PyRocky

|pyansys| |MIT| |python| |pypi| |codecov| |MIT| |black| |pre-commit|

PyRocky is a Python client library for remotely controlling
`Ansys Rocky <https://www.ansys.com/products/fluids/ansys-rocky>`_,
which is the most powerful software in the market for performing
DEM (discrete element method) simulations.
PyRocky is a Python client library to create, run and post-processing
igortg marked this conversation as resolved.
Show resolved Hide resolved
particle dynamics simulations using `Ansys Rocky <https://www.ansys.com/products/fluids/ansys-rocky>`_,
the most powerful DEM (discrete element method) software in the market.

Documentation and issues
------------------------
Expand All @@ -19,7 +18,7 @@ The documentation has five sections:
- `Getting started <https://rocky.docs.pyansys.com/version/stable/getting_started/index.html>`_: Learn
how to install PyRocky in user mode and then launch it.
- `User guide <https://rocky.docs.pyansys.com/version/stable/user_guide/index.html>`_: Understand how to
use the Rocky PrePost API with PyRocky.
use the Rocky PrePost Scripting with PyRocky.
igortg marked this conversation as resolved.
Show resolved Hide resolved
- `API reference <https://rocky.docs.pyansys.com/version/stable/api/index.html>`_: Understand PyRocky API
endpoints, their capabilities, and how to interact with them programmatically.
igortg marked this conversation as resolved.
Show resolved Hide resolved
- `Examples <https://rocky.docs.pyansys.com/version/stable/examples/index.html>`_: Explore end-to-end
Expand Down
9 changes: 2 additions & 7 deletions doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
Getting started
===============

PyRocky is a Python client library for remotely controlling
`Ansys Rocky <https://www.ansys.com/products/fluids/ansys-rocky>`_,
which is the most powerful software in the market for performing
DEM (discrete element method) simulations.

Install PyRocky
---------------

Expand Down Expand Up @@ -51,9 +46,9 @@ Connect to an existing session

Assume that a Rocky session is started with the ``--pyrocky`` option:

.. code:: bat
.. code::
C:\Program Files\Ansys Inc\v241\Rocky> bin\Rocky.exe --pyrocky
C:\Program Files\Ansys Inc\v242\Rocky\bin\Rocky.exe --pyrocky
When the Rocky session is started in this way, you can connect to it with PyRocky:

Expand Down
14 changes: 6 additions & 8 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
PyRocky
#######

PyRocky is a Python client library to create, run and post-processing
igortg marked this conversation as resolved.
Show resolved Hide resolved
particle dynamics simulations using `Ansys Rocky <https://www.ansys.com/products/fluids/ansys-rocky>`_,
the most powerful DEM (discrete element method) software in the market.


.. grid:: 2
:gutter: 2 3 3 4

Expand All @@ -10,7 +16,6 @@ PyRocky

Learn how to install PyRocky in user mode and then launch it.


.. grid-item-card:: User guide :material-regular:`book`
:padding: 2 2 2 2
:link: user_guide/index
Expand All @@ -36,13 +41,6 @@ PyRocky

Explore end-to-end examples that show how to use PyRocky.

.. grid-item-card:: Contribute :fa:`people-group`
:padding: 2 2 2 2
:link: contributing
:link-type: doc

Learn how to contribute to the PyRocky codebase or documentation.

.. toctree::
:hidden:
:maxdepth: 3
Expand Down
28 changes: 19 additions & 9 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,39 @@
User guide
==========

Use the Rocky PrePost Scripting
-------------------------------
igortg marked this conversation as resolved.
Show resolved Hide resolved

Use the Rocky PrePost API
-------------------------

Most of the Rocky PrePost API is available through the ``api`` object. For example,
the following code creates a project and saves it to disk:
In its current shape, PyRocky is a thin layer that enables remote calls to Rocky using the
igortg marked this conversation as resolved.
Show resolved Hide resolved
PrePost Scripting API. This API is available through the ``RockyClient.api`` object. For
example, the following code creates a project and saves it to disk:

.. vale off
.. code:: python
rocky = pyrocky.launch_rocky()
api = rocky.api
project = api.CreateProject()
study = project.GetStudy()
study.SetName("My Study")
api.SaveProject("my-project.rocky"))
.. vale on
To view comprehensive PrePost Scripting documentation, in the Rocky app, select
**Help > Manuals > PrePost Scripting**.

Most methods of the PrePost Scripting, when called through PyRocky, works in the exact same way
igortg marked this conversation as resolved.
Show resolved Hide resolved
they work in the Rocky built-in Python Shell. However, there are differences worth noting:
igortg marked this conversation as resolved.
Show resolved Hide resolved

To view comprehensive PrePost API documentation, in the Rocky app, select
**Help > Manuals > API PrePost**.
- ``KAStudy.GetTimeSet``: on PyRocky this method returns a ``numpy.array`` of simulation time
igortg marked this conversation as resolved.
Show resolved Hide resolved
igortg marked this conversation as resolved.
Show resolved Hide resolved
steps in seconds (instead of a ``TimeSet`` object).
- ``KAElementItem.GetCurve``: this method is not supported by PyRocky. Use ``GetNumpyCurve`` to
igortg marked this conversation as resolved.
Show resolved Hide resolved
get resulting curves from study entities.


Known issues
************
- When opened with the Rocky UI visible (non-headless mode), PyRocky cannot deal with confirmation
or error dialogs. For example, a call to the ``CloseProject()`` method asks for confirmation,
causing PyRocky to freeze until **OK** or **Cancel** is clicked in the Rocky UI.
- Some API methods may not work.
5 changes: 4 additions & 1 deletion src/ansys/rocky/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module with the client operations of Rocky."""
"""
Module that defines the RockyClient class, which act as a proxy for a Rocky application
igortg marked this conversation as resolved.
Show resolved Hide resolved
session.
"""
from collections.abc import Callable, Generator
import pickle
from typing import Any, Final
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/rocky/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""Module for launching operations of the Rocky backend."""
"""Module that exposes functions to launch Rocky application."""
igortg marked this conversation as resolved.
Show resolved Hide resolved
import contextlib
import os
from pathlib import Path
Expand Down
Loading