Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
teubert committed Oct 18, 2023
1 parent 59e9db0 commit 65dda10
Show file tree
Hide file tree
Showing 28 changed files with 305 additions and 322 deletions.
28 changes: 0 additions & 28 deletions sphinx-config/api_ref/prog_algs/UncertainData.rst

This file was deleted.

13 changes: 0 additions & 13 deletions sphinx-config/api_ref/prog_models.rst

This file was deleted.

15 changes: 0 additions & 15 deletions sphinx-config/api_ref/prog_models/DataSets.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prog_algs API Reference
ProgPy API Reference
==================================

.. raw:: html
Expand All @@ -8,6 +8,8 @@ prog_algs API Reference
.. toctree::
:glob:

prog_algs/*
progpy/*

.. image:: ../images/prog_algs_UML.png

.. image:: ../images/prog_models_UML.png
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CompositeModel
================

.. autoclass:: prog_models.CompositeModel
.. autoclass:: progpy.CompositeModel
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The :py:class:`DataModel` class is the base class for all data-based models. It
Examples:

* :download:`examples.lstm_model <../../../../prog_models/examples/lstm_model.py>`
* :download:`examples.full_lstm_model <../../../../prog_models/examples/full_lstm_model.py>`
* :download:`examples.custom_model <../../../../prog_models/examples/custom_model.py>`
* :download:`examples.lstm_model <../../../../progpy/examples/lstm_model.py>`
* :download:`examples.full_lstm_model <../../../../progpy/examples/full_lstm_model.py>`
* :download:`examples.custom_model <../../../../progpy/examples/custom_model.py>`

Training DataModels
-----------------------
Expand All @@ -24,7 +24,7 @@ This is the most common way to construct a :py:class:`DataModel` object, using t

.. code-block:: python
>>> from prog_models.models import LSTMStateTransitionModel
>>> from progpy.models import LSTMStateTransitionModel
>>> input_data = [run1.inputs, run2.inputs, run3.inputs]
>>> output_data = [run1.outputs, run2.outputs, run3.outputs]
>>> m = LSTMStateTransitionModel.from_data(input_data, output_data)
Expand All @@ -37,8 +37,8 @@ Surrogate models are constructed using the :py:func:`DataModel.from_model` Class

.. code-block:: python
>>> from prog_models.models import ThrownObject
>>> from prog_models.models import LSTMStateTransitionModel
>>> from progpy.models import ThrownObject
>>> from progpy.models import LSTMStateTransitionModel
>>> m = ThrownObject()
>>> def future_loading(t, x=None):
>>> return m.InputContainer({}) # No input for thrown object
Expand All @@ -56,30 +56,30 @@ Using Constructor
**********************
This method is the least frequently used, and it is very specific to the :py:class:`DataModel` class being constructed. For example: :py:class:`DMDModel` classes are constructed using the DMD Matrix, and :py:class:`LSTMStateTransitionModel` classes are constructed using a trained Keras Model.

See example :download:`examples.custom_model <../../../../prog_models/examples/custom_model.py>`
See example :download:`examples.custom_model <../../../../progpy/examples/custom_model.py>`

Included DataModels
-------------------------
The following DataModels are included in the package. A new DataModel can be created by subclassing :py:class:`DataModel`, implementing the abstract methods of both :py:class:`DataModel` and :py:class:`PrognosticsModel`.

DMDModel
**************************
.. autoclass:: prog_models.data_models.DMDModel
.. autoclass:: progpy.data_models.DMDModel
:members: from_data, from_model

LSTMStateTransitionModel
**************************
.. autoclass:: prog_models.data_models.LSTMStateTransitionModel
.. autoclass:: progpy.data_models.LSTMStateTransitionModel
:members: from_data, from_model

PolynomialChaosExpansion
**************************
.. autoclass:: prog_models.data_models.PolynomialChaosExpansion
.. autoclass:: progpy.data_models.PolynomialChaosExpansion
:members: from_data, from_model

DataModel Interface
---------------------------
.. autoclass:: prog_models.data_models.DataModel
.. autoclass:: progpy.data_models.DataModel
:members:
:show-inheritance:
:inherited-members:
Expand Down
15 changes: 15 additions & 0 deletions sphinx-config/api_ref/progpy/DataSets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Datasets
================================================================

The `progpy` dataset subpackage is used to download labeled prognostics data for use in model building, analysis, or validation. Every dataset comes equipped with a `load_data` function which loads the specified data. Some datasets require a dataset number or id. This indicates the specific data to load from the larger dataset. The format of the data is specific to the dataset downloaded. Details of the specific datasets are summarized below:

.. note:: To use the dataset feature, you must install the requests package.

Variable Load Battery Data (nasa_battery)
----------------------------------------------------
.. autofunction:: progpy.datasets.nasa_battery.load_data

CMAPSS Jet Engine Data (nasa_cmapss)
----------------------------------------------------
.. autofunction:: progpy.datasets.nasa_cmapss.load_data

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EnsembleModel
================

.. autoclass:: prog_models.EnsembleModel
.. autoclass:: progpy.EnsembleModel
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Included Models
===================
The :ref:`prog_models<prog_models Guide>` package is distributed with a few pre-constructed models that can be used in simulation or prognostics (with the :ref:`prog_algs <prog_algs Guide>` package). These models are summarized in the following sections.
The progpy package is distributed with a few pre-constructed models that can be used in simulation or prognostics. These models are summarized in the following sections.

.. .. contents::
.. :backlinks: top
Expand All @@ -12,21 +12,21 @@ Battery Model

.. tab:: ElectroChem (EOD)

.. autoclass:: prog_models.models.BatteryElectroChemEOD
.. autoclass:: progpy.models.BatteryElectroChemEOD

.. tab:: ElectroChem (EOL)

.. autoclass:: prog_models.models.BatteryElectroChemEOL
.. autoclass:: progpy.models.BatteryElectroChemEOL

.. tab:: ElectroChem (Combo)

.. autoclass:: prog_models.models.BatteryElectroChem
.. autoclass:: progpy.models.BatteryElectroChem

.. autoclass:: prog_models.models.BatteryElectroChemEODEOL
.. autoclass:: progpy.models.BatteryElectroChemEODEOL

.. tab:: Circuit

.. autoclass:: prog_models.models.BatteryCircuit
.. autoclass:: progpy.models.BatteryCircuit


Pump Model
Expand All @@ -38,13 +38,13 @@ There are two variants of the pump model based on if the wear parameters are est

.. tab:: Base Model

.. autoclass:: prog_models.models.CentrifugalPumpBase
.. autoclass:: progpy.models.CentrifugalPumpBase

.. tab:: With Wear As State

.. autoclass:: prog_models.models.CentrifugalPump
.. autoclass:: progpy.models.CentrifugalPump

.. autoclass:: prog_models.models.CentrifugalPumpWithWear
.. autoclass:: progpy.models.CentrifugalPumpWithWear

Pneumatic Valve
-------------------------------------------------------------
Expand All @@ -55,13 +55,13 @@ There are two variants of the valve model based on if the wear parameters are es

.. tab:: Base Model

.. autoclass:: prog_models.models.PneumaticValveBase
.. autoclass:: progpy.models.PneumaticValveBase

.. tab:: With Wear As State

.. autoclass:: prog_models.models.PneumaticValve
.. autoclass:: progpy.models.PneumaticValve

.. autoclass:: prog_models.models.PneumaticValveWithWear
.. autoclass:: progpy.models.PneumaticValveWithWear

DC Motor
-------------------------------------------------------------
Expand All @@ -70,30 +70,30 @@ DC Motor

.. tab:: Single Phase

.. autoclass:: prog_models.models.DCMotorSP
.. autoclass:: progpy.models.DCMotorSP

.. tab:: Triple Phase

.. autoclass:: prog_models.models.DCMotor
.. autoclass:: progpy.models.DCMotor

ESC
-------------------------------------------------------------
.. autoclass:: prog_models.models.ESC
.. autoclass:: progpy.models.ESC

Powertrain
-------------------------------------------------------------
.. autoclass:: prog_models.models.Powertrain
.. autoclass:: progpy.models.Powertrain

PropellerLoad
-------------------------------------------------------------
.. autoclass:: prog_models.models.PropellerLoad
.. autoclass:: progpy.models.PropellerLoad

Aircraft Models
-------------------------------------------------------------
Aircraft model simulate the flight of an aircraft. All aircraft models inherit from :py:class:`prog_models.models.aircraft_model.AricraftModel`. Included models are listed below:
Aircraft model simulate the flight of an aircraft. All aircraft models inherit from :py:class:`progpy.models.aircraft_model.AricraftModel`. Included models are listed below:

.. autoclass:: prog_models.models.aircraft_model.SmallRotorcraft
.. autoclass:: progpy.models.aircraft_model.SmallRotorcraft

ThrownObject
-------------------------------------------------------------
.. autoclass:: prog_models.models.ThrownObject
.. autoclass:: progpy.models.ThrownObject
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LinearModel
=================

.. autoclass:: prog_models.LinearModel
.. autoclass:: progpy.LinearModel
:members:
:inherited-members:
:exclude-members: SimulationResults, generate_model, observables
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Loading
=========

The loading subpackage includes some classes for complex load estimation algorithms. See :download:`examples.future_loading <../../../../prog_models/examples/future_loading.py>` for more details.
The loading subpackage includes some classes for complex load estimation algorithms. See :download:`examples.future_loading <../../../../progpy/examples/future_loading.py>` for more details.

Load Estimator Class interface
------------------------------
Expand Down Expand Up @@ -32,15 +32,15 @@ The second approach for load estimators is a load estimation class. This is used
Load Estimator Classes
----------------------

.. autoclass:: prog_models.loading.Piecewise
.. autoclass:: progpy.loading.Piecewise

.. autoclass:: prog_models.loading.MovingAverage
.. autoclass:: progpy.loading.MovingAverage

.. autoclass:: prog_models.loading.GaussianNoiseLoadWrapper
.. autoclass:: progpy.loading.GaussianNoiseLoadWrapper

Controllers
------------------

.. autoclass:: prog_models.loading.controllers.LQR
.. autoclass:: progpy.loading.controllers.LQR

.. autoclass:: prog_models.loading.controllers.LQR_I
.. autoclass:: progpy.loading.controllers.LQR_I
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Two types of predictions are distributed with this package: `Prediction` and `Un
.. tabs::
.. tab:: Prediction

.. autoclass:: prog_algs.predictors.Prediction
.. autoclass:: progpy.predictors.Prediction
:members:
:inherited-members:

.. tab:: UnweightedSamplesPrediction

.. autoclass:: prog_algs.predictors.UnweightedSamplesPrediction
.. autoclass:: progpy.predictors.UnweightedSamplesPrediction
:members:
:inherited-members:
:exclude-members: append, extend, clear, pop, remove, reverse, insert
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Predictors
===========================

The :py:class:`Predictor` uses a state estimate (type :py:class:`UncertainData` subclass, output of a :py:class:`StateEstimator`), information about expected future loading, and a :py:class:`PrognosticsModel` (see: `prog_models package <https://github.com/nasa/prog_models>`__) to predict both future states (also outputs, performance metrics, event_states) at predefined points and the time that an event will occur (Time of Event, ToE) with uncertainty.
The :py:class:`Predictor` uses a state estimate (type :py:class:`UncertainData` subclass, output of a :py:class:`StateEstimator`), information about expected future loading, and a :py:class:`PrognosticsModel` to predict both future states (also outputs, performance metrics, event_states) at predefined points and the time that an event will occur (Time of Event, ToE) with uncertainty.

Here's an example of its use. In this example we use the :py:class:`ThrownObject` model and the :py:class:`MonteCarlo` predictor, and we save the state every 1s. We also use a scalar first state (i.e., no uncertainty).

.. code-block:: python
>>> from prog_models.models import ThrownObject
>>> from prog_algs.predictors import MonteCarlo
>>> from prog_algs.uncertain_data import ScalarData
>>> from progpy.predictors import MonteCarlo
>>> from progpy.uncertain_data import ScalarData
>>>
>>> m = ThrownObject()
>>> pred = MonteCarlo(m)
Expand All @@ -30,14 +30,14 @@ The following predictors are included with this package. A new predictor can be

.. tab:: Monte Carlo Predictor

.. autoclass:: prog_algs.predictors.MonteCarlo
.. autoclass:: progpy.predictors.MonteCarlo

.. tab:: Unscented Transform Predictor

.. autoclass:: prog_algs.predictors.UnscentedTransformPredictor
.. autoclass:: progpy.predictors.UnscentedTransformPredictor

Predictor Interface
-----------------------
.. autoclass:: prog_algs.predictors.Predictor
.. autoclass:: progpy.predictors.Predictor
:members:
:inherited-members:
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PrognosticsModel
====================

.. autoclass:: prog_models.PrognosticsModel
.. autoclass:: progpy.PrognosticsModel
:members:
:inherited-members:
:exclude-members: SimulationResults, generate_model, observables
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SimResult
================================

.. autoclass:: prog_models.sim_result.SimResult
.. autoclass:: progpy.sim_result.SimResult
:members:
:inherited-members:
:exclude-members: append, reverse, count, insert
Loading

0 comments on commit 65dda10

Please sign in to comment.