3W Toolkit
- About
- Architecture Overview
- 3W Dataset
- Installation & Setup
- Jupyter Notebooks & Examples
- Contributing
📘 About
The evolution of machine learning has been catalyzed by the rapid advancement in data acquisition systems, scalable storage, high-performance processing, and increasingly efficient model training through matrix-centric hardware (e.g., GPUs). These advances have enabled the deployment of highly parameterized AI models in real-world applications such as health care, finance, and industrial operations.
In the oil & gas sector, the widespread availability of low-cost sensors has driven a paradigm shift from reactive maintenance to condition-based monitoring (CBM), where faults are detected and classified during ongoing operation. This approach minimizes downtime and improves operational safety. The synergy between AI and big data analysis has thus enabled the development of generalizable classifiers that require minimal domain knowledge and can be effectively adapted to a wide range of operational scenarios.
In this context, we present 3WToolkit+, a modular and open-source AI toolkit for time-series processing, aimed at fault detection and classification in oil well operation. Building upon the experience with the original 3WToolkit system and leveraging the Petrobras 3W Dataset, 3WToolkit introduces enhanced functionalities, such as advanced data imputation, deep feature extraction, synthetic data augmentation, and high-performance computing capabilities for model training.
The development of the 3WToolkit+ is the result of a collaborative partnership between Petrobras, with a focus on the CENPES research center, and the COPPE/Universidade Federal do Rio de Janeiro (UFRJ). This joint effort brings together complementary strengths: COPPE/UFRJ contributes decades of proven expertise in signal processing and machine learning model development, while CENPES offers access to highly specialized technical knowledge and real-world operational challenges in the oil and gas sector. This synergy ensures that 3WToolkit+ is both scientifically rigorous and practically relevant, addressing complex scenarios with robust and scalable AI-based solutions for time-series analysis and fault detection in oil well operations.
🧩 Architecture Overview
The following image illustrates the high-level architecture of the 3W Toolkit, designed to support the full pipeline of machine learning applications using the 3W dataset. From raw data ingestion to model evaluation and delivery to end users.
The schema below illustrates the main classes of the toolkit.
To better understand how the system is organized, we can divide all classes into two main abstraction layers: Application and Core.
-
The
Corelayer contains all configuration (Config) classes. These classes define the parameters required by each functional module. In other words, they describe how each component should behave, specifying its inputs and parameters. -
The
Applicationlayer contains the operational classes, which implement the actual logic for interacting with datasets, preprocessing tools, feature extraction, models, evaluation, visualization, and pipelines. These are the classes that you will uses in workflows.
📊 3W Dataset
The 3W dataset serves as a reference dataset for this project and is hosted on Figshare. However, the toolkit is not limited to the 3W dataset and can be adapted for other datasets as well.
Further details on the 3W dataset’s structure, preprocessing, and usage are available in the 3W_DATASET_STRUCTURE.md file.
⚙️ Installation & Setup
It is possible to perform the installation in different ways, depending on what you want to do:
- Just want to use the 3W Toolkit? Install the published package from PyPI. You don't need to clone the repository.
- Want to develop or contribute to the 3W Toolkit? Clone (or fork) the repository and install it locally in editable mode, so your changes are picked up immediately without reinstalling.
Option A: Install from PyPI (for using the toolkit)
pip install ThreeWToolkit
or, using uv:
uv pip install ThreeWToolkit
Option B: Clone/Fork and install in editable mode (for development/contribution)
1. Fork or clone the repository
Fork
- Go to https://github.com/petrobras/3W
- Click “Fork” in the top-right corner to create a copy under your GitHub account.
- Clone your forked repository:
git clone git@github.com:<your-username>/3W.git
Clone
git clone git@github.com:petrobras/3W.git
2. Install the package in editable mode
Our recommended virtual environment manager is uv. Install uv according to the official instructions.
Using uv (recommended)
Linux / macOS (terminal):
uv venv .venv
source .venv/bin/activate
uv pip install -e .
Windows (cmd):
uv venv .venv
.venv\Scripts\activate.bat
uv pip install -e .
Windows (PowerShell):
uv venv .venv
.venv\Scripts\Activate.ps1
uv pip install -e .
Windows (Bash):
uv venv .venv
source .venv/Scripts/activate
uv pip install -e .
Using pip
pip install -e .
🪐 Jupyter Notebooks & Examples
A curated set of ready-to-use jupyter notebooks that demonstrate how to use the toolkit to common fault detection tasks using the 3W dataset. These examples accelerate onboarding and reproducibility.
The set of notebooks can be found in the notebooks folder
🤝 Contributing
We welcome contributions to help us improve and expand the functionality of the 3W toolkit. To ensure a smooth collaboration process, please follow our contrubuting guidelines here.
Metadata
Release files for ThreeWToolkit 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| threewtoolkit-3.3.0.tar.gz | 103.4 kB | Without provenance | Details for threewtoolkit-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| threewtoolkit-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for threewtoolkit-3.3.0-py3-none-any.whl |
Total release size: 236.5 kB
Release files / threewtoolkit-3.3.0.tar.gz
| Download URL | threewtoolkit-3.3.0.tar.gz |
|---|---|
| Size | 103.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
429310569cdddea83c1d18b9e1b751ee28d92919022ac790082f88a9998d8472
|
|
BLAKE2b-256 checksum How to use checksums |
68c0b555ea601590be8ad2c26d0e614e80587943badd3043b07269175761882c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / threewtoolkit-3.3.0-py3-none-any.whl
| Download URL | threewtoolkit-3.3.0-py3-none-any.whl |
|---|---|
| Size | 133.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5533ef1f3c82becf4529c15fecc71a72a5357755404348a9285ce49f30aff9e1
|
|
BLAKE2b-256 checksum How to use checksums |
5d999e3df5062b85c87cc4293c1295711acf473215008c4734b54ecbbd87d7ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ThreeWToolkit 3.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.