Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
17 changes: 16 additions & 1 deletion doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,26 @@ your own code.

Learn how to use the common exceptions.

.. grid-item-card:: Ansys versioning tool
:padding: 2 2 2 2
:link: versioning
:link-type: doc

Learn how to use the versioning tool.

.. grid-item-card:: Ansys report tool
:padding: 2 2 2 2
:link: report
:link-type: doc

Learn how to use the report tool.

.. toctree::
:hidden:
:maxdepth: 3

ansys_tools_path
ansys_downloader
ansys_exceptions
versioning
versioning
report
147 changes: 147 additions & 0 deletions doc/source/user_guide/report.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.. _ref_report:

User guide
============

This section explains how to use ``pyansys-tools-report`` and its features.

Using PyAnsys Tools Report
--------------------------

Once the ``pyansys-tools-report`` package is installed in your own personal environment (if not, please proceed
to :ref:`ref_getting_started`), you can start importing the package and using it.

In order to import the package, please run:

.. code:: python

import ansys.tools.report as pyansys_report

The ``pyansys-tools-report`` contains a main class called ``Report``. This class is basically an extension of the
``scooby.Report``, but customized for showing Ansys libraries and variables in a common format.

The possible arguments that the ``Report`` class accepts can be found in the `API reference <../api/index.html>`_. Please, have a look
at it to understand the arguments you may use. A simple example of Ansys variables and libraries is shown below.

.. code:: python

# After defining my_ansys_libs and my_ansys_vars with the needed format (see API Reference)
# we can start the instantiation of the report
#
# Instantiate a Report object
rep = report.Report(ansys_libs=my_ansys_libs, ansys_vars=my_ansys_vars)

# For printing the report
rep

The typical output of a ``Report`` would look as follows:

.. code-block:: text

>>> -------------------------------------------------------------------------------
>>> PyAnsys Software and Environment Report
>>> -------------------------------------------------------------------------------
>>> Date: Wed Nov 30 14:54:58 2022 Romance Standard Time
>>>
>>> OS : Windows
>>> CPU(s) : 16
>>> Machine : AMD64
>>> Architecture : 64bit
>>> Environment : Python
>>> GPU Vendor : Intel
>>> GPU Renderer : Intel(R) UHD Graphics
>>> GPU Version : 4.5.0 - Build 30.0.100.9955
>>>
>>> Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
>>>
>>> ansys-mapdl-core : X.Y.Z
>>> ansys-dpf-core : X.Y.Z
>>> ansys-dpf-post : X.Y.Z
>>> ansys-dpf-gate : X.Y.Z
>>> ansys-fluent-core : X.Y.Z
>>> pyaedt : X.Y.Z
>>> ansys-platform-instancemanagement : X.Y.Z
>>> ansys-grantami-bomanalytics : X.Y.Z
>>> ansys-openapi-common : X.Y.Z
>>> ansys-mapdl-reader : X.Y.Z
>>> ansys-fluent-visualization : X.Y.Z
>>> ansys-fluent-parametric : X.Y.Z
>>> ansys-sphinx-theme : X.Y.Z
>>> ansys-seascape : X.Y.Z
>>> pyansys-tools-report : X.Y.Z
>>> pyansys-tools-versioning : X.Y.Z
>>> matplotlib : X.Y.Z
>>> numpy : X.Y.Z
>>> pyvista : X.Y.Z
>>> appdirs : X.Y.Z
>>> tqdm : X.Y.Z
>>> pyiges : X.Y.Z
>>> scipy : X.Y.Z
>>> grpc : X.Y.Z
>>> google.protobuf : X.Y.Z
>>>
>>>
>>> -------------------------------------------------------------------------------
>>> Ansys Environment Report
>>> -------------------------------------------------------------------------------
>>>
>>>
>>> Ansys Installation
>>> ******************
>>> Version Location
>>> ------------------
>>> MyLib1 v1.2
>>> MyLib2 v1.3
>>>
>>>
>>> Ansys Environment Variables
>>> ***************************
>>> MYVAR_1 VAL_1
>>> MYVAR_2 VAL_2


By default, the ``Report`` class would look for a certain set of environment variables. The following
strings are searched for in the available environment variables. If any match is found, they are included
in the report:

* ``AWP_ROOT``
* ``ANS``
* ``MAPDL``
* ``FLUENT``
* ``AEDT``
* ``DPF``

Also, several Python packages are reported by default. The set of reported packages always includes
the following list:

* ``ansys-mapdl-core``
* ``ansys-dpf-core``
* ``ansys-dpf-post``
* ``ansys-dpf-gate``
* ``ansys-fluent-core``
* ``pyaedt``
* ``ansys-platform-instancemanagement``
* ``ansys-grantami-bomanalytics``
* ``ansys-openapi-common``
* ``ansys-mapdl-reader``
* ``ansys-fluent-visualization``
* ``ansys-fluent-parametric``
* ``ansys-sphinx-theme``
* ``ansys-seascape``
* ``pyansys-tools-report``
* ``pyansys-tools-versioning``
* ``matplotlib``
* ``numpy``
* ``pyvista``
* ``appdirs``
* ``tqdm``
* ``pyiges``
* ``scipy``
* ``grpc``
* ``google.protobuf``

If you want the ``Report`` class to look for some extra environment variables by default, please
`raise an issue <https://github.com/ansys/pyansys-tools-report/issues>`_.

Enjoy its use. If you have any doubts, please raise a question/issue in the
`PyAnsys Tools Report Issues <https://github.com/ansys/pyansys-tools-report/issues>`_ site.
3 changes: 2 additions & 1 deletion doc/styles/config/vocabularies/ANSYS/accept.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
(?i)Ansys
pytest
pytest
ANS
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [
dependencies = [
"platformdirs>=3.6.0",
"click>=8.1.3", # for CLI interface
"scooby>=0.5.12",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/common/path/applications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ApplicationPlugin:
"""Class for application plugins."""

def is_valid_executable_path(self, exe_loc: str) -> bool:
r"""Check if the executable path is valid for the application.
"""Check if the executable path is valid for the application.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/common/path/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _get_default_windows_base_path() -> Optional[str]: # pragma: no cover


def _is_float(input_string: str) -> bool:
r"""Return true when a string can be converted to a float.
"""Return true when a string can be converted to a float.

Parameters
----------
Expand Down
File renamed without changes.
Loading