Skip to content

DTOcean/dtocean-reliability

Repository files navigation

appveyor codecov Codacy Badge release

DTOcean Reliability Module

The DTOcean Reliability Module provides functions to assess and compare the reliability of arrays designed by DTOcean. It also acts as a support library for the dtocean-maintenance module. It aggregates the component "networks" produced by the dtocean-electrical and dtocean-moorings modules and generates reliability metrics at sub-system level. When combined with the device sub-system reliability values, it can also generate reliability metrics for the array as a whole.

See dtocean-app or dtocean-core to use this package within the DTOcean ecosystem.

* For python 2.7 only.

Installation

Installation and development of dtocean-reliability uses the Anaconda Distribution (Python 2.7)

Conda Package

To install:

$ conda install -c dataonlygreater dtocean-reliability

Source Code

Conda can be used to install dependencies into a dedicated environment from the source code root directory:

$ conda create -n _dtocean_rely python=2.7 pip

Activate the environment, then copy the .condrc file to store installation
channels:

$ conda activate _dtocean_rely
$ copy .condarc %CONDA_PREFIX%

OR, if you're using Powershell:

$ conda activate _dtocean_rely
$ copy .condarc $env:CONDA_PREFIX

Install polite into the environment. For example, if installing it from source:

$ cd \\path\\to\\polite
$ conda install --file requirements-conda-dev.txt
$ pip install -e .

Finally, install dtocean-reliability and its dependencies using conda and pip:

$ cd \\path\\to\\dtocean-reliability
$ conda install --file requirements-conda-dev.txt
$ pip install -e .

To deactivate the conda environment:

$ conda deactivate

Tests

A test suite is provided with the source code that uses pytest.

If not already active, activate the conda environment set up in the Source Code section:

$ conda activate _dtocean_rely

Install packages required for testing to the environment (one time only):

$ conda install -y numpy python-graphviz pytest

Run the tests:

$ pytest tests

Uninstall

To uninstall the conda package:

$ conda remove dtocean-reliability

To uninstall the source code and its conda environment:

$ conda remove --name _dtocean_rely --all

Usage

Example scripts are available in the "examples" folder of the source code.

$ cd examples
$ python example.py

The pandas package can optionally be installed to view the example output as DataFrames.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

See this blog post for information regarding development of the DTOcean ecosystem.

Please make sure to update tests as appropriate.

Credits

This package was initially created as part of the EU DTOcean project by:

It is now maintained by Mathew Topper at Data Only Greater.

License

GPL-3.0