sarapy 2.1.0__py3-none-any.whl → 2.2.0__py3-none-any.whl
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.
- sarapy/dataProcessing/OpsProcessor.py +7 -4
- sarapy/mlProcessors/PlantinFMCreator.py +8 -11
- sarapy/preprocessing/TransformInputData.py +2 -2
- sarapy/preprocessing/TransformToOutputData.py +6 -6
- sarapy/version.py +1 -1
- {sarapy-2.1.0.dist-info → sarapy-2.2.0.dist-info}/METADATA +9 -1
- {sarapy-2.1.0.dist-info → sarapy-2.2.0.dist-info}/RECORD +10 -10
- {sarapy-2.1.0.dist-info → sarapy-2.2.0.dist-info}/LICENCE +0 -0
- {sarapy-2.1.0.dist-info → sarapy-2.2.0.dist-info}/WHEEL +0 -0
- {sarapy-2.1.0.dist-info → sarapy-2.2.0.dist-info}/top_level.txt +0 -0
|
@@ -305,7 +305,7 @@ if __name__ == "__main__":
|
|
|
305
305
|
import logging
|
|
306
306
|
|
|
307
307
|
|
|
308
|
-
historical_data_path = "examples
|
|
308
|
+
historical_data_path = "examples\\2025-08-04 copy\\UPM008N\\historical-data.json"
|
|
309
309
|
with open(historical_data_path, 'r') as file:
|
|
310
310
|
samples = json.load(file)
|
|
311
311
|
|
|
@@ -313,6 +313,9 @@ if __name__ == "__main__":
|
|
|
313
313
|
|
|
314
314
|
op = OpsProcessor(classifier_file='modelos\\pipeline_rf.pkl', imputeDistances = False,
|
|
315
315
|
regresor_file='modelos\\regresor.pkl', poly_features_file='modelos\\poly_features.pkl')
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
|
|
317
|
+
ops_clasificadas = op.processOperations(samples)
|
|
318
|
+
df_ops_clasificadas = pd.DataFrame(ops_clasificadas)
|
|
319
|
+
|
|
320
|
+
print(df_ops_clasificadas.describe())
|
|
321
|
+
|
|
@@ -20,7 +20,7 @@ class PlantinFMCreator(BaseEstimator, TransformerMixin):
|
|
|
20
20
|
|
|
21
21
|
def __init__(self, imputeDistances = True, distanciaMedia:float = 1.8,
|
|
22
22
|
umbral_precision:float = 0.3, dist_mismo_lugar = 0.0, max_dist = 100,
|
|
23
|
-
umbral_ratio_dCdP:float = 0.5, deltaO_medio = 4):
|
|
23
|
+
umbral_ratio_dCdP:float = 0.5, deltaO_medio = 4, baseDeltaP = 10):
|
|
24
24
|
"""Inicializa la clase FMCreator.
|
|
25
25
|
|
|
26
26
|
Args:
|
|
@@ -39,6 +39,7 @@ class PlantinFMCreator(BaseEstimator, TransformerMixin):
|
|
|
39
39
|
self.max_dist = max_dist
|
|
40
40
|
self.umbral_ratio_dCdP = umbral_ratio_dCdP
|
|
41
41
|
self.deltaO_medio = deltaO_medio
|
|
42
|
+
self.baseDeltaP = baseDeltaP
|
|
42
43
|
|
|
43
44
|
##creamos un diccionario para saber la posición de cada dato dentro del array devuelto por transform()
|
|
44
45
|
self._dataPositions = {"DST_PT": 0, "deltaO": 2, "ratio_dCdP": 3, "distances": 4}
|
|
@@ -74,12 +75,12 @@ class PlantinFMCreator(BaseEstimator, TransformerMixin):
|
|
|
74
75
|
|
|
75
76
|
|
|
76
77
|
date_oprc = self.tlmDataProcessor["date_oprc",:] #datos de fecha y hora de operación
|
|
77
|
-
time_ac = self.tlmDataProcessor["TIME_AC",:] #datos de fecha y hora de operación en formato timestamp
|
|
78
|
+
time_ac = self.tlmDataProcessor["TIME_AC",:]/self.baseDeltaP #datos de fecha y hora de operación en formato timestamp
|
|
78
79
|
lats = self.tlmDataProcessor["latitud",:] #latitudes de las operaciones
|
|
79
80
|
longs = self.tlmDataProcessor["longitud",:] #longitudes de las operaciones
|
|
80
81
|
self.dst_pt = self.tlmDataProcessor["SC_PT",:] #distorsión del plantín
|
|
81
82
|
self.inest_pt = self.tlmDataProcessor["INST_PT",:] #inest
|
|
82
|
-
|
|
83
|
+
|
|
83
84
|
|
|
84
85
|
##***** OBTENEMOS LOS DATOS PARA FITEAR LOS OBJETOS Y ASÍ PROCESAR LA FM *****
|
|
85
86
|
|
|
@@ -87,7 +88,8 @@ class PlantinFMCreator(BaseEstimator, TransformerMixin):
|
|
|
87
88
|
timeData = np.hstack((date_oprc.reshape(-1,1),time_ac.reshape(-1, 1)))
|
|
88
89
|
|
|
89
90
|
self._timeDeltas = timeProcessor.fit_transform(timeData)
|
|
90
|
-
|
|
91
|
+
# print(np.median(self._timeDeltas[:,tpDP["ratio_dCdP"]]))
|
|
92
|
+
|
|
91
93
|
##fitteamos geoprocessor con las latitudes y longitudes
|
|
92
94
|
points = np.hstack((lats.reshape(-1,1),longs.reshape(-1,1)))
|
|
93
95
|
self._distances = geoprocessor.fit_transform(points)
|
|
@@ -113,11 +115,6 @@ class PlantinFMCreator(BaseEstimator, TransformerMixin):
|
|
|
113
115
|
self.fit(X)
|
|
114
116
|
return self.transform(X)
|
|
115
117
|
|
|
116
|
-
# @property
|
|
117
|
-
# def tlmExtracted(self):
|
|
118
|
-
# """Devuelve los datos de telemetría extraídos."""
|
|
119
|
-
# return self.tlmExtracted
|
|
120
|
-
|
|
121
118
|
@property
|
|
122
119
|
def tlmdeDP(self):
|
|
123
120
|
"""Devuelve el diccionario con la posición de los datos dentro del array devuelto por transform()."""
|
|
@@ -144,7 +141,7 @@ if __name__ == "__main__":
|
|
|
144
141
|
import json
|
|
145
142
|
from sarapy.preprocessing import TransformInputData
|
|
146
143
|
|
|
147
|
-
historical_data_path = "examples
|
|
144
|
+
historical_data_path = "examples\\2025-08-04\\UPM003N\\historical-data.json"
|
|
148
145
|
with open(historical_data_path, 'r') as file:
|
|
149
146
|
historical_data = json.load(file)
|
|
150
147
|
df = pd.DataFrame(historical_data)
|
|
@@ -157,4 +154,4 @@ if __name__ == "__main__":
|
|
|
157
154
|
fmcreator = PlantinFMCreator(imputeDistances=False)
|
|
158
155
|
|
|
159
156
|
fm, dst_pt, inest_pt = fmcreator.fit_transform(X)
|
|
160
|
-
print(
|
|
157
|
+
print(np.median(fm,axis=0))
|
|
@@ -137,7 +137,7 @@ if __name__ == "__main__":
|
|
|
137
137
|
import pandas as pd
|
|
138
138
|
import json
|
|
139
139
|
|
|
140
|
-
historical_data_path = "examples
|
|
140
|
+
historical_data_path = "examples\\2025-08-04\\UPM006N\\historical-data.json"
|
|
141
141
|
with open(historical_data_path, 'r') as file:
|
|
142
142
|
historical_data = json.load(file)
|
|
143
143
|
df = pd.DataFrame(historical_data)
|
|
@@ -146,4 +146,4 @@ if __name__ == "__main__":
|
|
|
146
146
|
data_positions = json.load(open("sarapy/preprocessing/telemetriaDataPosition.json", 'r'))
|
|
147
147
|
transform_input_data = TransformInputData()
|
|
148
148
|
transformed_data = transform_input_data.transform(historical_data)
|
|
149
|
-
print(transformed_data[
|
|
149
|
+
print(transformed_data[:2])
|
|
@@ -10,7 +10,7 @@ class TransformToOutputData(BaseEstimator, TransformerMixin):
|
|
|
10
10
|
- dataToTransform: array con los datos de las operaciones clasificadas.
|
|
11
11
|
Actualmente el array de dataToTransform es de (n,5) con las columnas siguientes
|
|
12
12
|
|
|
13
|
-
- 0:
|
|
13
|
+
- 0: timestamp
|
|
14
14
|
- 1: tag_seedling
|
|
15
15
|
- 2: tag_fertilizer
|
|
16
16
|
Returns:
|
|
@@ -32,15 +32,15 @@ class TransformToOutputData(BaseEstimator, TransformerMixin):
|
|
|
32
32
|
- X: array con los datos de las operaciones clasificadas.
|
|
33
33
|
Actualmente el array de dataToTransform es de (n,5) con las columnas siguientes
|
|
34
34
|
|
|
35
|
-
- 0:
|
|
35
|
+
- 0: timestamp
|
|
36
36
|
- 1: tag_seedling
|
|
37
37
|
- 2: tag_fertilizer
|
|
38
38
|
"""
|
|
39
39
|
self.is_fitted = True
|
|
40
|
-
keys = ["
|
|
40
|
+
keys = ["timestamp","tag_seedling", "tag_fertilizer"]
|
|
41
41
|
self.temp_df = pd.DataFrame(X, columns = keys)
|
|
42
42
|
|
|
43
|
-
##convierto las columnas "
|
|
43
|
+
##convierto las columnas "timestamp", "tag_seedling" a int
|
|
44
44
|
for col in ["tag_seedling"]:
|
|
45
45
|
self.temp_df[col] = self.temp_df[col].astype(float).astype(int)
|
|
46
46
|
##convierto la columna "tag_fertilizer" a float de y redondeo a 3 decimales
|
|
@@ -54,7 +54,7 @@ class TransformToOutputData(BaseEstimator, TransformerMixin):
|
|
|
54
54
|
- X: array con los datos de las operaciones clasificadas.
|
|
55
55
|
Actualmente el array de dataToTransform es de (n,5) con las columnas siguientes
|
|
56
56
|
|
|
57
|
-
- 0:
|
|
57
|
+
- 0: timestamp
|
|
58
58
|
- 1: tag_seedling
|
|
59
59
|
- 2: tag_fertilizer
|
|
60
60
|
Returns:
|
|
@@ -69,7 +69,7 @@ class TransformToOutputData(BaseEstimator, TransformerMixin):
|
|
|
69
69
|
- X: array con los datos de las operaciones clasificadas.
|
|
70
70
|
Actualmente el array de dataToTransform es de (n,5) con las columnas siguientes
|
|
71
71
|
|
|
72
|
-
- 0:
|
|
72
|
+
- 0: timestamp
|
|
73
73
|
- 1: tag_seedling
|
|
74
74
|
- 2: tag_fertilizer
|
|
75
75
|
Returns:
|
sarapy/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
## Version of the package
|
|
2
|
-
__version__ = "2.
|
|
2
|
+
__version__ = "2.2.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sarapy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Home-page: https://github.com/lucasbaldezzari/sarapy
|
|
5
5
|
Author: Lucas Baldezzari
|
|
6
6
|
Author-email: Lucas Baldezzari <lmbaldezzari@gmail.com>
|
|
@@ -19,6 +19,14 @@ Requires-Dist: geopy
|
|
|
19
19
|
|
|
20
20
|
Library for processing SARAPICO project metadata of _AMG SA_.
|
|
21
21
|
|
|
22
|
+
#### Version 2.2.0
|
|
23
|
+
|
|
24
|
+
- Se agrega baseDeltaP en PlantinFMCreator para poder dividir el timestamp de la electrónica por 10, ya que se envía en décimas de segundo.
|
|
25
|
+
|
|
26
|
+
#### Version 2.1.1
|
|
27
|
+
|
|
28
|
+
- Se corrige error de tiepo en TransformToOutputData.
|
|
29
|
+
|
|
22
30
|
#### Version 2.1.0
|
|
23
31
|
|
|
24
32
|
- Se modifica TransformInputdata para poder obtener el timestamp en newSample de OpsProcessor. Se modifica transformOutputData para entregar los datos en base a la solicitud de #43. Se modifica OpsProcessor para poder obtener los datos de salida según solicitud en #43. Close #43.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
sarapy/__init__.py,sha256=aVoywqGSscYYDycLaYJnz08dlQabl9gH0h4Q5KtHM9o,74
|
|
2
|
-
sarapy/version.py,sha256=
|
|
2
|
+
sarapy/version.py,sha256=KOlO2hui0K8-Vgk9NSIA7DmWhS5E7jpA2nk5zqFERaE,51
|
|
3
3
|
sarapy/dataProcessing/GeoProcessor.py,sha256=ARjgKTXDVdf_cFCXyFmzlnmmmay3HG3q-yeJ9QrAcQU,5919
|
|
4
|
-
sarapy/dataProcessing/OpsProcessor.py,sha256=
|
|
4
|
+
sarapy/dataProcessing/OpsProcessor.py,sha256=edoZBO-loAU-uVvjkNeFiRfUGFnaz2ImMsT25DMxDGM,17349
|
|
5
5
|
sarapy/dataProcessing/TLMSensorDataProcessor.py,sha256=RuITlryuSaIWvYyJwE5wxp85HVZ6mr5kUVALikfwS4g,3603
|
|
6
6
|
sarapy/dataProcessing/TimeSeriesProcessor.py,sha256=aig3A3_SCa9FVSWxGWiapBUX7Lj9Wi1BVyZi-XXZZYQ,6414
|
|
7
7
|
sarapy/dataProcessing/__init__.py,sha256=Kqs5sFtq6RMEa3KLJFbsGRoYsIxHL1UUGMuplyCyQFk,200
|
|
8
8
|
sarapy/mlProcessors/FertilizerFMCreator.py,sha256=LNi86CI6eVuQ0_UBVJNd_-L79fcY2-zY2NCm9ypl6OM,2354
|
|
9
9
|
sarapy/mlProcessors/FertilizerTransformer.py,sha256=PefMNrsvfqqjup0lcypzZB0IKzZbvTlTI03u4ITNuUo,3003
|
|
10
10
|
sarapy/mlProcessors/PlantinClassifier.py,sha256=PoPvtrqTXCmr0cLaMNRdDzhvzUJNZhLtvZNeE0qd_0Q,7905
|
|
11
|
-
sarapy/mlProcessors/PlantinFMCreator.py,sha256=
|
|
11
|
+
sarapy/mlProcessors/PlantinFMCreator.py,sha256=Rp6Mx_bhe0tvcktaG8vC8Dq8LPsBzKx4IjfVledvy6I,6926
|
|
12
12
|
sarapy/mlProcessors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
sarapy/preprocessing/DistancesImputer.py,sha256=NvbVAh5m0yFxVgDbEFnEX7RSG13qLjO7i2gqjDAWsf4,9106
|
|
14
14
|
sarapy/preprocessing/FertilizerImputer.py,sha256=zK6ONAilwPHvj-bC7yxnQYOkDBCCkWh6__57vYK9anM,1490
|
|
15
|
-
sarapy/preprocessing/TransformInputData.py,sha256=
|
|
16
|
-
sarapy/preprocessing/TransformToOutputData.py,sha256=
|
|
15
|
+
sarapy/preprocessing/TransformInputData.py,sha256=hp2P0Jry7ORUU_N3bMlAz1sCTvD5Qwfm376O8xqwPEo,8539
|
|
16
|
+
sarapy/preprocessing/TransformToOutputData.py,sha256=2hSeFkrSt1OO_jiX4SQJtL3Dhm_9xLy7zCgkj8jo9OE,3137
|
|
17
17
|
sarapy/preprocessing/__init__.py,sha256=Wg_Csy8Xiz8BN8A4-T7iPwcL_ol5ApEx6YtybItKB8M,100
|
|
18
18
|
sarapy/stats/__init__.py,sha256=ZrLMSistwynmmx4HUcI-ePRzqQ4bjp85JT4fTmbzC-c,27
|
|
19
19
|
sarapy/stats/stats.py,sha256=raQBnn2RRtwYOuKN4Mgk6Rhk4hajx1TVcGlYnT2TMmA,11412
|
|
@@ -22,8 +22,8 @@ sarapy/utils/amg_decoder.py,sha256=JZ7cbu7DlCuatuq2F7aBfUr7S7U-K5poBgxw5nY6rNI,4
|
|
|
22
22
|
sarapy/utils/amg_ppk.py,sha256=c0GusnxdntU-E0JOezzbIfC7SWoJmKAbad_zYDCJ3-c,1060
|
|
23
23
|
sarapy/utils/getRawOperations.py,sha256=8aA1fIkNCnUYgiWfnFggRT_U35z432gZBrZ7seGO5w4,817
|
|
24
24
|
sarapy/utils/plotting.py,sha256=kX-eYw618urMcUBkNPviQZdBziDc_TR3GInTsO90kU4,4065
|
|
25
|
-
sarapy-2.
|
|
26
|
-
sarapy-2.
|
|
27
|
-
sarapy-2.
|
|
28
|
-
sarapy-2.
|
|
29
|
-
sarapy-2.
|
|
25
|
+
sarapy-2.2.0.dist-info/LICENCE,sha256=N00sU3vSQ6F5c2vML9_qP4IFTkCPFFj0YGDB2CZP-uQ,840
|
|
26
|
+
sarapy-2.2.0.dist-info/METADATA,sha256=4yYQOkyZXWyLc3UqIHtYbxMxpznXjRat6kGwHD60Jk0,5945
|
|
27
|
+
sarapy-2.2.0.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
28
|
+
sarapy-2.2.0.dist-info/top_level.txt,sha256=4mUGZXfX2Fw47fpY6MQkaJeuOs_8tbjLkkNp34DJWiA,7
|
|
29
|
+
sarapy-2.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|