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

Updating dependencies and documentation #26

Merged
merged 7 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 11 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@
[apache]: https://opensource.org/licenses/Apache-2.0
[apache-shield]: https://img.shields.io/badge/License-Apache_2.0-blue.svg

# Welcome to the BibMon contributing guide

Thank you for your interest in contributing to the BibMon project!

We expect to receive various types of contributions from individuals, research institutions, startups, companies and oil operators partners.
We expect to receive various types of contributions from individuals, research institutions, startups and companies.

In this guide we present how the expected contributions might be proposed.

# Getting started
## Getting started

The recommended first step is to read the project's [README](README.md) for an overview of what this repository contains.

# Asking questions
## Asking questions

Please do not open issues to ask questions. Please use the Discussions section accessed through the link that appears in the top menu.

# Before contributing
## Before contributing

Before you can contribute to this project, we require you read and agree to the following documents:

Expand All @@ -29,7 +27,7 @@ Before you can contribute to this project, we require you read and agree to the

It is also very important to know, participate and follow the discussions. Click on the Discussions link that appears in the top menu.

# BibMon architecture
## BibMon architecture

`BibMon` was designed with easy extensibility and maintenance in mind, even for users with little experience in software development. This was achieved through the use of the object-oriented paradigm, which allows for the pre-implementation of generic functionalities and enables new features to be quickly programmed by leveraging the original structure.

Expand All @@ -51,14 +49,14 @@ The following bulletpoints describe the library's architecture and provide instr
* Additional Features
* Additional features such as generating comparative tables, correlation analysis, etc., are programmed in the `_bibmon_tools.py` file.

# Implementing New Functionalities
## Implementing New Functionalities

When implementing new functionalities, don't forget to:

* Add the classes and functions to the library's namespace (in the `__init__.py` file).
* Document the classes and functions using docstrings in the [NumPy format](https://numpydoc.readthedocs.io/en/latest/format.html).

## Models
### Models

To implement a new model, create a .py file with the following import statement:

Expand All @@ -81,7 +79,7 @@ The functionality implemented in `train_core` is specific to the considered mode

Optionally, implement an `__init__()` constructor or any other necessary methods.

## Preprocessing Techniques
### Preprocessing Techniques

Preprocessing techniques should be implemented as methods of the `PreProcess` class following the pattern:

Expand All @@ -99,16 +97,16 @@ Use the `self.is_Y` and `train_or_test` flags to cover the possibilities regardi

Even if not used, the `train_or_test` flag should be present in the input parameters.

## Data
### Data

Add the new dataset to a specific subdirectory in the `bibmon` directory. Program the data loading function in the `_load_data.py` file.

## Alarms
### Alarms

To program a new alarm logic, define a function in the `_alarms.py` file.

To apply the new logic in the library, it will be necessary to implement the use of the functionality in the methods of the `GenericModel` class by creating a new key in the `self.alarms` dictionary. If necessary, window sizes and other parameters should be programmed in the method entries.

## Additional Features
### Additional Features

Preferably, use the `_bibmon_tools.py` file to implement additional features.
10 changes: 10 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
API Reference
===================

.. module:: bibmon

.. automodule:: bibmon
:members:
:imported-members:
:inherited-members:
:show-inheritance:
10 changes: 0 additions & 10 deletions docs/source/bibmon.rst

This file was deleted.

25 changes: 18 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@
# -- Project information -----------------------------------------------------

project = 'BibMon'
copyright = '2022, Grupo EngePol'
author = 'Grupo EngePol'
copyright = '2024'
author = 'BibMon devs'

# The full version, including alpha/beta/rc tags
release = '1.0.0'
#release = '1.0.0'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc','sphinx.ext.napoleon']
extensions = ['sphinx.ext.autodoc','sphinx.ext.napoleon','myst_nb']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
#templates_path = ['_templates']

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'pt'
#language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -58,4 +58,15 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
#html_static_path = ['_static']

autosummary_ignore_module_all = False

import os
import sys
sys.path.insert(0, os.path.abspath('../../bibmon/'))

try:
jupyter_execute_notebooks = os.environ["EXECUTE_NOTEBOOKS"]
except KeyError:
jupyter_execute_notebooks = "off"
4 changes: 4 additions & 0 deletions docs/source/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contributing

```{include} ../../CONTRIBUTING.md
```
55 changes: 43 additions & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,53 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to BibMon's documentation!
BibMon: Process Monitoring Library
==================================

BibMon (from the Portuguese Biblioteca de Monitoramento de Processos, or Process Monitoring Library) is a Python package that provides deviation-based predictive models for fault detection, soft sensing, and process condition monitoring.

Features
----------------------

The resources offered by `BibMon` are:

* Application in online systems: a trained `BibMon` model can be used for online analysis with both individual samples and data windows. For each sample or window, a prediction is made, the model state is updated, and alarms are calculated.
* Compatibility, within the same architecture, of regression models (i.e., virtual sensors, containing separate X and Y data, such as RandomForest) and reconstruction models (containing only X data, such as PCA).
* Preprocessing pipelines that take into account the differences between X and Y data and between training and testing stages.
* Possibility of programming different alarm logics.
* Easy extensibility through inheritance (there is a class called `GenericModel` that implements all the common functionality for various models and can be used as a base for implementing new models). For details, consult the `CONTRIBUTING.md` file.
* Convenience functions for performing automatic offline analysis and plotting control charts.
* Real and simulated process datasets available for importing.
* Comparative tables to automate the performance analysis of different models.
* Automatic hyperparameter tuning using Optuna.

Getting started
-----------------------------

.. toctree::
:maxdepth: 3

install
usage
tutorials
sci_article

Contributing
----------------------

BibMon is an open-source project driven by the community. If you would like to contribute to the project, please refer to the following contributing page.

.. toctree::
:maxdepth: 2
:caption: Contents:
modules

.. automodule:: bibmon
:members:
:inherited-members:
:show-inheritance:
contributing.md

Indices and tables
==================
The API Documentation
-----------------------------

In this section you will find information about specific functions, classes, or methods.

.. toctree::
:maxdepth: 3

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
api
32 changes: 32 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Installation
========================

This section covers the installation of BibMon.

Installing from PyPI
--------------------------------

To install Requests, you can use pip::

$ pip install bimon

Get the Source Code
-------------------

BibMon is developed on GitHub, where the code is
`available at <https://github.com/petrobras/bibmon>`_.

You can either clone the public repository::

$ git clone https://github.com/petrobras/bibmon.git

Or, download the `tarball <https://github.com/petrobras/bibmon/tarball/main>`_::

$ curl -OL https://github.com/petrobras/bibmon/tarball/main
# optionally, zipball is also available (for Windows users).

Once you have a copy of the source, you can embed it in your own Python
package, or install it into your site-packages easily::

$ cd bibmon
$ python -m pip install .
7 changes: 0 additions & 7 deletions docs/source/modules.rst

This file was deleted.

4 changes: 4 additions & 0 deletions docs/source/sci_article.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Scientific article
-----------------------------

A scientific article detailing the package structure, design philosophy and main features can be accessed in `this link <https://drive.google.com/file/d/10DoNNA8gVeu2qtfjPuAbeFnwDWy_Xkzn/view?usp=sharing>`_.
Loading
Loading