ThreeWToolkit 0.0.1__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- threewtoolkit-1.0.0/LICENSE.md +201 -0
- threewtoolkit-1.0.0/PKG-INFO +164 -0
- threewtoolkit-1.0.0/README.md +181 -0
- threewtoolkit-1.0.0/pyproject.toml +87 -0
- threewtoolkit-1.0.0/setup.cfg +4 -0
- threewtoolkit-1.0.0/tests/test_assessment_visualization.py +159 -0
- threewtoolkit-1.0.0/tests/test_data_loader.py +168 -0
- threewtoolkit-1.0.0/tests/test_dataset.py +166 -0
- threewtoolkit-1.0.0/tests/test_downloader.py +82 -0
- threewtoolkit-1.0.0/tests/test_example.py +5 -0
- threewtoolkit-1.0.0/tests/test_extract_exponential_statistical_features.py +562 -0
- threewtoolkit-1.0.0/tests/test_extract_statistical_features.py +512 -0
- threewtoolkit-1.0.0/tests/test_extract_wavelet_features.py +286 -0
- threewtoolkit-1.0.0/tests/test_load_model.py +180 -0
- threewtoolkit-1.0.0/tests/test_metrics.py +743 -0
- threewtoolkit-1.0.0/tests/test_mlp.py +241 -0
- threewtoolkit-1.0.0/tests/test_model_assessment.py +1047 -0
- threewtoolkit-1.0.0/tests/test_pipeline.py +692 -0
- threewtoolkit-1.0.0/tests/test_plot_correlation_heatmap.py +87 -0
- threewtoolkit-1.0.0/tests/test_plot_multiple_series.py +73 -0
- threewtoolkit-1.0.0/tests/test_plot_series.py +123 -0
- threewtoolkit-1.0.0/tests/test_preprocessing.py +429 -0
- threewtoolkit-1.0.0/tests/test_report_generation.py +282 -0
- threewtoolkit-1.0.0/tests/test_save_best_model.py +111 -0
- threewtoolkit-1.0.0/tests/test_sklearn_models.py +200 -0
- threewtoolkit-1.0.0/tests/test_template_manager.py +256 -0
- threewtoolkit-1.0.0/tests/test_trainer.py +575 -0
- threewtoolkit-1.0.0/tests/test_trainer_logger.py +81 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/README.md +113 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/__init__.py +1 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/assessment/__init__.py +3 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/assessment/assessment_visualizations.py +167 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/assessment/model_assess.py +702 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/constants.py +26 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_assessment.py +109 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_assessment_visualization.py +25 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_dataset.py +90 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_feature_extractor.py +179 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_metrics.py +224 -0
- {threewtoolkit-0.0.1 → threewtoolkit-1.0.0/toolkit}/ThreeWToolkit/core/base_model_trainer.py +11 -9
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_models.py +40 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_preprocessing.py +152 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_step.py +66 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/base_time_series_holdout.py +35 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core/enums.py +49 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_loader/__init__.py +5 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_loader/csv_data_loader.py +43 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/__init__.py +19 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/base_visualizer.py +36 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/correlation_heatmap.py +101 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/plot_fft.py +98 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/plot_multiple_series.py +109 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/plot_series.py +108 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/plot_utils.py +49 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/plots.py +239 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/seasonal_decomposition.py +114 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/three_w_chart.py +312 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/data_visualization/wavelet_spectrogram.py +98 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/dataset/__init__.py +6 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/dataset/parquet_dataset.py +333 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/feature_extraction/__init__.py +10 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/feature_extraction/extract_exponential_statistics_features.py +359 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/feature_extraction/extract_statistical_features.py +297 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/feature_extraction/extract_wavelet_features.py +309 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/metrics/__init__.py +22 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/metrics/_classification.py +282 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/metrics/_regression.py +40 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/models/__init__.py +9 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/models/mlp.py +691 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/models/sklearn_models.py +185 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/pipeline.py +592 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/preprocessing/__init__.py +13 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/preprocessing/_data_processing.py +492 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/reports/report_generation.py +624 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/trainer/trainer.py +831 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/__init__.py +3 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/data_utils.py +397 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/downloader.py +173 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/general_utils.py +39 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/model_recorder.py +97 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/template_manager.py +67 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit/utils/trainer_logger.py +86 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit.egg-info/PKG-INFO +164 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit.egg-info/SOURCES.txt +87 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit.egg-info/dependency_links.txt +1 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit.egg-info/requires.txt +42 -0
- threewtoolkit-1.0.0/toolkit/ThreeWToolkit.egg-info/top_level.txt +2 -0
- threewtoolkit-0.0.1/LICENSE +0 -674
- threewtoolkit-0.0.1/PKG-INFO +0 -215
- threewtoolkit-0.0.1/README.md +0 -184
- threewtoolkit-0.0.1/ThreeWToolkit/assessment/test_results_assessment.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/assessment/training_assessment.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/core/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_assessment.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_assessment_visualization.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_data_loader.py +0 -44
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_data_visualization.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_feature_extractor.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_metrics.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_model_development.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_models.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_optim.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_preprocessing.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/core/base_time_series_holdout.py +0 -9
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/csv_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/database_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/hdf5_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/json_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/pickle_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_loader/threew_data_loader.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_correlation_heatmap.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_fft.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_multiple_series.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_seasonal_decompose.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_series.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_statistical_features.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/data_visualization/plot_wavelet_spectrogram.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/enums/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/extract_autocorrelation.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/extract_fourier_features.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/extract_shapelets.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/extract_statistical_features.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/extract_wavelet_features.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/feature_extraction/tsfresh_features.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/holdout/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/holdout/train_test_split.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/logs/dummy.txt +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/accuracy.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/average_precision.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/balanced_accuracy.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/explained_variance.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/f1_score.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/homogeneity_score.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/neg_mean_absolute_error.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/neg_mean_squared_error.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/neg_root_mean_squared_error.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/precision.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/recall.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/metrics/roc_auc.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/models/anomaly/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/models/anomaly/autoencoder_anomaly.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/models/anomaly/detect_zscore_anomaly.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/models/anomaly/isolation_forest_anomaly.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/models/anomaly/spectral_residual_anomaly.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/models/classification/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/models/classification/classification_models.py +0 -5
- threewtoolkit-0.0.1/ThreeWToolkit/models/regression/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/models/regression/regression_models.py +0 -5
- threewtoolkit-0.0.1/ThreeWToolkit/optim/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/optim/bayesian.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/optim/genetic_algorithm.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/optim/gradient_optimization.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/optim/grid_search.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/optim/random_search.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/pipeline.py +0 -2
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/detrend.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/impute_missing_data.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/impute_target_data.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/normalize.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/rename_columns.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/resample.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/smooth.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/preprocessing/windowing.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/reports/dummy.txt +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/cnn_lstm.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/elasticnet.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/inception_time.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/lstm.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/sklearn_models.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/trainers/transformer.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/utils/__init__.py +0 -0
- threewtoolkit-0.0.1/ThreeWToolkit/utils/general_utils.py +0 -4
- threewtoolkit-0.0.1/ThreeWToolkit/utils/model_recorder.py +0 -12
- threewtoolkit-0.0.1/ThreeWToolkit/utils/report_generation.py +0 -24
- threewtoolkit-0.0.1/ThreeWToolkit/utils/trainer_logger.py +0 -8
- threewtoolkit-0.0.1/pyproject.toml +0 -46
- {threewtoolkit-0.0.1/ThreeWToolkit → threewtoolkit-1.0.0/toolkit/ThreeWToolkit/core}/__init__.py +0 -0
- {threewtoolkit-0.0.1/ThreeWToolkit/assessment → threewtoolkit-1.0.0/toolkit/ThreeWToolkit/reports}/__init__.py +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2024 Petróleo Brasileiro S.A.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ThreeWToolkit
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A modular and open-source AI toolkit for time-series processing, aimed at fault detection and classification in oil well operation
|
|
5
|
+
Author-email: Ricardo Emanuel Vaz Vargas <ricardo.vargas@petrobras.com.br>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE.md
|
|
10
|
+
Requires-Dist: numpy>=1.26.4
|
|
11
|
+
Requires-Dist: scipy>=1.15.2
|
|
12
|
+
Requires-Dist: pandas>=2.2.3
|
|
13
|
+
Requires-Dist: scikit-learn>=1.6.1
|
|
14
|
+
Requires-Dist: matplotlib>=3.10.1
|
|
15
|
+
Requires-Dist: seaborn>=0.13.2
|
|
16
|
+
Requires-Dist: plotly>=6.0.0
|
|
17
|
+
Requires-Dist: imbalanced-learn>=0.13.0
|
|
18
|
+
Requires-Dist: ipykernel>=6.29.5
|
|
19
|
+
Requires-Dist: ipywidgets==8.1.7
|
|
20
|
+
Requires-Dist: jupyter-client==8.6.3
|
|
21
|
+
Requires-Dist: jupyter-core==5.8.1
|
|
22
|
+
Requires-Dist: Pillow>=11.0.0
|
|
23
|
+
Requires-Dist: scikit-image>=0.25.2
|
|
24
|
+
Requires-Dist: torch>=2.7.0
|
|
25
|
+
Requires-Dist: torchvision>=0.22.0
|
|
26
|
+
Requires-Dist: torchmetrics>=1.6.2
|
|
27
|
+
Requires-Dist: timm>=1.0.15
|
|
28
|
+
Requires-Dist: tqdm>=4.67.1
|
|
29
|
+
Requires-Dist: pydantic>=2.11
|
|
30
|
+
Requires-Dist: PyWavelets>=1.8.0
|
|
31
|
+
Requires-Dist: pyarrow>=20.0.0
|
|
32
|
+
Requires-Dist: pylatex>=1.4.2
|
|
33
|
+
Requires-Dist: statsmodels>=0.14.5
|
|
34
|
+
Requires-Dist: requests<=2.35.5
|
|
35
|
+
Provides-Extra: dev
|
|
36
|
+
Requires-Dist: black>=25.9.0; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy>=1.16.0; extra == "dev"
|
|
38
|
+
Requires-Dist: flake8; extra == "dev"
|
|
39
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
40
|
+
Requires-Dist: ruff>=0.12.2; extra == "dev"
|
|
41
|
+
Requires-Dist: uv; extra == "dev"
|
|
42
|
+
Requires-Dist: types-requests>=2.32.4.20250611; extra == "dev"
|
|
43
|
+
Requires-Dist: coverage>=7.8.1; extra == "dev"
|
|
44
|
+
Requires-Dist: pytest>=8.3.5; extra == "dev"
|
|
45
|
+
Requires-Dist: pytest-mock>=3.14.1; extra == "dev"
|
|
46
|
+
Provides-Extra: docs
|
|
47
|
+
Requires-Dist: mkdocs; extra == "docs"
|
|
48
|
+
Requires-Dist: mkdocstrings[python]; extra == "docs"
|
|
49
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
|
|
52
|
+
[![Apache 2.0][apache-shield]][apache]
|
|
53
|
+
[![Code style][black-shield]][black]
|
|
54
|
+
[![Versioning][semver-shield]][semver]
|
|
55
|
+
|
|
56
|
+
[apache]: https://opensource.org/licenses/Apache-2.0
|
|
57
|
+
[apache-shield]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
58
|
+
[black]: https://github.com/psf/black
|
|
59
|
+
[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
60
|
+
[semver]: https://semver.org
|
|
61
|
+
[semver-shield]: https://img.shields.io/badge/semver-2.0.0-blue
|
|
62
|
+
|
|
63
|
+
<h1>
|
|
64
|
+
<img src="../../images/3w_logo.png" width="45" style="vertical-align: middle; margin-right: 10px;" />
|
|
65
|
+
3W Toolkit
|
|
66
|
+
</h1>
|
|
67
|
+
|
|
68
|
+
<a id="readme-top"></a>
|
|
69
|
+
|
|
70
|
+
<summary>Table of Contents</summary>
|
|
71
|
+
|
|
72
|
+
<ol>
|
|
73
|
+
<li><a href="#about-the-project">About</a></li>
|
|
74
|
+
<li><a href="#architecture_overview">Architecture Overview</a></li>
|
|
75
|
+
<li><a href="#dataset">3W Dataset</a></li>
|
|
76
|
+
<li><a href="#installation">Installation & Setup</a></li>
|
|
77
|
+
<li><a href="#notebooks">Jupyter Notebooks & Examples</a></li>
|
|
78
|
+
<li><a href="#contributing">Contributing</a></li>
|
|
79
|
+
</ol>
|
|
80
|
+
|
|
81
|
+
## 📘 About <a id="about-the-project"></a>
|
|
82
|
+
|
|
83
|
+
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.
|
|
84
|
+
|
|
85
|
+
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.
|
|
86
|
+
|
|
87
|
+
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 <a href="https://github.com/petrobras/3W">3W Dataset</a>, 3WToolkit introduces enhanced functionalities, such as advanced data imputation, deep feature extraction, synthetic data augmentation, and high-performance computing capabilities for model training.
|
|
88
|
+
|
|
89
|
+
<p align="center">
|
|
90
|
+
<img src="../../images/petrobras_logo.png" width="150" style="margin-right: 30px;" />
|
|
91
|
+
<img src="../../images/coppe_logo.png" width="150" />
|
|
92
|
+
</p>
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
## 🧩 Architecture Overview <a id="architecture_overview"></a>
|
|
97
|
+
|
|
98
|
+
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.
|
|
99
|
+
|
|
100
|
+
The schema below illustrates the main classes of the toolkit.
|
|
101
|
+
|
|
102
|
+
<img width="1200" src="../../images/3w_classes_in_groups.jpg">
|
|
103
|
+
|
|
104
|
+
To better understand how the system is organized, we can divide all classes into two main abstraction layers: **`Application`** and **`Core`**.
|
|
105
|
+
|
|
106
|
+
* The **`Core`** layer 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.
|
|
107
|
+
|
|
108
|
+
* The **`Application`** layer 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.
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## 📊 3W Dataset <a id="dataset"></a>
|
|
112
|
+
The **3W dataset** serves as a **reference dataset** for this project and is hosted on [Figshare](https://figshare.com/projects/3W_Dataset/251195). However, the toolkit is not limited to the 3W dataset and can be adapted for other datasets as well.
|
|
113
|
+
|
|
114
|
+
Further details on the 3W dataset’s structure, preprocessing, and usage are available in the [3W_DATASET_STRUCTURE.md](../3W_DATASET_STRUCTURE.md) file.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## ⚙️ Installation & Setup <a id="installation"></a>
|
|
118
|
+
|
|
119
|
+
It is possible to perform the installation in different ways.
|
|
120
|
+
|
|
121
|
+
**1. Fork or clone the repository**
|
|
122
|
+
**Option A: Fork**
|
|
123
|
+
1. Go to [https://github.com/petrobras/3W](https://github.com/petrobras/3W)
|
|
124
|
+
2. Click “Fork” in the top-right corner to create a copy under your GitHub account.
|
|
125
|
+
3. Clone your forked repository:
|
|
126
|
+
```bash
|
|
127
|
+
git clone git@github.com:<your-username>/3W.git
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Option B: Clone**
|
|
131
|
+
```bash
|
|
132
|
+
git clone git@github.com:petrobras/3W.git
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**2. Install the package**
|
|
136
|
+
**Option A: Using `pip`**
|
|
137
|
+
```bash
|
|
138
|
+
pip install -e .
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Option B: Using `uv`**
|
|
142
|
+
```bash
|
|
143
|
+
uv venv .venv
|
|
144
|
+
source venv/bin/activate
|
|
145
|
+
uv pip install -e .
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Option C: Using `conda`**
|
|
149
|
+
```bash
|
|
150
|
+
conda env create -f environment.yml
|
|
151
|
+
conda activate 3W
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## 🪐 Jupyter Notebooks & Examples <a id="notebooks"></a>
|
|
155
|
+
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.
|
|
156
|
+
|
|
157
|
+
The set of notebooks can be found in the [notebooks folder](../docs/notebooks/)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
## 🤝 Contributing <a id="contributing"></a>
|
|
161
|
+
|
|
162
|
+
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](../CONTRIBUTING.md).
|
|
163
|
+
|
|
164
|
+
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
|
|
2
|
+
[![Apache 2.0][apache-shield]][apache]
|
|
3
|
+
[![CC BY 4.0][cc-by-shield]][cc-by]
|
|
4
|
+
[![Code style][black-shield]][black]
|
|
5
|
+
[![Versioning][semver-shield]][semver]
|
|
6
|
+
|
|
7
|
+
[apache]: https://opensource.org/licenses/Apache-2.0
|
|
8
|
+
[apache-shield]: https://img.shields.io/badge/License-Apache_2.0-blue.svg
|
|
9
|
+
[cc-by]: http://creativecommons.org/licenses/by/4.0/
|
|
10
|
+
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg
|
|
11
|
+
[black]: https://github.com/psf/black
|
|
12
|
+
[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg
|
|
13
|
+
[semver]: https://semver.org
|
|
14
|
+
[semver-shield]: https://img.shields.io/badge/semver-2.0.0-blue
|
|
15
|
+
|
|
16
|
+
# Table of Content
|
|
17
|
+
|
|
18
|
+
* [Introduction](#introduction)
|
|
19
|
+
* [Motivation](#motivation)
|
|
20
|
+
* [Strategy](#strategy)
|
|
21
|
+
* [Ambition](#ambition)
|
|
22
|
+
* [Governance](#governance)
|
|
23
|
+
* [Contributions](#contributions)
|
|
24
|
+
* [Licenses](#licenses)
|
|
25
|
+
* [Versioning](#versioning)
|
|
26
|
+
* [Questions](#questions)
|
|
27
|
+
* [3W Dataset](#3w-dataset)
|
|
28
|
+
* [Structure](#structure)
|
|
29
|
+
* [Overview](#overview)
|
|
30
|
+
* [3W Toolkit](#3w-toolkit)
|
|
31
|
+
* [Structure](#structure-1)
|
|
32
|
+
* [Incorporated Problems](#incorporated-problems)
|
|
33
|
+
* [Examples of Use](#examples-of-use)
|
|
34
|
+
* [Reproducibility](#reproducibility)
|
|
35
|
+
* [3W Community](#3w-community)
|
|
36
|
+
|
|
37
|
+
# Introduction
|
|
38
|
+
|
|
39
|
+
This is the first repository published by Petrobras on GitHub. It supports the 3W Project, which aims to promote experimentation and development of Machine Learning-based approaches and algorithms for specific problems related to detection and classification of undesirable events that occur in offshore oil wells.
|
|
40
|
+
|
|
41
|
+
The 3W Project is based on the 3W Dataset, a database described in [this paper](https://doi.org/10.1016/j.petrol.2019.106223), and on the 3W Toolkit, a software package that promotes experimentation with the 3W Dataset for specific problems. The name **3W** was chosen because this dataset is composed of instances from ***3*** different sources and which contain undesirable events that occur in oil ***W***ells.
|
|
42
|
+
|
|
43
|
+
## Motivation
|
|
44
|
+
|
|
45
|
+
Timely detection of undesirable events in oil wells can help prevent production losses, reduce maintenance costs, environmental accidents, and human casualties. Losses related to this type of events can reach 5% of production in certain scenarios, especially in areas such as Flow Assurance and Artificial Lifting Methods. In terms of maintenance, the cost of a maritime probe, required to perform various types of operations, can exceed US $500,000 per day.
|
|
46
|
+
|
|
47
|
+
Creating a dataset and making it public to be openly experienced can greatly foment the development of tools that can:
|
|
48
|
+
|
|
49
|
+
* Improve the process of identifying undesirable events in the drilling, completion and production phases of offshore wells;
|
|
50
|
+
* Increase the efficiency of monitoring the integrity of wells and subsea systems, whose related problems can generate invaluable losses for people, environment, and company's image.
|
|
51
|
+
|
|
52
|
+
## Strategy
|
|
53
|
+
|
|
54
|
+
The 3W is the first pilot of a Petrobras' program called [Conexões para Inovação - Módulo Open Lab](https://tecnologia.petrobras.com.br/modulo-open-lab). This pilot is an ***open project*** composed by two major resources:
|
|
55
|
+
|
|
56
|
+
* The [3W Dataset](#3w-dataset), which will be evolved and supplemented with more instances from time to time;
|
|
57
|
+
* The [3W Toolkit](#3w-toolkit), which will also be evolved (in many ways) to cover an increasing number of undesirable events during its development.
|
|
58
|
+
|
|
59
|
+
Therefore, our strategy is to make these resources publicly available so that we can develop the 3W Project with a global community collaboratively.
|
|
60
|
+
|
|
61
|
+
## Ambition
|
|
62
|
+
|
|
63
|
+
With this project, Petrobras intends to develop (fix, improve, supplement, etc.):
|
|
64
|
+
|
|
65
|
+
* The [3W Dataset](#3w-dataset) itself;
|
|
66
|
+
* The [3W Toolkit](#3w-toolkit) itself;
|
|
67
|
+
* Approaches and algorithms that can be incorporated into systems dedicated to monitoring undesirable events in offshore oil wells during their respective drilling, completion and production phases;
|
|
68
|
+
* Tools that can be useful for our ambition.
|
|
69
|
+
|
|
70
|
+
## Governance
|
|
71
|
+
|
|
72
|
+
The 3W Project was conceived and publicly launched on May 30, 2022 as a strategic action by Petrobras, led by its department responsible for Flow Assurance and its research center ([CENPES](https://www.petrobras.com.br/inovacao-e-tecnologia/centro-de-pesquisa)). Since then, 3W has become increasingly consolidated at Petrobras in several aspects: more professionals specialized in labeling instances, more projects and teams using the resources made available by 3W, more investment in developing the digital tools needed to label and export instances, more interest in including different types of undesirable events that occur in wells during the drilling, completion and production phases, etc.
|
|
73
|
+
|
|
74
|
+
Due to this evolution, from May 1st, 2024 the 3W's governance is now done with the participation of the Petrobras' department responsible for Well Integrity.
|
|
75
|
+
|
|
76
|
+
## Contributions
|
|
77
|
+
|
|
78
|
+
We expect to receive various types of contributions from individuals, research institutions, startups, companies and partner oil operators.
|
|
79
|
+
|
|
80
|
+
Before you can contribute to this project, you need to read and agree to the following documents:
|
|
81
|
+
|
|
82
|
+
* [CODE OF CONDUCT](CODE_OF_CONDUCT.md);
|
|
83
|
+
* [CONTRIBUTOR LICENSE AGREEMENT](CONTRIBUTOR_LICENSE_AGREEMENT.md);
|
|
84
|
+
* [CONTRIBUTING GUIDE](CONTRIBUTING.md).
|
|
85
|
+
|
|
86
|
+
It is also very important to know, participate and follow the discussions. See the discussions section.
|
|
87
|
+
|
|
88
|
+
## Licenses
|
|
89
|
+
|
|
90
|
+
All the code of this project is licensed under the [Apache 2.0 License][apache] and all 3W Dataset's data files (Parquet files saved in subdirectories of the [dataset](dataset) directory) are licensed under the [Creative Commons Attribution 4.0 International License][cc-by].
|
|
91
|
+
|
|
92
|
+
## Versioning
|
|
93
|
+
|
|
94
|
+
In the 3W Project, three types of versions will be managed as follows.
|
|
95
|
+
|
|
96
|
+
* Version of the 3W Toolkit: specified in the [__init__.py](toolkit/__init__.py) file;
|
|
97
|
+
* Version of the 3W Dataset: specified in the [dataset.ini](dataset/dataset.ini) file;
|
|
98
|
+
* Version of the 3W Project: specified with tags in the git repository;
|
|
99
|
+
* We will exclusively use the semantic versioning defined in https://semver.org;
|
|
100
|
+
* Versions will always be updated manually;
|
|
101
|
+
* Versioning of the 3W Toolkit and 3W Dataset are completely independent of each other;
|
|
102
|
+
* The version of the 3W Project will be updated whenever, and only when, there is a new commit in the `main` branch of the repository, regardless of the updated resource: 3W Toolkit, 3W Dataset, 3W Project's documentation, example of use, etc;
|
|
103
|
+
* We will only use annotated tags and for each tag there will be a release in the remote repository (GitHub);
|
|
104
|
+
* Content for each release will be automatically generated with functionality provided by GitHub.
|
|
105
|
+
|
|
106
|
+
## Questions
|
|
107
|
+
|
|
108
|
+
See the discussions section. If you don't get clarification, please open discussions to ask your questions so we can answer them.
|
|
109
|
+
|
|
110
|
+
# 3W Dataset
|
|
111
|
+
|
|
112
|
+
To the best of its authors' knowledge, this is the first realistic and public dataset with rare undesirable real events in oil wells that can be readily used as a benchmark dataset for development of machine learning techniques related to inherent difficulties of actual data. For more information about the theory behind this dataset, refer to the paper **A realistic and public dataset with rare undesirable real events in oil wells** published in the **Journal of Petroleum Science and Engineering** (link [here](https://doi.org/10.1016/j.petrol.2019.106223)).
|
|
113
|
+
|
|
114
|
+
## Structure
|
|
115
|
+
|
|
116
|
+
The 3W Dataset consists of multiple Parquet files saved in subdirectories of the [dataset](dataset) directory and structured as detailed [here](3W_DATASET_STRUCTURE.md).
|
|
117
|
+
|
|
118
|
+
## Overview
|
|
119
|
+
|
|
120
|
+
A 3W Dataset's general presentation with some quantities and statistics is available in [this](overviews/_baseline/main.ipynb) Jupyter Notebook.
|
|
121
|
+
|
|
122
|
+
# 3W Toolkit
|
|
123
|
+
|
|
124
|
+
The 3W Toolkit is a software package written in Python 3 that contains resources that make the following easier:
|
|
125
|
+
|
|
126
|
+
* [3W Dataset](#3w-dataset) overview generation;
|
|
127
|
+
* Experimentation and comparative analysis of Machine Learning-based approaches and algorithms for specific problems related to undesirable events that occur in offshore oil wells during their respective drilling, completion and production phases;
|
|
128
|
+
* Standardization of key points of the Machine Learning-based algorithm development pipeline.
|
|
129
|
+
|
|
130
|
+
It is important to note that there are arbitrary choices in this toolkit, but they have been carefully made to allow adequate comparative analysis without compromising the ability to experiment with different approaches and algorithms.
|
|
131
|
+
|
|
132
|
+
## Structure
|
|
133
|
+
|
|
134
|
+
The 3W Toolkit is implemented in sub-modules as discribed [here](3W_TOOLKIT_STRUCTURE.md).
|
|
135
|
+
|
|
136
|
+
## Incorporated Problems
|
|
137
|
+
|
|
138
|
+
Specific problems will be incorporated into this project gradually. At this point, we can work on:
|
|
139
|
+
|
|
140
|
+
* [Binary classifier of Spurious Closure of DHSV](problems/01_binary_classifier_of_spurious_closure_of_dhsv/README.md).
|
|
141
|
+
|
|
142
|
+
All specification is detailed in the [CONTRIBUTING GUIDE](CONTRIBUTING.md).
|
|
143
|
+
|
|
144
|
+
## Examples of Use
|
|
145
|
+
|
|
146
|
+
The list below with examples of how to use the 3W Toolkit will be incremented throughout its development.
|
|
147
|
+
|
|
148
|
+
* 3W Dataset's overviews:
|
|
149
|
+
* [Baseline](overviews/_baseline/main.ipynb)
|
|
150
|
+
* [André Machado's overview](overviews/AndreMachado/main.ipynb)
|
|
151
|
+
* Binary classifier of Spurious Closure of DHSV:
|
|
152
|
+
* [Baseline](problems/01_binary_classifier_of_spurious_closure_of_dhsv/_baseline/main.ipynb)
|
|
153
|
+
|
|
154
|
+
For a contribution of yours to be listed here, follow the instructions detailed in the [CONTRIBUTING GUIDE](CONTRIBUTING.md).
|
|
155
|
+
|
|
156
|
+
## Reproducibility
|
|
157
|
+
|
|
158
|
+
For all results generated by the 3W Toolkit to be consistent, we recommend you create and use a virtual environment with the packages versions specified in the [environment.yml](environment.yml), which was generated with [conda](https://docs.conda.io). Our current recommendation is to use the conda distributed by [Miniforge](https://conda-forge.org/download/). Download and install Miniforge according to the official instructions. Open a prompt on your operating system (Windows, Linux or MacOS). Make sure the current directory is the directory where you have the 3W. Run the following commands as needed:
|
|
159
|
+
|
|
160
|
+
* To create a virtual environment from our [environment.yml](environment.yml):
|
|
161
|
+
```
|
|
162
|
+
$ conda env create -f environment.yml
|
|
163
|
+
```
|
|
164
|
+
* To activate the created virtual environment:
|
|
165
|
+
```
|
|
166
|
+
$ conda activate 3W
|
|
167
|
+
```
|
|
168
|
+
* To use the 3W Toolkit resources interactively:
|
|
169
|
+
```
|
|
170
|
+
$ python
|
|
171
|
+
```
|
|
172
|
+
* To initialize a local Jupyter Notebook server:
|
|
173
|
+
```
|
|
174
|
+
$ jupyter notebook
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
# 3W Community
|
|
178
|
+
|
|
179
|
+
The 3W Community is gradually expanding and is made up of independent professionals and representatives of research institutions, startups, companies and oil operators from different countries.
|
|
180
|
+
|
|
181
|
+
More information about this community can be found [here](community/README.md).
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "ThreeWToolkit"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "A modular and open-source AI toolkit for time-series processing, aimed at fault detection and classification in oil well operation"
|
|
5
|
+
readme = { file = "toolkit/ThreeWToolkit/README.md", content-type = "text/markdown" }
|
|
6
|
+
license = { text = "Apache-2.0" }
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Ricardo Emanuel Vaz Vargas", email = "ricardo.vargas@petrobras.com.br" },
|
|
9
|
+
]
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"numpy>=1.26.4",
|
|
13
|
+
"scipy>=1.15.2",
|
|
14
|
+
"pandas>=2.2.3",
|
|
15
|
+
"scikit-learn>=1.6.1",
|
|
16
|
+
"matplotlib>=3.10.1",
|
|
17
|
+
"seaborn>=0.13.2",
|
|
18
|
+
"plotly>=6.0.0",
|
|
19
|
+
"imbalanced-learn>=0.13.0",
|
|
20
|
+
"ipykernel>=6.29.5",
|
|
21
|
+
"ipywidgets==8.1.7",
|
|
22
|
+
"jupyter-client==8.6.3",
|
|
23
|
+
"jupyter-core==5.8.1",
|
|
24
|
+
"Pillow>=11.0.0",
|
|
25
|
+
"scikit-image>=0.25.2",
|
|
26
|
+
"torch>=2.7.0",
|
|
27
|
+
"torchvision>=0.22.0",
|
|
28
|
+
"torchmetrics>=1.6.2",
|
|
29
|
+
"timm>=1.0.15",
|
|
30
|
+
"tqdm>=4.67.1",
|
|
31
|
+
"pydantic>=2.11",
|
|
32
|
+
"PyWavelets>=1.8.0",
|
|
33
|
+
"pyarrow>=20.0.0",
|
|
34
|
+
"pylatex>=1.4.2",
|
|
35
|
+
"statsmodels>=0.14.5",
|
|
36
|
+
"requests<=2.35.5",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"black>=25.9.0",
|
|
42
|
+
"mypy>=1.16.0",
|
|
43
|
+
"flake8",
|
|
44
|
+
"jupyter",
|
|
45
|
+
"ruff>=0.12.2",
|
|
46
|
+
"uv",
|
|
47
|
+
"types-requests>=2.32.4.20250611",
|
|
48
|
+
"coverage>=7.8.1",
|
|
49
|
+
"pytest>=8.3.5",
|
|
50
|
+
"pytest-mock>=3.14.1",
|
|
51
|
+
]
|
|
52
|
+
docs = [
|
|
53
|
+
"mkdocs",
|
|
54
|
+
"mkdocstrings[python]",
|
|
55
|
+
"sphinx",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
[tool.setuptools.packages.find]
|
|
59
|
+
where = ["toolkit"]
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.exclude-package-data]
|
|
62
|
+
"*" = ["dataset/*"]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
[build-system]
|
|
66
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
67
|
+
build-backend = "setuptools.build_meta"
|
|
68
|
+
|
|
69
|
+
[tool.coverage.run]
|
|
70
|
+
source = ["toolkit/"]
|
|
71
|
+
branch = true
|
|
72
|
+
omit = ["*/__init__.py"]
|
|
73
|
+
|
|
74
|
+
[tool.coverage.report]
|
|
75
|
+
show_missing = true
|
|
76
|
+
|
|
77
|
+
[tool.ruff]
|
|
78
|
+
line-length = 88
|
|
79
|
+
|
|
80
|
+
[tool.ruff.format]
|
|
81
|
+
quote-style = "double"
|
|
82
|
+
|
|
83
|
+
[tool.mypy]
|
|
84
|
+
python_version = "3.10"
|
|
85
|
+
mypy_path = "toolkit/"
|
|
86
|
+
ignore_missing_imports = true
|
|
87
|
+
|