sarapy 0.2.0__py3-none-any.whl → 0.2.1__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.
@@ -1,12 +1,4 @@
1
- """
2
- La clase GeoAnalyzer se encarga de gestionar los datos de georreferenciación.
3
-
4
- - Versión de metadatos utilizada: Revision 9
5
- - Apuntes de desarrollo: https://docs.google.com/document/d/1kVH-DS6d572AObMCW5oRBIkn357C0T0XXZbq6C2KuW8/edit#heading=h.qfw1towwg3ot
6
-
7
- - Autor: BALDEZZARI Lucas
8
- - Creación: 8 de enero de 2024
9
- """
1
+ ###Documentación en https://github.com/lucasbaldezzari/sarapy/blob/main/docs/Readme.md
10
2
 
11
3
  import numpy as np
12
4
  from geopy.distance import geodesic
@@ -14,16 +6,7 @@ from sklearn.base import BaseEstimator, TransformerMixin
14
6
  import warnings
15
7
 
16
8
  class GeoAnalyzer(BaseEstimator, TransformerMixin):
17
- """La clase GeoAnalyzer se encarga de gestionar los datos de georreferenciación.
18
-
19
- - Versión de metadatos utilizada: Revision 9
20
- - Apuntes de desarrollo: https://docs.google.com/document/d/1kVH-DS6d572AObMCW5oRBIkn357C0T0XXZbq6C2KuW8/edit#heading=h.qfw1towwg3ot
21
- - Apuntes de
22
- - Apuntes de Desarrollo:
23
-
24
- - Autor: BALDEZZARI Lucas
25
- - Version: 0.1.0
26
- """
9
+ """La clase GeoAnalyzer se encarga de gestionar los datos de georreferenciación."""
27
10
 
28
11
  # _GeoPoint = Tuple[float, float]
29
12
 
@@ -37,7 +20,7 @@ class GeoAnalyzer(BaseEstimator, TransformerMixin):
37
20
  def getDistance(point1: np.array, point2: np.array) ->float:
38
21
  """Calcula la distancia elipsoidal (en metros) entre los puntos p1 y p2 donde cada punto está representado como un array con un valor de latitud y otro de longitud.
39
22
 
40
- Args:
23
+ Parametros
41
24
  p1 (tuple): np.array de tuplas con las coordenadas de latitud y longitud del punto 1
42
25
  p2 (tuple): np.array de tuplas con las coordenadas de latitud y longitud del punto 2
43
26
 
@@ -52,7 +35,6 @@ class GeoAnalyzer(BaseEstimator, TransformerMixin):
52
35
  """fittea el objeto
53
36
 
54
37
  - X: array con los puntos de latitud y longitud. Shape (n, 2)
55
- - y: etiquetas de entrenamiento
56
38
  """
57
39
  ##asserteamos que X sea un np.array
58
40
  assert isinstance(X, np.ndarray), "X debe ser un np.array"
@@ -1,40 +1,15 @@
1
- """
2
- La clase TLMSensorDataExtractor se encarga de gestionar los metadatos obtenidos de la base de datos. Estos metadatos se corresponden con los datos registrados en los sarapicos.
1
+ ###Documentación en https://github.com/lucasbaldezzari/sarapy/blob/main/docs/Readme.md
3
2
 
