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

Reformat README to avoid redundancy #30

Merged
merged 3 commits into from
Feb 15, 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
131 changes: 48 additions & 83 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,89 +3,54 @@ PyRocky

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

PyRocky is a Python client for Ansys Rocky.

Usage
-----

Installation
^^^^^^^^^^^^

To install PyRocky, run this command:

.. code:: bash

python -m pip install ansys-rocky-core

Getting started
^^^^^^^^^^^^^^^

The best way to experiment with PyRocky is by using `Jupyter Notebook <https://jupyter.org/>`_
or `Visual Studio Code <https://code.visualstudio.com>`_. The following code launches a
headless Rocky session and returns a ``RockyClient`` instance from which you can programmatically
interact with the software:

.. code:: python

import ansys.rocky.rocky as pyrocky

rocky = pyrocky.launch_rocky()

You use the ``close()`` method to close the Rocky session:

.. code:: python

rocky.close()

If you want to launch the Rocky UI, set ``headless=False``:

.. code:: python

rocky = pyrocky.launch_rocky(headless=False)

Connecting to an existing session
*********************************

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

.. code:: bat

C:\Program Files\Ansys Inc\v241\Rocky> bin\Rocky.exe --pyrocky

When the session is started in this way, you can connect to it with PyRocky:

.. code:: python

import ansys.rocky.rocky as pyrocky

rocky = pyrocky.connect_to_rocky()

Using 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:

.. code:: python

api = rocky.api
project = api.CreateProject()
study = project.GetStudy()
study.SetName("My Study")

api.SaveProject("my-project.rocky"))

To view comprehensive PrePost API documentation, in the Rocky app, select
**Help > Manuals > API PrePost**.

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.
- PyRocky does not cover the entire Rocky API PrePost functionality. For example, methods still not
supported include ``GetTimeSet`` and ``GetGridFunction``.
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.

Documentation and issues
------------------------

Documentation for the latest stable release of PyRocky is hosted at
`PyRocky documentation <https://rocky.docs.pyansys.com/version/dev/index.html>`_.

The documentation has five sections:

- `Getting started <https://rocky.docs.pyansys.com/version/dev/getting_started/index.html>`_: Learn
how to install PyRocky in user mode and then launch it.
- `User guide <https://rocky.docs.pyansys.com/version/dev/user_guide/index.html>`_: Understand how to
use the Rocky PrePost API with PyRocky.
- `API reference <https://rocky.docs.pyansys.com/version/dev/api/index.html>`_: Understand PyRocky API
endpoints, their capabilities, and how to interact with them programmatically.
- `Examples <https://rocky.docs.pyansys.com/version/dev/examples/index.html>`_: Explore end-to-end
examples that show how to use PyRocky.
- `Contribute <https://rocky.docs.pyansys.com/version/dev/contributing.html>`_: Learn how to contribute
to the PyRocky codebase or documentation.

In the upper right corner of the documentation's title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.

On the `PyRocky Issues <https://github.com/ansys/pyrocky/issues>`_ page, you can
create issues to report bugs and request new features. On the
`Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.

To reach the PyAnsys project support team, email `PyAnsys Core team <[email protected]>`_.

License
-------

PyRocky is licensed under the `MIT License <https://github.com/ansys-internal/pyrocky/blob/main/LICENSE>`_.

PyRocky makes no commercial claim over Ansys whatsoever. This library extends the
functionality of Ansys Rocky by adding a Python interface without changing the
core behavior or license of the original software. The use of PyRocky requires a
legally licensed local copy of Ansys Rocky.

To get a copy of Ansys Rocky, see the `Ansys Rocky <https://www.ansys.com/products/fluids/ansys-rocky>`_
page on the Ansys website.


.. BADGES
Expand Down
16 changes: 11 additions & 5 deletions doc/source/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
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.

Installation
------------
Install PyRocky
---------------

PyRocky is currently a private GitHub library in the Ansys Internal account. To
install PyRocky in user mode, run this command:

To install PyRocky, run this command:

.. code:: bash

Expand Down Expand Up @@ -41,8 +47,8 @@ If you want to launch the Rocky UI, set ``headless=False``:

rocky = pyrocky.launch_rocky(headless=False)

Connecting to an existing session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connect to an existing session
------------------------------

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

Expand Down
29 changes: 24 additions & 5 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ PyRocky
:gutter: 2 3 3 4

.. grid-item-card:: Getting started
:text-align: center
:text-align: left

:material-regular:`start;48px`

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

+++
.. button-link:: getting_started/index.html
Expand All @@ -20,7 +20,7 @@ PyRocky
Getting started

.. grid-item-card:: User guide
:text-align: center
:text-align: left

:material-regular:`book;48px`

Expand All @@ -39,7 +39,7 @@ PyRocky
:gutter: 2 3 3 4

.. grid-item-card:: API reference
:text-align: center
:text-align: left

:material-regular:`terminal;48px`

Expand All @@ -55,7 +55,7 @@ PyRocky
API reference

.. grid-item-card:: Examples
:text-align: center
:text-align: left

:material-regular:`code;48px`

Expand All @@ -70,6 +70,25 @@ PyRocky

Examples

.. grid-item-card:: Contribute
:text-align: left

:material-regular:`code;48px`

Learn how to contribute to the PyRocky codebase or documentation.

+++
.. button-link:: contributing.html
:color: secondary
:expand:
:outline:
:click-parent:

Contribute

.. toctree::
:hidden:
:maxdepth: 3
.. toctree::
:hidden:
:maxdepth: 3
Expand Down
6 changes: 3 additions & 3 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ User guide
==========


Using the Rocky PrePost API
---------------------------
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:
Expand All @@ -25,7 +25,7 @@ To view comprehensive PrePost API documentation, in the Rocky app, select


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.
Expand Down
Loading