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

Overall doc review #15

Merged
merged 18 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/api_reference.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _api_reference:

API Reference
API reference

Check warning on line 3 in doc/source/api_reference.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference.rst#L3

[Google.Headings] 'API reference' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'API reference' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference.rst", "range": {"start": {"line": 3, "column": 1}}}, "severity": "WARNING"}
=============

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/data_types.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Data Types
Data types
==========

.. automodule:: ansys.simai.core.data.types
Expand Down
5 changes: 3 additions & 2 deletions doc/source/api_reference/design_of_experiments.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.. _design_of_experiments:

Design of Experiments
Design of experiments
=====================

.. py:module:: ansys.simai.core.data.design_of_experiments

This collection contain methods allowing to export your Design of Experiments in different formats.
This module contains methods for exporting design of experiments
in different formats.

.. autoclass:: DesignOfExperimentsCollection()
:members:
10 changes: 6 additions & 4 deletions doc/source/api_reference/geometries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ Geometries

.. py:module:: ansys.simai.core.data.geometries

Geometries are the core of *SimAI Deep Learning powered predictions*.
A geometry is a 3D model and associated metadata managed by the SimAI platform.
Geometries are the core of *SimAI deep learning-powered predictions*.
A geometry is a 3D model and the associated metadata managed by the SimAI platform.

.. _geometry_format:

File format
-----------

The input format for your workspace is described by the model manifest.
You can access that information for a specific workspace through :attr:`workspace.model.geometry<ansys.simai.core.data.workspaces.ModelManifest.geometry>`
You use the :attr:`workspace.model.geometry<ansys.simai.core.data.workspaces.ModelManifest.geometry>`
attribute to access the information for a specific workspace.

If you have a problem converting to the expected format, please contact us for more information at support-simai@ansys.com
If you have a problem converting to the expected format, contact the SimAI team
at `support-simai@ansys.com <mailto:support-simai@ansys.com>`_.

Directory
---------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/api_reference/optimizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Model
:members:
:inherited-members:

TrialRun
========
Trial runs
==========
PipKat marked this conversation as resolved.
Show resolved Hide resolved
PipKat marked this conversation as resolved.
Show resolved Hide resolved

Trial runs are a single step of the optimization process
Trial runs are a single step of the optimization process.

Directory
---------
Expand Down
15 changes: 9 additions & 6 deletions doc/source/api_reference/post_processings.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _post_processings:

Post-Processings
================
Postprocessings

Check warning on line 3 in doc/source/api_reference/post_processings.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/post_processings.rst#L3

[Google.Headings] 'Postprocessings' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Postprocessings' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/post_processings.rst", "range": {"start": {"line": 3, "column": 1}}}, "severity": "WARNING"}
===============
tmpbeing marked this conversation as resolved.
Show resolved Hide resolved

.. py:module:: ansys.simai.core.data.post_processings

Expand All @@ -20,19 +20,22 @@

.. _pp_methods:

Nested Prediction Namespace
Nested prediction namespace
---------------------------

.. autoclass:: PredictionPostProcessings()
:members:

.. _available_pp:

Available post-processings
Available postprocessings
PipKat marked this conversation as resolved.
Show resolved Hide resolved
--------------------------

.. note:: Depending on the capabilities of your model, some of these may not be available in your workspace.
You can check which ones are available through the :meth:`~ansys.simai.core.data.post_processings.PostProcessingDirectory.info` method
.. note::
Depending on the capabilities of your model, some of these objects may not
be available in your workspace. You can use the
:meth:`~ansys.simai.core.data.post_processings.PostProcessingDirectory.info` method
to see which ones are available.

.. autoclass:: GlobalCoefficients()
:members:
Expand Down
19 changes: 8 additions & 11 deletions doc/source/api_reference/predictions.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
.. _predictions:

Predictions
===========

.. py:module:: ansys.simai.core.data.predictions

The Prediction module is in charge of running the *SimAI-powered
predictions* on the :py:class:`Geometries<ansys.simai.core.data.geometries.Geometry>` you have uploaded.
The ``Prediction`` module is in charge of running the *SimAI-powered
predictions* on the :py:class:`geometries<ansys.simai.core.data.geometries.Geometry>`
that you have uploaded.

It represents a numerical prediction with geometry and boundary conditions.
The arguments to :py:func:`predictions.run()<PredictionDirectory.run>` depend on your model.
A prediction represents a numerical prediction with geometry and boundary conditions.
The arguments to the :py:meth:`predictions.run()<PredictionDirectory.run>` method
depend on your model.