4
- - Versión de metadatos utilizada: Revision 9
5
- - Apuntes de desarrollo: https://docs.google.com/document/d/1kVH-DS6d572AObMCW5oRBIkn357C0T0XXZbq6C2KuW8/edit#heading=h.qfw1towwg3ot
6
-
7
- - Autor: BALDEZZARI Lucas
8
- """
9
-
10
- ##importamos numpy
11
3
  import numpy as np
12
4
  from sklearn.base import BaseEstimator, TransformerMixin
13
5
 
14
6
  class TLMSensorDataExtractor(BaseEstimator, TransformerMixin):
15
- """
16
- Clase que se encarga de procesar los metadatos obtenidos de la base de datos histórica.
17
-
18
- - Versión de metadatos utilizada: Revision 9
19
- - Link documento metadato: https://trello.com/c/M6DWjpwr/70-definici%C3%B3n-metadatos-a-relevar
20
- - Los metadatos de DATA_TLM en la Revisión 9 vienen en un string de 0 y 1. Estos valores indican, lo siguiente:
21
- |RF(1bit)|GNSS(1bit)|RFID(1bit)|FLASH(1bit)|RTCS(1bit)|MODE(1bit)|NBAT(2bits)|TIMEAC(8bits)|ESTAC(1bit)|DSTR PT(4bits)|INEST PT(1bit)|OFFS PT(2bits)|X(1bit)|DSTR FT(4bits)|INEST FT(1bit)|OFFS FT(2bits)|X(1bit)|GYRO_X(3bits)|GYRO_Y(3bits)|GYRO_Z(2bits)|ACEL_X(2bits)|ACEL_Y(2bits)|ACEL_Z(2bits)|EST MO(1bit)|EST OR(1bit)|SBAT(2bits)|VBAT(3bits)|CBAT(2bits)|EST BMS(1bit)
22
-
23
- Los valores X indican bit sin uso.
24
-
25
- - Versión 0.2.0.RevA
26
- - Autor: BALDEZZARI Lucas
27
- """
7
+ """- Autor: BALDEZZARI Lucas"""
28
8
 
29
9
  __metadataVersion = "Revision 9" #Versión de metadatos utilizada
30
10
 
31
11
  def __init__(self, *args, **kwargs):
32
- """
33
- Constructor de la clase MetadataManager.
34
-
35
- :param metadata: Diccionario con los metadatos obtenidos de la base de datos.
36
- :type metadata: strg
37
- """
12
+ """Constructor de la clase MetadataManager."""
38
13
 
39
14
  ### Creamos constantes que sirven para buscar los datos en el string de telemetría
40
15
  ### Cada constante es una tupla con la posición del bit menos significativo y la posición del bit más significativo
@@ -71,19 +46,7 @@ class TLMSensorDataExtractor(BaseEstimator, TransformerMixin):
71
46
  self.is_fitted = False
72
47
 
73
48
  def fit(self, X, y=None):
74
- """
75
- Método para generar datos a partir de la metadata.
76
-
77
- X es un array de strings. Cada string es un dato de la metadata.
78
-
79
- Extraigo información de cada fila de X. Genero numpys array de cada dato extraido de la metadata.
80
-
81
- Parametros
82
- ----------
83
- X: Array de strings.
84
- y: None
85
- No se utiliza.
86
- """
49
+ """Método para generar datos a partir de la metadata."""
87
50
 
88
51
  ##chequeamos si todos los strings de X tienen la misma longitud, sino arrojamos un assert
89
52
  assert all(len(x) == len(X[0]) for x in X), "Todos los strings de X deben tener la misma longitud"
@@ -121,15 +84,8 @@ class TLMSensorDataExtractor(BaseEstimator, TransformerMixin):
121
84
 
122
85
 
123
86
  def transform(self, X, y=None):
124
- """Genera un array de numpy con los datos extraidos de la metadata.
125
-
126
- Forma una matriz de numpy.
127
-
128
- Parametros
129
- ----------
130
- X: X es un array de strings. Cada string es un dato de la metadata.
131
- y: None
132
- No se utiliza."""
87
+ """
88
+ """
133
89
 
134
90
  ##chequeamos si se ha llamado a fit(). Sino, se arroja un error
135
91
  if not self.is_fitted:
@@ -165,19 +121,7 @@ class TLMSensorDataExtractor(BaseEstimator, TransformerMixin):
165
121
  self._ESTBMSFlag]).T
166
122
 
167
123
  def fit_transform(self, X, y=None):
168
- """Combinamos fit() y transform() en un solo método.
169
-
170
- Parametros
171
- ----------
172
- X: X es un array de strings. Cada string es un dato de la metadata.
173
- y: None
174
- No se utiliza.
175
-
176
- Return
177
- ------
178
- numpy array:
179
- Array de numpy con los datos extraidos de la metadata.
180
- """
124
+ """Combinamos fit() y transform() en un solo método."""
181
125
  self.fit(X)
182
126
  return self.transform(X)
183
127
 
@@ -1,31 +1,14 @@
1
- """
2
- La clase TimeSeriesProcessor se encarga de obtener y gestionar los datos referentes a las series temporales del Sarapico.
3
-
4
- - Versión de metadatos utilizada: Revision 9
5
- - Apuntes de desarrollo: https://docs.google.com/document/d/1kVH-DS6d572AObMCW5oRBIkn357C0T0XXZbq6C2KuW8/edit#heading=h.qfw1towwg3ot
6
-
7
- - Autor: BALDEZZARI Lucas
8
- - Creación: 8 de enero de 2024
9
- """
1
+ ###Documentación en https://github.com/lucasbaldezzari/sarapy/blob/main/docs/Readme.md
10
2
 
11
3
  import numpy as np
12
4
  from sklearn.base import BaseEstimator, TransformerMixin
13
5
  import warnings
14
6
  from datetime import datetime
15
7
 
16
-
17
8
  class TimeSeriesProcessor(BaseEstimator, TransformerMixin):
18
- """
19
- La clase TimeSeriesProcessor se encarga de obtener y gestionar los datos referentes a las series temporales del Sarapico.
20
-
21
- El objetivo de esta clase es poder obtener los tiempos de Operación, Caminata y Pico abierto correspondiente a las operaciones.
22
-
23
- - Versión de metadatos utilizada: Revision 9
24
- - Apuntes de desarrollo: https://docs.google.com/document/d/1kVH-DS6d572AObMCW5oRBIkn357C0T0XXZbq6C2KuW8/edit#heading=h.qfw1towwg3ot
25
-
9
+ """"
26
10
  - Autor: BALDEZZARI Lucas
27
11
  - Creación: 8 de enero de 2024
28
- - Version: 0.1.0
29
12
  """
