Skip to content

Commit

Permalink
Doc: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Apr 5, 2024
1 parent 2051bf2 commit 524adc6
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -W -T
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../build
Expand Down
File renamed without changes.
9 changes: 3 additions & 6 deletions doc/application/index.rst → doc/application/application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ Otfmi bridges the physics of the model (in `FMI <https://fmi-standard.org/>`__ f
In the following applications, advanced computer experiments are performed on the FMUs.

.. note::
| Here we demonstrate the potential of using OpenTURNS on FMUs.
| For easier examples, see the section :doc:`Examples<../example/index>`.
Here we demonstrate the potential of using OpenTURNS on FMUs.
For easier examples, see the section :doc:`Examples<../example/index>`.

.. toctree::
:maxdepth: 1
:glob:

../auto_application/plot_cantilever_beam
../auto_application/plot_metamodel
../demo_persalys/use_persalys
../auto_application/index.rst
4 changes: 2 additions & 2 deletions doc/demo_persalys/use_persalys.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Analyse the sensitivities with Persalys
=======================================
Sensitivity analysis with Persalys
==================================

.. image:: ../_static/logo_persalys.png
:align: left
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 4 additions & 12 deletions doc/example/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ This mechanical model represents the deviation of a cantilever beam submitted to
.. toctree::
:maxdepth: 1

../auto_example/static/plot_basics
../auto_example/static/plot_init
../auto_example/static/plot_set
../auto_example/static/index.rst

Explore dynamic FMUs
--------------------
Expand All @@ -42,9 +40,7 @@ All dynamic examples rely on *epid.fmu*. This epidemiologic model represents the
.. toctree::
:maxdepth: 1

../auto_example/dynamic/plot_dyn_basics
../auto_example/dynamic/plot_dyn_init
../auto_example/dynamic/plot_dyn_set
../auto_example/dynamic/index.rst

Common low-level functions
--------------------------
Expand All @@ -58,10 +54,7 @@ Common low-level functions
.. toctree::
:maxdepth: 1

../auto_example/low_level/plot_load_fmu
../auto_example/low_level/plot_explore
../auto_example/low_level/plot_simulate
../auto_example/low_level/plot_initialize
../auto_example/low_level/index.rst

From OpenTURNS to FMI
---------------------
Expand All @@ -76,5 +69,4 @@ the metamodel *instead of the FMU* in the simulation tool.
.. toctree::
:maxdepth: 1

../auto_example/ot_to_fmu/plot_fmu_exporter
../auto_example/ot_to_fmu/plot_model_exporter
../auto_example/ot_to_fmu/index.rst
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/example/low_level/plot_initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
# ----------------------------

# %%
# | Initialization scripts can gather a large number of initial values.
# | The use of initialization scripts (*.mos* files) is common in Dymola :
# Initialization scripts can gather a large number of initial values.
# The use of initialization scripts (*.mos* files) is common in Dymola:
# - to save the value of all the variables of a model after simulation,
# - to restart simulation from a given point.

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/example/ot_to_fmu/plot_model_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# Currently, the inclusion of a metamodel in
# `OpenModelica GUI <https://openmodelica.org/?id=78:omconnectioneditoromedit&catid=10:main-category>`_
# has been performed once (see
# has been performed once (see
# `this paper <https://www.researchgate.net/publication/354810878_Analysis_and_reduction_of_models_using_Persalys>`_).
#
# ------------
Expand Down
File renamed without changes.
12 changes: 3 additions & 9 deletions doc/example/static/plot_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,37 @@
"""

# %%
# ``otfmi.FMUFunction`` enables to use OpenTURNS' high
# :class:`~otfmi.FMUFunction` enables to use OpenTURNS' high
# level algorithms by wrapping the FMU into an :py:class:`openturns.Function` object.

# %%
# ------------

# %%
# | First, retrieve the path to the FMU *deviation.fmu*.
# Recall the deviation model is static, i.e. its output does not evolve over
# time.
# First, retrieve the path to the FMU *deviation.fmu*.
# Recall the deviation model is static, i.e. its output does not evolve over time.
import openturns as ot
import otfmi.example.utility

path_fmu = otfmi.example.utility.get_path_fmu("deviation")

# %%
# Wrap the FMU into an OpenTURNS function:

function = otfmi.FMUFunction(
path_fmu, inputs_fmu=["E", "F", "L", "I"], outputs_fmu=["y"]
)
print(type(function))

# %%
# Simulate the FMU on a point:

inputPoint = ot.Point([3.0e7, 30000, 200, 400])
outputPoint = function(inputPoint)
print("y = {}".format(outputPoint))

# %%
# Simulate the FMU on a sample:

inputSample = ot.Sample(
[[3.0e7, 30000, 200, 400], [3.0e7, 30000, 250, 400], [3.0e7, 30000, 300, 400]]
)
inputSample.setDescription(["E", "F", "L", "I"])

outputSample = function(inputSample)
print(outputSample)
8 changes: 8 additions & 0 deletions doc/fmus/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Sample FMU files
================

.. toctree::
:maxdepth: 1

deviation
epid
12 changes: 11 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ The core features of `Otfmi <https://github.com/openturns/otfmi>`__ are:
:maxdepth: 1
:glob:

application/index
application/application

.. toctree::
:maxdepth: 1

fmus/index

.. toctree::
:maxdepth: 1

demo_persalys/use_persalys.rst

--------------

Expand Down

0 comments on commit 524adc6

Please sign in to comment.