.. code-block:: python

# Run a prediction on a given geometry with the specified velocity.
velocity = 10.0
prediction = geometry.run_prediction(Vx=velocity)

.. warning::
In order to better describe different physical constraints,
the SimAI SDK has been updated to describe boundary conditions with a dict,
replacing the previous tuple of 3 numbers.
Please make sure to update your existing scripts, for instance from ``(3.4, 0, 0)`` to ``dict(Vx=3.4)``;
there is no need to put ``Vy=0`` and ``Vz=0`` anymore if your project has not been trained on those velocities.
In method calls, boundary conditions can be passed directly as arguments: ``run_prediction(Vx=3.4)``.

Directory
---------
Expand Down
59 changes: 31 additions & 28 deletions doc/source/api_reference/selections.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
.. _selections:

Selections
===========
==========

Selections Basics
-----------------
Selection basics
----------------
.. py:module:: ansys.simai.core.data.selections

The Selection class allows you to run a large number of operations in parallel,
by manipulating whole collections of SimAI models
The :class:`Selection<ansys.simai.core.data.selections.Selection>` class allows you
to run a large number of operations in parallel by manipulating whole collections of SimAI models
(:class:`Geometries <ansys.simai.core.data.geometries.Geometry>`,
:class:`Predictions <ansys.simai.core.data.predictions.Prediction>`,
:py:class:`Post-Processings <ansys.simai.core.data.post_processings.PostProcessing>`).
:class:`Predictions <ansys.simai.core.data.predictions.Prediction>`, and
:py:class:`Post-Processings <ansys.simai.core.data.post_processings.PostProcessing>` instances).

A Selection is created by combining a list of
:class:`Geometries <ansys.simai.core.data.geometries.Geometry>` with a list of
:class:`~ansys.simai.core.data.types.BoundaryConditions`.
You create a selection by combining a list of :class:`Geometry <ansys.simai.core.data.geometries.Geometry>`
instances with a list of :class:`~ansys.simai.core.data.types.BoundaryConditions` instances:

.. code-block:: python

Expand All @@ -26,12 +25,13 @@
selection = Selection(geometries, boundary_conditions)


The resulting selection contains all possible combinations between
the geometries and boundary conditions. Each of those combinations is a
:class:`~ansys.simai.core.data.selections.Point`, which can be viewed as a potential
:class:`~ansys.simai.core.data.predictions.Prediction`.
The resulting selection contains all possible combinations between the geometries and
boundary conditions. Each of those combinations is a :class:`~ansys.simai.core.data.selections.Point`
instance, which can be viewed as a potential :class:`~ansys.simai.core.data.predictions.Prediction`
instance.

At first all predictions may not all exist, they can be run with the :func:`~Selection.run_predictions` method:
At first, all predictions may not exist. However, you can use the :meth:`~Selection.run_predictions`
method to run them:

.. code-block:: python

Expand All @@ -41,10 +41,11 @@
all_predictions = selection.predictions


Selections API Reference
Selection API reference

Check warning on line 44 in doc/source/api_reference/selections.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/selections.rst#L44

[Google.Headings] 'Selection API reference' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Selection API reference' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/selections.rst", "range": {"start": {"line": 44, "column": 1}}}, "severity": "WARNING"}
------------------------

In essence a :class:`~ansys.simai.core.data.selections.Selection` is a collection of :class:`points <ansys.simai.core.data.selections.Point>`.
In essence, a :class:`~ansys.simai.core.data.selections.Selection` instance is a
collection of :class:`points <ansys.simai.core.data.selections.Point>` instances.

.. autoclass:: Point()
:members:
Expand All @@ -56,12 +57,13 @@
:inherited-members:


Post-processing Basics
Postprocessing basics
----------------------

The :attr:`~Selection.post` namespace allows you to run and access all post-processings for existing predictions.
Please see :py:class:`~ansys.simai.core.data.selection_post_processings.SelectionPostProcessingsMethods`
for available post-processings.
The :attr:`~Selection.post` namespace allows you to run and access all postprocessings
for existing predictions. For available postprocessings, see the
:py:class:`~ansys.simai.core.data.selection_post_processings.SelectionPostProcessingsMethods`
class.

.. code-block:: python

Expand All @@ -70,19 +72,20 @@
coeffs.data # is a list of results of each post-processings.