30
13
 
31
14
  def __init__(self):
@@ -34,13 +17,7 @@ class TimeSeriesProcessor(BaseEstimator, TransformerMixin):
34
17
  self.is_fitted = False
35
18
 
36
19
  def fit(self, X: np.array, y=None)-> np.array:
37
- """fittea el objeto
38
-
39
- - X: array con los datos de timestamp (fecha y hora) en formato Unix timestamp y tiempo de pico abierto. Shape (n, 2). Los datos de Unix timestamp están en segundos.
40
-
41
- Returns:
42
- self: objeto fitteado
43
- """
20
+ """Fittea el objeto"""
44
21
 
45
22
  ##asserteamos que X sea un np.array
46
23
  assert isinstance(X, np.ndarray), "X debe ser un np.array"
@@ -65,14 +42,8 @@ class TimeSeriesProcessor(BaseEstimator, TransformerMixin):
65
42
 
66
43
  self.is_fitted = True
67
44
 
68
- def transform(self, X: np.array ):
69
- """Genera un array con los tiempos de operación, caminata y pico abierto.
70
-
71
- - X: array con los datos de timestamp (fecha y hora) en formato Unix timestamp y tiempo de pico abierto. Shape (n, 2). Los datos de Unix timestamp están en segundos.
72
-
73
- Returns:
74
- np.array: array con los tiempos de operación, caminata y pico abierto. Shape (n, 3).
75
- """
45
+ def transform(self, X: np.array):
46
+ """Genera un array con los tiempos de operación, caminata y pico abierto."""
76
47
 
77
48
  if not self.is_fitted:
78
49
  raise RuntimeError("El modelo no ha sido fitteado.")
@@ -80,14 +51,6 @@ class TimeSeriesProcessor(BaseEstimator, TransformerMixin):
80
51
  return np.hstack((self._deltaO.reshape(-1, 1), self._deltaC.reshape(-1, 1), self._deltaP.reshape(-1, 1))).round(2)
81
52
 
82
53
  def fit_transform(self, X: np.array, y=None):
83
- """fittea el objeto y genera un array con los tiempos de operación, caminata y pico abierto.
84
-
85
- - X: array con los datos de timestamp (fecha y hora) en formato Unix timestamp y tiempo de pico abierto. Shape (n, 2). Los datos de Unix timestamp están en segundos.
86
-
87
- Returns:
88
- np.array: array con los tiempos de operación, caminata y pico abierto. Shape (n, 3).
89
- """
90
-
91
54
  self.fit(X)
