"""
Define variables needed to run the application.
This module also defines the ``limits`` dictionary,
that uses the ``limits_file`` to define the optimization
problem boundaries.
The ``limits`` dictionary defines the boundaries and operators
for each constraint that's generated using the regression
model coefficients and intercepts.
Notes
-----
- The ``limits`` dictionary defines the operators for some
constraints as `"LT"` (less than), `"GT"` (greater than).
These operators, however, aren't supported by PuLP,
and are replaced by `"LTE"` (less than or equal to) and
`"GTE"` (greater than or equal to) respectively.
This replacement isn't clearly stated in the code and
is performed by some obscure function.
"""
from datetime import datetime
from pathlib import Path
from typing import Dict
from typing import List
import numpy as np
import pandas as pd
from wip.utils import find_filepath
from wip.utils import is_running_on_databricks
US_SUFIX = '08'
SOLVER_PATH = f'us{US_SUFIX}'.replace('0', '')
LOWER_RANGE = 700
UPPER_RANGE = 1000
RANGE_STEP = 50
USE_FLOTICOR = False
if is_running_on_databricks():
LOGS_PATH = Path("../../logs")
LOGS_PATH.mkdir(exist_ok=True, parents=True)
LOGS_FILEPATH = LOGS_PATH.joinpath("runtime.log")
ADLS_ACCOUNT_NAME = 'usazu1valesa001'
ADLS_CONTAINER_NAME = 'insight'
ADLS_DATA_FOLDER = (
'Workarea/Pelletizing/Process_Optimization/Usina08/preprocessamento'
)
DATA_FOLDER_PATH = (
f'abfss://{ADLS_CONTAINER_NAME}@{ADLS_ACCOUNT_NAME}.dfs.core.windows.net/'
f'{ADLS_DATA_FOLDER}/'
)
DATASETS_FILEPATH = (
f"{DATA_FOLDER_PATH}datasets/"
f"{datetime.today().strftime('%Y-%m-%d')}/datasets.joblib"
)
DF_SQL_FILEPATH = (
f"{DATA_FOLDER_PATH}df_sql/"
f"{datetime.today().strftime('%Y-%m-%d')}/df_sql.joblib"
)
ADLS_OUTPUTS_FOLDER = 'Workarea/Pelletizing/Process_Optimization/Usina08/Otimizacao'
OUTPUTS_FOLDER_PATH = (
f'abfss://{ADLS_CONTAINER_NAME}@{ADLS_ACCOUNT_NAME}.dfs.core.windows.net/'
f'{ADLS_OUTPUTS_FOLDER}/'
)
DATA_CHECKS_FOLDER_PATH = OUTPUTS_FOLDER_PATH
DATASETS_CLEAN_FILEPATH = f"{OUTPUTS_FOLDER_PATH}datasets_after_cleaning.joblib"
DF_SQL_CLEAN_FILEPATH = f"{OUTPUTS_FOLDER_PATH}df_sql_after_cleaning.joblib"
MODELS_RESULTS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}models_results.joblib"
MODELS_COEFICIENTS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}models_coeficients.joblib"
MODELS_FEATURES_FILEPATH = f"{OUTPUTS_FOLDER_PATH}models_features.joblib"
SCALERS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}scalers.joblib"
LIMITS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}limits.joblib"
FINAL_DATASETS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}datasets.joblib"
OTM_OUTPUTS_FOLDER_PATH = f"{OUTPUTS_FOLDER_PATH}Dependencias_Otimizacao/"
MODELS_KPIS_FILEPATH = f"{OUTPUTS_FOLDER_PATH}regression_models_kpis.csv"
RESULTADO_OTIMIZADOR_FILENAME = (
f"resultado_otimizador-US{US_SUFIX}_{datetime.today().strftime('%Y-%m-%d')}.csv"
)
else:
PROJECT_ROOT_PATH = find_filepath("peloptimize")
LOGS_PATH = PROJECT_ROOT_PATH.joinpath("logs")
LOGS_PATH.mkdir(exist_ok=True, parents=True)
DATA_FOLDER_PATH = PROJECT_ROOT_PATH.joinpath("data")
DATA_FOLDER_PATH.mkdir(exist_ok=True, parents=True)
OUTPUTS_FOLDER_PATH = PROJECT_ROOT_PATH.joinpath("outputs/predictive_models")
OUTPUTS_FOLDER_PATH.mkdir(exist_ok=True, parents=True)
OTM_OUTPUTS_FOLDER_PATH = PROJECT_ROOT_PATH.joinpath(
f"outputs/resultados_modelos_preditivos/{SOLVER_PATH}"
)
OTM_OUTPUTS_FOLDER_PATH.mkdir(exist_ok=True, parents=True)
DATA_CHECKS_FOLDER_PATH = PROJECT_ROOT_PATH.joinpath("outputs/errors")
DATA_CHECKS_FOLDER_PATH.mkdir(exist_ok=True, parents=True)
DATASETS_CLEAN_FILEPATH = DATA_CHECKS_FOLDER_PATH.joinpath(
"datasets_after_cleaning.joblib"
)
DF_SQL_CLEAN_FILEPATH = DATA_CHECKS_FOLDER_PATH.joinpath(
"df_sql_after_cleaning.joblib"
)
DATASETS_FILEPATH = DATA_FOLDER_PATH.joinpath("datasets.joblib")
DF_SQL_FILEPATH = DATA_FOLDER_PATH.joinpath("df_sql.joblib")
MODELS_RESULTS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("models_results.joblib")
MODELS_COEFICIENTS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath(
"models_coeficients.joblib"
)
MODELS_FEATURES_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("models_features.joblib")
SCALERS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("scalers.joblib")
LIMITS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("limits.joblib")
FINAL_DATASETS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("datasets.joblib")
MODELS_KPIS_FILEPATH = OUTPUTS_FOLDER_PATH.joinpath("regression_models_kpis.csv")
RESULTADO_OTIMIZADOR_FILENAME = (
f"resultado_otimizador-US{US_SUFIX}_"
f"{datetime.today().strftime('%Y-%m-%d')}.xlsx"
)
LOGS_FILEPATH = LOGS_PATH.joinpath("runtime.log")
limits = {
"abrasao": None,
"cfix": None,
"finos": None,
"taxarp": None,
"temp_forno": None,
"basicidade": None,
"compressao": None,
"distribuicao gran": None,
"particulados1": None,
"particulados2": None,
"particulados3": None,
"energia_forno": None,
"gas": None,
"energia_prensa": None,
"umidade": None,
"GRAN PR": None,
"SE PR": None,
"SUP_SE_PP": None,
"custo_GRAN PR": None,
"custo_SE PP": None,
"custo_SE PR": None,
"dens_moinho_1": None,
"dens_moinho_2": None,
"dens_moinho_3": None,
"energia_moinho": None,
"produtividade filtragem": None,
"relacao gran": None,
"temp_precipitador": None,
"temp_recirc": None,
}
# Dicionário BIG_M_LIMITS é utilizado para definir as restrições
# do módulo `big_m_constraints.py`
BIG_M_LIMITS = {"media_temperatura_pq": {"min": 50, "max": 200}}
# If set to True, then sets a secondary objective to find the smallest temperatures
# possible without impacting the primary objective of variable cost reduction.
MULTI_OBJECTIVE = False
critical_cols_dict = {
# "VAZA3_I@08QU-ST-855I-01": {"lmin": 7, "lmax": 14},
# "abrasao": {"lmin": 4.5, "lmax": 5.5},
"QUIM_CFIX_PP_L@08PR": {"lmin": 1.15, "lmax": 1.40},
"COMP_MCOMP_PQ_L@08QU": {"lmin": 270, "lmax": 1_000},
"compressao": {"lmin": 270, "lmax": 1_000},
"abrasao": {"lmin": 0, "lmax": 5.5},
"cfix": {"lmin": 1.15, "lmax": 1.40},
"SE PP": {"lmin": 1200, "lmax": 2060},
"finos": {"lmin": 0.70, "lmax": 2},
"taxarp": {"lmin": 10, "lmax": 35},
"temp_forno": {"lmin": 60, "lmax": 180},
"basicidade": {"lmin": 0.95, "lmax": 1.15},
"distribuicao gran": {"lmin": 95, "lmax": 10000},
"particulados1": {"lmin": 0, "lmax": 45},
"particulados2": {"lmin": 0, "lmax": 45},
"particulados3": {"lmin": 0, "lmax": 45},
"energia_forno": {"lmin": 14, "lmax": 20},
# "gas": {"lmin": 0, "lmax": 20},
"energia_prensa": {"lmin": 2, "lmax": 20},
"PRES7_I@08QU-HO-851I-01": {
700: {"lmin": 8.00, "lmax": 28.81},
750: {"lmin": 8.35, "lmax": 28.99},
800: {"lmin": 11.84, "lmax": 38.96},
850: {"lmin": 11.84, "lmax": 44.92},
900: {"lmin": 11.84, "lmax": 52.7},
950: {"lmin": 11.84, "lmax": 54.16},
},
"TEMP1_I@08QU-QU-855I-GQ04": {
700: {"lmin": 750, "lmax": 990},
750: {"lmin": 860, "lmax": 1100},
800: {"lmin": 860, "lmax": 1100},
850: {"lmin": 860, "lmax": 1100},
900: {"lmin": 860, "lmax": 1100},
950: {"lmin": 860, "lmax": 1100},
},
"TEMP1_I@08QU-QU-855I-GQ05": {
700: {"lmin": 860, "lmax": 1100},
750: {"lmin": 1060, "lmax": 1300},
800: {"lmin": 1060, "lmax": 1300},
850: {"lmin": 1060, "lmax": 1300},
900: {"lmin": 1060, "lmax": 1300},
950: {"lmin": 1060, "lmax": 1300},
},
"TEMP1_I@08QU-QU-855I-GQ06": {
700: {"lmin": 900, "lmax": 1140},
750: {"lmin": 1060, "lmax": 1300},
800: {"lmin": 1060, "lmax": 1300},
850: {"lmin": 1060, "lmax": 1300},
900: {"lmin": 1060, "lmax": 1300},
950: {"lmin": 1060, "lmax": 1300},
},
"TEMP1_I@08QU-QU-855I-GQ07": {
700: {"lmin": 960, "lmax": 1200},
750: {"lmin": 1160, "lmax": 1400},
800: {"lmin": 1160, "lmax": 1400},
850: {"lmin": 1160, "lmax": 1400},
900: {"lmin": 1160, "lmax": 1400},
950: {"lmin": 1160, "lmax": 1400},
},
"TEMP1_I@08QU-QU-855I-GQ08": {
700: {"lmin": 1060, "lmax": 1300},
750: {"lmin": 1210, "lmax": 1450},
800: {"lmin": 1210, "lmax": 1450},
850: {"lmin": 1210, "lmax": 1450},
900: {"lmin": 1210, "lmax": 1450},
950: {"lmin": 1210, "lmax": 1450},
},
"TEMP1_I@08QU-QU-855I-GQ09": {
700: {"lmin": 1200, "lmax": 1260},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ10": {
700: {"lmin": 1210, "lmax": 1270},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ11": {
700: {"lmin": 1210, "lmax": 1270},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ12": {
700: {"lmin": 1210, "lmax": 1270},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ13": {
700: {"lmin": 1210, "lmax": 1270},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ14": {
700: {"lmin": 1210, "lmax": 1270},
750: {"lmin": 1300, "lmax": 1360},
800: {"lmin": 1300, "lmax": 1360},
850: {"lmin": 1300, "lmax": 1360},
900: {"lmin": 1300, "lmax": 1360},
950: {"lmin": 1300, "lmax": 1360},
},
"TEMP1_I@08QU-QU-855I-GQ15": {
700: {"lmin": 1120, "lmax": 1360},
750: {"lmin": 1210, "lmax": 1450},
800: {"lmin": 1210, "lmax": 1450},
850: {"lmin": 1210, "lmax": 1450},
900: {"lmin": 1210, "lmax": 1450},
950: {"lmin": 1210, "lmax": 1450},
},
"TEMP1_I@08QU-QU-855I-GQ16": {
700: {"lmin": 1120, "lmax": 1360},
750: {"lmin": 1210, "lmax": 1450},
800: {"lmin": 1210, "lmax": 1450},
850: {"lmin": 1210, "lmax": 1450},
900: {"lmin": 1210, "lmax": 1450},
950: {"lmin": 1210, "lmax": 1450},
},
# ==========================================================================
"rota_disco_1": {"lmin": 9, "lmax": 16},
"rota_disco_2": {"lmin": 9, "lmax": 16},
"rota_disco_3": {"lmin": 9, "lmax": 16},
"rota_disco_4": {"lmin": 9, "lmax": 16},
"rota_disco_5": {"lmin": 9, "lmax": 16},
"rota_disco_6": {"lmin": 9, "lmax": 16},
"rota_disco_7": {"lmin": 9, "lmax": 16},
"rota_disco_8": {"lmin": 9, "lmax": 16},
"rota_disco_9": {"lmin": 9, "lmax": 16},
"rota_disco_10": {"lmin": 9, "lmax": 16},
"rota_disco_11": {"lmin": 9, "lmax": 16},
"rota_disco_12": {"lmin": 9, "lmax": 16},
# Tags de rotação dos discos de pelotamento 01 ao 12
"ROTA1_I@08PE-BD-840I-01M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-02M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-03M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-04M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-05M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-06M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-07M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-08M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-09M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-10M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-11M1": {"lmin": 0, "lmax": 6.7},
"ROTA1_I@08PE-BD-840I-12M1": {"lmin": 0, "lmax": 6.7},
# Tags de rotação dos filtros 01 ao 10
# "ROTA1_I@08FI-FL-827I-01M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-02M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-03M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-04M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-05RM1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-06M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-07M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-08M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-09M1": {"lmin": 0.70, "lmax": 0.92},
# "ROTA1_I@08FI-FL-827I-10RM1": {"lmin": 0.70, "lmax": 0.92},
"SE PR": {"lmin": 1600, "lmax": 1800}, # 1700 ±100 cm²/g
"GRAN PR": {"lmin": 65, "lmax": 100},
"PRES2_I@08PR-RP-822I-01": {"lmin": 50, "lmax": 120},
"PRES3_I@08PR-RP-822I-01": {"lmin": 50, "lmax": 120},
"floticor": {"lmin": 0, "lmax": 4.99},
"umidade": {"lmin": 2.80, "lmax": 3.40},
# "dens_moinho_1": {"lmin": 2.85, "lmax": 2.95},
# "dens_moinho_2": {"lmin": 2.85, "lmax": 2.95},
# "dens_moinho_3": {"lmin": 2.85, "lmax": 2.95},
# == Test ==================================================================
# "DENS1_C@08MO-MO-821I-02": {"lmin": 1, "lmax": 4},
# "DENS1_C@08MO-MO-821I-03": {"lmin": 1, "lmax": 4},
}
tags_rota_disco = [
"rota_disco_1",
"rota_disco_2",
"rota_disco_3",
"rota_disco_4",
"rota_disco_5",
"rota_disco_6",
"rota_disco_7",
"rota_disco_8",
"rota_disco_9",
"rota_disco_10",
"rota_disco_11",
"rota_disco_12",
]
tags_ventiladores = [
"PEVT_PF852I05_M1_PIT_OCS_CDV_09a12",
"PRES1_C@08QU-PF-852I-04M1",
"PRES1_I@08QU-DU-853I-12",
"PRES2_C@08QU-PF-852I-03M1",
"PRES1_I@08QU-WB-851I-19",
"PRES1_I@08QU-WB-851I-21",
"TEMP1_C@08QU-PF-852I-02M1",
"TEMP1_C@08QU-PF-852I-05M1",
"TEMP1_I@08PN-TR-860I-02",
"TEMP1_I@08QU-HO-851I-01",
]
[docs]def _additional_features(_limits: dict) -> dict:
"""Add additional features to the optimization problem boundaries.
Parameters
----------
_limits : dict
Dictionary with limit names as keys and either `None`
or some iterable of two elements as values.
Returns
-------
Dict[str, Tuple[str, float]]
Dictionary with the additional features added.
"""
features = {
"custo_abrasao": "abrasao",
"custo_compressao": "compressao",
"custo_distribuicao gran": "distribuicao gran",
}
for feature, value in features.items():
_limits[feature] = _limits[value]
return _limits
[docs]def _read_limits(_limits):
"""
Process the input dictionary into a suitable format for further use.
This static method reads a dictionary where the keys are limit names,
and the values are either `None` or some iterable with two elements.
If the value isn't `None`, it gets converted into a `tuple`;
otherwise, it remains `None`.
Parameters
----------
_limits : dict
Dictionary with limit names as keys and either
`None` or some iterable of two elements as values.
Returns
-------
dict
Processed dictionary where the values have been
converted into tuples if they were not None.
Notes
-----
This method is designed to be used internally by the class,
hence the underscore (``_``) prefix in the method name.
Examples
--------
>>> _read_limits({'x': [1, 2], 'y': None})
{'x': (1, 2), 'y': None}
"""
return {key: tuple(value) if value else value for key, value in _limits.items()}
[docs]def define_targets(datasets: Dict[str, pd.DataFrame]) -> List[str]:
"""
Return list of values to consider as the model's targets.
The Method assumes that the last column of each dataframe
from :param:`datasets` as the target.
Parameters
----------
datasets : Dict[str, pd.DataFrame]
Dictionary with the datasets to retrieve the targets from.
Returns
-------
list
The list of target column names.
"""
return [df.columns[-1] for df in datasets.values()]
[docs]def _scaling_limits(_limits, tags):
"""Normalize tag values using ``np.log``.
Parameters
----------
_limits : dict
Dictionary with the optimization problem boundaries.
tags : List[str]
List of tags to normalize.
"""
for tag in tags:
tag_limits = _limits[tag]
if isinstance(tag_limits, (list, tuple)):
_limits[tag] = (tag_limits[0], np.log(tag_limits[1]))
return _limits
[docs]class Constants: # pylint: disable=too-few-public-methods
"""Define optimization problem constants"""
# Same as: [(750, 800), (800, 850), (850, 900), (900, 950), (950, 1000)]
# Attribute represents the production ranges to create the optimization
# problems to.
production_range = [
(prod_range, prod_range + 50)
for prod_range in range(LOWER_RANGE, UPPER_RANGE, RANGE_STEP)
]
tags_to_scale = [
"compressao",
"particulados1",
"particulados2",
"particulados3",
"custo_compressao",
]
LIMITS = _read_limits(limits)
LIMITS = _additional_features(LIMITS)
LIMITS = _scaling_limits(LIMITS, tags_to_scale)
# tags that are target in one model and descriptive feature in other old tag_2_var
_POWER_TOKEN = "Consumo de Energia (base minério úmido) kWh/ton"
TARGETS_IN_MODEL = {
'Media_temp': 'temp_forno',
"floticor": "floticor",
"TAXA1_Y@08PN-TR-860I-09M1": "finos",
"SUP_SE_PP_L@08PR": "SE PP",
"SUP_SE_PR_L@08FI": "SE PR",
"GRAN_-0,045_PR_L@08FI": "GRAN PR",
"VAZA3_I@08QU-ST-855I-01": "gas",
"Consumo de Energia (base minério úmido) kWh/ton": "energia_moinho",
"CONS EE PRENSA - US8": "energia_prensa",
"CONS ESP VENT TOTAL - US8": "energia_forno",
"TEMP1_I@08QU-HO-851I-01": "temp_recirc",
"QUIM_CFIX_PP_L@08PR": "cfix",
"CONS1_Y@08FI-BV-827I": "umidade",
"COMP_MCOMP_PQ_L@08QU": "compressao",
"ABRA_-0,5_PQ_L@08QU": "abrasao",
"PARTIC_I@08QU-CH-854I-01": "particulados1",
"PARTIC_I@08QU-CH-854I-02": "particulados2",
"PARTIC_I@08QU-CH-854I-03": "particulados3",
"RETO1_Y@08PE": "taxarp",
# 'CALC1_Y@08FI-FD00': 'produtividade filtragem',
"QUIM_BAS2_PQ_L@08QU": "basicidade",
"rel_gran": "relacao gran",
**{f"GRAN_OCS_TM@08PE-BD-840I-{i:02}": f"rota_disco_{i}" for i in range(1, 13)},
# **{f'ROTA1_I@08PE-BD-840I-{i:02}M1': f'rota_disco_{i}' for i in range(1, 13)},
# **{f'DENS1_C@08MO-MO-821I-{i:02}': f'dens_moinho_{i}' for i in range(1, 4)},
}
INVERSE_TARGETS_IN_MODEL = {value: key for key, value in TARGETS_IN_MODEL.items()}
OBJ_FUNC_COEF = [
# 'Calculo da Energia da Filtragem',
"antracito",
"bentonita",
"floticor",
"calcario",
"corpo_moedor_especifico",
"energia_forno",
"energia_moinho",
"energia_prensa",
"gas",
"umidade",
]
constants = Constants()
# The tags listed below will be used to apply the
# function `wip.datatools.filter_quantile_datasets`.
# This function filters the datasets that contain the specified tag
# names, removing values outside the tag's 2nd and 98th percentiles.
TAGS_TO_REMOVE_OUTLIERS = ["corpo_moedor_especifico"]
MEDIA_TEMP_PRES = {
"media press 1": [
"PRES1_I@08QU-WB-851I-01",
"PRES1_I@08QU-WB-851I-02",
"PRES1_I@08QU-WB-851I-03A",
],
"media press 2": [
"PRES1_I@08QU-WB-851I-03B",
"PRES1_I@08QU-WB-851I-04",
"PRES1_I@08QU-WB-851I-05",
"PRES1_I@08QU-WB-851I-06",
],
"media press 3": [
"PRES1_I@08QU-WB-851I-06",
"PRES1_I@08QU-WB-851I-07",
"PRES1_I@08QU-WB-851I-08",
"PRES1_I@08QU-WB-851I-09",
],
"media press 4": [
"PRES1_I@08QU-WB-851I-09",
"PRES1_I@08QU-WB-851I-10",
"PRES1_I@08QU-WB-851I-11",
"PRES1_I@08QU-WB-851I-12",
"PRES1_I@08QU-WB-851I-13",
"PRES1_I@08QU-WB-851I-14",
"PRES1_I@08QU-WB-851I-15",
"PRES1_I@08QU-WB-851I-16",
"PRES1_I@08QU-WB-851I-17",
"PRES1_I@08QU-WB-851I-18",
"PRES1_I@08QU-WB-851I-19",
],
"media temp 1": [
"TEMP1_I@08QU-WB-851I-01",
"TEMP1_I@08QU-WB-851I-02",
"TEMP1_I@08QU-WB-851I-03",
],
"media temp 2": [
"TEMP1_I@08QU-WB-851I-03B",
"TEMP1_I@08QU-WB-851I-04",
"TEMP1_I@08QU-WB-851I-05",
"TEMP1_I@08QU-WB-851I-06",
],
"media temp 3": [
"TEMP1_I@08QU-WB-851I-06",
"TEMP1_I@08QU-WB-851I-07",
"TEMP1_I@08QU-WB-851I-08",
"TEMP1_I@08QU-WB-851I-09",
],
"media temp 4": [
"TEMP1_I@08QU-WB-851I-09",
"TEMP1_I@08QU-WB-851I-10",
"TEMP1_I@08QU-WB-851I-11",
"TEMP1_I@08QU-WB-851I-12",
"TEMP1_I@08QU-WB-851I-13",
"TEMP1_I@08QU-WB-851I-14",
"TEMP1_I@08QU-WB-851I-15",
"TEMP1_I@08QU-WB-851I-16",
"TEMP1_I@08QU-WB-851I-17",
"TEMP1_I@08QU-WB-851I-18",
"TEMP1_I@08QU-WB-851I-19",
"TEMP1_I@08QU-WB-851I-20",
],
}
FILTERS_FUNC_TAGS = [
"FUNC1_D@08FI-FL-827I-01",
"FUNC1_D@08FI-FL-827I-02",
"FUNC1_D@08FI-FL-827I-03",
"FUNC1_D@08FI-FL-827I-04",
"FUNC1_D@08FI-FL-827I-05R",
"FUNC1_D@08FI-FL-827I-06",
"FUNC1_D@08FI-FL-827I-07",
"FUNC1_D@08FI-FL-827I-08",
"FUNC1_D@08FI-FL-827I-09",
"FUNC1_D@08FI-FL-827I-10R",
]
ROTA_FILTERS_TAGS = [
"ROTA1_I@08FI-FL-827I-01M1",
"ROTA1_I@08FI-FL-827I-02M1",
"ROTA1_I@08FI-FL-827I-03M1",
"ROTA1_I@08FI-FL-827I-04M1",
"ROTA1_I@08FI-FL-827I-05RM1",
"ROTA1_I@08FI-FL-827I-06M1",
"ROTA1_I@08FI-FL-827I-07M1",
"ROTA1_I@08FI-FL-827I-08M1",
"ROTA1_I@08FI-FL-827I-09M1",
"ROTA1_I@08FI-FL-827I-10RM1",
]
FUNC_VACUUM_BOMBS = [
"FUNC1_D@08FI-BV-827I-01M1",
"FUNC1_D@08FI-BV-827I-02M1",
"FUNC1_D@08FI-BV-827I-03M1",
"FUNC1_D@08FI-BV-827I-04M1",
"FUNC1_D@08FI-BV-827I-05RM1",
"FUNC1_D@08FI-BV-827I-06M1",
"FUNC1_D@08FI-BV-827I-07M1",
"FUNC1_D@08FI-BV-827I-08M1",
"FUNC1_D@08FI-BV-827I-09M1",
"FUNC1_D@08FI-BV-827I-10RM1",
]