Results for exportable post-processings
You can use the :meth:`~ansys.simai.core.data.lists.ExportablePPList.export()`
method to export results in batch for exportable postprocessings
(:py:class:`~ansys.simai.core.data.post_processings.GlobalCoefficients`
and :py:class:`~ansys.simai.core.data.post_processings.SurfaceEvol`)
can be exported in batch with the :func:`~ansys.simai.core.data.lists.ExportablePPList.export()` method:
and :py:class:`~ansys.simai.core.data.post_processings.SurfaceEvol` instances):

.. code-block:: python

selection.post.surface_evol(axis="x", delta=13.5).export("xlsx").download(
"/path/to/file.xlsx"
)

Please note that the ``csv`` export generates a zip archive containing multiple csv files.
They can be read directly with python by using zipfile:
Note that a CSV export generates a ZIP file containing multiple CSV files.
You can read them directly using Python's `zipfile<https://docs.python.org/3/library/zipfile.html>`
module:

.. code-block:: python

Expand All @@ -101,15 +104,15 @@
df_geom = pd.read_csv(archive.open("Geometries.csv"))


Binary post-processings results can be downloaded by looping on the list, for instance:
You can download binary postprocessings results by looping on the list:

.. code-block:: python

for vtu in selection.post.volume_vtu():
vtu.data.download(f"/path/to/vtu_{vtu.id}")


Post-processing API Reference
Postprocessing API reference

Check warning on line 115 in doc/source/api_reference/selections.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/selections.rst#L115

[Google.Headings] 'Postprocessing API reference' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Postprocessing API reference' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/selections.rst", "range": {"start": {"line": 115, "column": 1}}}, "severity": "WARNING"}
-----------------------------

.. py:module:: ansys.simai.core.data.selection_post_processings
Expand Down
9 changes: 5 additions & 4 deletions doc/source/api_reference/training_data.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
.. _training_data:

Training Data
=============
TrainingData

Check warning on line 3 in doc/source/api_reference/training_data.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/training_data.rst#L3

[Google.Headings] 'TrainingData' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'TrainingData' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/training_data.rst", "range": {"start": {"line": 3, "column": 1}}}, "severity": "WARNING"}
============

.. py:module:: ansys.simai.core.data.training_data

A TrainingData is a collection of :class:`parts<ansys.simai.core.data.training_data_parts.TrainingDataPart>` representing
a prediction that can then be used as input for the training of models.
A :class:`TrainingData<ansys.simai.core.data.training_data.TrainingData>` instance is a
collection of :class:`TrainingDataPart<ansys.simai.core.data.training_data_parts.TrainingDataPart>`
instances representing a prediction that can be used as input for the training of models.

Directory
---------
Expand Down
8 changes: 5 additions & 3 deletions doc/source/api_reference/training_data_parts.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.. _training_data_parts:

Training Data Part
==================
TrainingDataParts

Check warning on line 3 in doc/source/api_reference/training_data_parts.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/training_data_parts.rst#L3

[Google.Headings] 'TrainingDataParts' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'TrainingDataParts' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/training_data_parts.rst", "range": {"start": {"line": 3, "column": 1}}}, "severity": "WARNING"}
=================

.. py:module:: ansys.simai.core.data.training_data_parts

A TrainingDataPart is a singular file, part of a :class:`~ansys.simai.core.data.training_data.TrainingData`.
A :class:`TrainingDataPart<ansys.simai.core.data.training_data_parts.TrainingDataPart>` instance
is a singular file that is part of a :class:`~ansys.simai.core.data.training_data.TrainingData`
instance.

Directory
---------
Expand Down
6 changes: 3 additions & 3 deletions doc/source/api_reference/workspaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

.. py:module:: ansys.simai.core.data.workspaces

Workspaces are a set of specific geometries, predictions and post-processings.
Workspaces are a set of specific geometries, predictions, and postprocessings.
Each workspace uses a specific kernel.

To set which workspace the client is configured for, please refer to
:meth:`SimAIClient.set_current_workspace() method<ansys.simai.core.client.SimAIClient.set_current_workspace>`
You use the :meth:`SimAIClient.set_current_workspace()<ansys.simai.core.client.SimAIClient.set_current_workspace>`
method to set the workspace that the client is configured for.

Directory
---------
Expand All @@ -24,7 +24,7 @@
:members:
:inherited-members:

ModelManifest

Check warning on line 27 in doc/source/api_reference/workspaces.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] doc/source/api_reference/workspaces.rst#L27

[Google.Headings] 'ModelManifest' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'ModelManifest' should use sentence-style capitalization.", "location": {"path": "doc/source/api_reference/workspaces.rst", "range": {"start": {"line": 27, "column": 1}}}, "severity": "WARNING"}
-------------

.. autoclass:: ModelManifest()
Expand Down