92
55
  return self.transform(X)
93
56
 
@@ -1,2 +1,3 @@
1
1
  from .TLMSensorDataExtractor import TLMSensorDataExtractor
2
- from .GeoAnalyzer import GeoAnalyzer
2
+ from .GeoAnalyzer import GeoAnalyzer
3
+ from .TimeSeriesProcessor import TimeSeriesProcessor
sarapy/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  ## Version of the package
2
- __version__ = "0.2.0"
2
+ __version__ = "0.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sarapy
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Library for Sarapico Metadata processing
5
5
  Home-page: https://github.com/lucasbaldezzari/sarapy
6
6
  Author: Lucas Baldezzari
@@ -24,6 +24,10 @@ Requires-Dist: geopy
24
24
 
25
25
  Library for processing SARAPICO project metadata of _AMG_.
26
26
 
27
+ #### Version 0.2.1
28
+
29
+ - Se corrige _init.py_ de dataProcessing.
30
+
27
31
  #### Version 0.2.0
28
32
 
29
33
  - Transforming some attributs to private attributes. Adding @property for getters.
@@ -0,0 +1,10 @@
1
+ sarapy/__init__.py,sha256=aVoywqGSscYYDycLaYJnz08dlQabl9gH0h4Q5KtHM9o,74
2
+ sarapy/version.py,sha256=gV4G8Od3LgDPbdxJK6oi8C-5N5hfwtY0SK2GQjYwDZ0,51
3
+ sarapy/dataProcessing/GeoAnalyzer.py,sha256=U6J0h7jtBeVDUL9HfglA8vyI2_espL96FKT5lFSaICE,4292
4
+ sarapy/dataProcessing/TLMSensorDataExtractor.py,sha256=KM1TQBKKnkN-zjX9jCDSvpQ9we_FCxqp-4gFD-SX964,21446
5
+ sarapy/dataProcessing/TimeSeriesProcessor.py,sha256=vEoHyhgZHSI48Fb3f646EAb13jyRYedBIF1S6-_9oQM,4210
6
+ sarapy/dataProcessing/__init__.py,sha256=3CKfXN4KZnxFdZDzwX5_a03gqG5hsEC1AXbT7AZyjf0,150
7
+ sarapy-0.2.1.dist-info/METADATA,sha256=R1ovUgS3jF_tjZSLgNrwF8KfH4lCian_OeFM4wTQH6c,1402
8
+ sarapy-0.2.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
9
+ sarapy-0.2.1.dist-info/top_level.txt,sha256=4mUGZXfX2Fw47fpY6MQkaJeuOs_8tbjLkkNp34DJWiA,7
10
+ sarapy-0.2.1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- sarapy/__init__.py,sha256=aVoywqGSscYYDycLaYJnz08dlQabl9gH0h4Q5KtHM9o,74
2
- sarapy/version.py,sha256=qxTsxev69Rcevv5-3XjGuTotIjAm7PaJWnqimjekEkc,51
3
- sarapy/dataProcessing/GeoAnalyzer.py,sha256=CGNQq35zTeDLfN6FbqVcAP5-yafw58-1eSXYJ7CPgJ4,4875
4
- sarapy/dataProcessing/TLMSensorDataExtractor.py,sha256=s-2gpajsS_5bCyefrgITHE1Xs0JMsq_VQAjeZIhrZWM,23698
5
- sarapy/dataProcessing/TimeSeriesProcessor.py,sha256=IEXLr6qYYJbcASYHfOKt9uN-48ek45tC6iVMY3OEJfE,6004
6
- sarapy/dataProcessing/__init__.py,sha256=XQAq8XaCeyg3Cd4l47rF9sXC0d7e5t9CcW3328vcUtk,96
7
- sarapy-0.2.0.dist-info/METADATA,sha256=SWLvQjiQurbSKGDUK4_XOHE5yhBuTlyO2BE9dpej5Sw,1335
8
- sarapy-0.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
9
- sarapy-0.2.0.dist-info/top_level.txt,sha256=4mUGZXfX2Fw47fpY6MQkaJeuOs_8tbjLkkNp34DJWiA,7
10
- sarapy-0.2.0.dist-info/RECORD,,
File without changes