seabirdfilehandler 0.7.1__py3-none-any.whl → 0.7.3__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.
Potentially problematic release.
This version of seabirdfilehandler might be problematic. Click here for more details.
- seabirdfilehandler/cnvfile.py +9 -11
- seabirdfilehandler/parameter.py +7 -5
- seabirdfilehandler/processing_steps.py +35 -0
- {seabirdfilehandler-0.7.1.dist-info → seabirdfilehandler-0.7.3.dist-info}/METADATA +1 -1
- {seabirdfilehandler-0.7.1.dist-info → seabirdfilehandler-0.7.3.dist-info}/RECORD +7 -7
- {seabirdfilehandler-0.7.1.dist-info → seabirdfilehandler-0.7.3.dist-info}/LICENSE +0 -0
- {seabirdfilehandler-0.7.1.dist-info → seabirdfilehandler-0.7.3.dist-info}/WHEEL +0 -0
seabirdfilehandler/cnvfile.py
CHANGED
|
@@ -160,7 +160,7 @@ class CnvFile(DataFile):
|
|
|
160
160
|
def array2cnv(self) -> list:
|
|
161
161
|
result = []
|
|
162
162
|
for row in self.parameters.full_data_array:
|
|
163
|
-
formatted_row = "".join(elem.rjust(11) for elem in row)
|
|
163
|
+
formatted_row = "".join(str(elem).rjust(11) for elem in row)
|
|
164
164
|
result.append(formatted_row + "\n")
|
|
165
165
|
return result
|
|
166
166
|
|
|
@@ -217,23 +217,21 @@ class CnvFile(DataFile):
|
|
|
217
217
|
self.data = self.array2cnv()
|
|
218
218
|
self.file_data = [*self.header, *self.data]
|
|
219
219
|
|
|
220
|
-
def add_processing_metadata(self,
|
|
220
|
+
def add_processing_metadata(self, module: str, key: str, value: str):
|
|
221
221
|
"""
|
|
222
222
|
Adds new processing lines to the list of processing module information
|
|
223
223
|
|
|
224
224
|
Parameters
|
|
225
225
|
----------
|
|
226
|
-
|
|
227
|
-
the
|
|
226
|
+
module: str :
|
|
227
|
+
the name of the processing module
|
|
228
|
+
key: str :
|
|
229
|
+
the description of the value
|
|
230
|
+
value: str :
|
|
231
|
+
the information
|
|
228
232
|
|
|
229
233
|
"""
|
|
230
|
-
|
|
231
|
-
addition = [addition]
|
|
232
|
-
self.processing_steps.append(
|
|
233
|
-
self.processing_steps.create_step_instance(
|
|
234
|
-
module=addition[0].split("_")[0], raw_info=addition
|
|
235
|
-
)
|
|
236
|
-
)
|
|
234
|
+
self.processing_steps.add_info(module, key, value)
|
|
237
235
|
self._update_header()
|
|
238
236
|
|
|
239
237
|
def add_station_and_event_column(self) -> bool:
|
seabirdfilehandler/parameter.py
CHANGED
|
@@ -78,7 +78,7 @@ class Parameters(UserDict):
|
|
|
78
78
|
for i in range(0, len(line) - n, n)
|
|
79
79
|
]
|
|
80
80
|
)
|
|
81
|
-
return np.array(row_list, dtype=
|
|
81
|
+
return np.array(row_list, dtype=float)
|
|
82
82
|
|
|
83
83
|
def create_parameter_instances(
|
|
84
84
|
self,
|
|
@@ -205,10 +205,11 @@ class Parameters(UserDict):
|
|
|
205
205
|
parameter.name: parameter.metadata
|
|
206
206
|
for parameter in self.data.values()
|
|
207
207
|
}
|
|
208
|
-
# add to
|
|
209
|
-
|
|
210
|
-
self.full_data_array
|
|
211
|
-
|
|
208
|
+
# add to the data array if data
|
|
209
|
+
if parameter.type == "data":
|
|
210
|
+
self.full_data_array = np.insert(
|
|
211
|
+
self.full_data_array, position_index, parameter.data, axis=1
|
|
212
|
+
)
|
|
212
213
|
|
|
213
214
|
def create_parameter(
|
|
214
215
|
self,
|
|
@@ -449,6 +450,7 @@ class Parameter:
|
|
|
449
450
|
self.data = data
|
|
450
451
|
self.metadata = metadata
|
|
451
452
|
self.name = metadata["shortname"]
|
|
453
|
+
self.type = "data" if self.data.dtype in ["float", "int"] else "meta"
|
|
452
454
|
self.parse_to_float()
|
|
453
455
|
self.update_span()
|
|
454
456
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from collections import UserList
|
|
3
|
+
import copy
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class CnvProcessingSteps(UserList):
|
|
@@ -28,6 +29,7 @@ class CnvProcessingSteps(UserList):
|
|
|
28
29
|
def _form_processing_info(self) -> list:
|
|
29
30
|
out_list = []
|
|
30
31
|
for module in self.data:
|
|
32
|
+
module = copy.deepcopy(module)
|
|
31
33
|
if "vars" in module.metadata and module.name != "wildedit":
|
|
32
34
|
module.metadata["date"] = (
|
|
33
35
|
module.metadata["date"]
|
|
@@ -167,6 +169,39 @@ class CnvProcessingSteps(UserList):
|
|
|
167
169
|
return self.data[index]
|
|
168
170
|
return None
|
|
169
171
|
|
|
172
|
+
def add_info(
|
|
173
|
+
self,
|
|
174
|
+
module: str,
|
|
175
|
+
key: str,
|
|
176
|
+
value: str,
|
|
177
|
+
) -> ProcessingStep | None:
|
|
178
|
+
"""
|
|
179
|
+
Adds new processing lines to the list of processing module information
|
|
180
|
+
|
|
181
|
+
Parameters
|
|
182
|
+
----------
|
|
183
|
+
module: str :
|
|
184
|
+
the name of the processing module
|
|
185
|
+
key: str :
|
|
186
|
+
the description of the value
|
|
187
|
+
value: str :
|
|
188
|
+
the information
|
|
189
|
+
|
|
190
|
+
Returns
|
|
191
|
+
-------
|
|
192
|
+
the altered ProcessingStep
|
|
193
|
+
|
|
194
|
+
"""
|
|
195
|
+
if module in self.modules:
|
|
196
|
+
step_info = self.get_step(module)
|
|
197
|
+
if step_info:
|
|
198
|
+
step_info.metadata[key] = value
|
|
199
|
+
else:
|
|
200
|
+
step_info = ProcessingStep(name=module, metadata={key: value})
|
|
201
|
+
self.data.append(step_info)
|
|
202
|
+
self.modules.append(module)
|
|
203
|
+
return step_info
|
|
204
|
+
|
|
170
205
|
|
|
171
206
|
class ProcessingStep:
|
|
172
207
|
"""
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
seabirdfilehandler/__init__.py,sha256=PSokwgSgsmpFh-2Xv2T2d3yxmmahLnIq58WLZ51l86I,276
|
|
2
2
|
seabirdfilehandler/bottlefile.py,sha256=qCh506J3MWZXM11243aw_oJRocVB0ZIipXQLEgkD5M0,6046
|
|
3
3
|
seabirdfilehandler/bottlelogfile.py,sha256=MtMmEebdAktO3mk6KbmJC7dfx9sRLbV5qqDQt2qtpJE,4310
|
|
4
|
-
seabirdfilehandler/cnvfile.py,sha256=
|
|
4
|
+
seabirdfilehandler/cnvfile.py,sha256=DL5JimbFaznTcTzWiXcez6wviNIjq3kcGwvf3wO4zyY,10041
|
|
5
5
|
seabirdfilehandler/datafiles.py,sha256=HQungz24lRw4OiTwWs_curAGhzkI1rPiCmMXXcdQFNE,9423
|
|
6
6
|
seabirdfilehandler/file_collection.py,sha256=oLdjS-Q4_33T0qo_SYxkqg2bsaeg4gLVKBkOPxoTXx4,16111
|
|
7
7
|
seabirdfilehandler/geomar_ctd_file_parser.py,sha256=4eCnkE0mvPKC8Dic8sXP4xpfwnk3K2MQcGFBf6loT8k,2655
|
|
8
8
|
seabirdfilehandler/hexfile.py,sha256=TBplwbWHrTuJzv2qlx6xYNtoX43I2YUabDmaGZuBEDQ,2144
|
|
9
|
-
seabirdfilehandler/parameter.py,sha256=
|
|
10
|
-
seabirdfilehandler/processing_steps.py,sha256=
|
|
9
|
+
seabirdfilehandler/parameter.py,sha256=r4cdqhhi8CJE3xyo_6BtKjQ5R7AZKyXHURDhFKL8mC4,16065
|
|
10
|
+
seabirdfilehandler/processing_steps.py,sha256=5v6FV5zT7K6flbYLU31fyBRwPwQi4225se8i9WYUTQQ,7101
|
|
11
11
|
seabirdfilehandler/utils.py,sha256=5KXdB8Hdv65dv5tPyXxNMct1mCEOyA3S8XP54AFAnx0,1745
|
|
12
12
|
seabirdfilehandler/xmlfiles.py,sha256=XqqbVNjyINySoe2ZC_qJglkAqshavZxT2-jorDOSj7Y,5084
|
|
13
|
-
seabirdfilehandler-0.7.
|
|
14
|
-
seabirdfilehandler-0.7.
|
|
15
|
-
seabirdfilehandler-0.7.
|
|
16
|
-
seabirdfilehandler-0.7.
|
|
13
|
+
seabirdfilehandler-0.7.3.dist-info/LICENSE,sha256=Ifd1VPmYv32oJd2QVh3wIQP9X05vYJlcY6kONz360ws,34603
|
|
14
|
+
seabirdfilehandler-0.7.3.dist-info/METADATA,sha256=TqO2WAe-otgi5fErZ1hp-YT37T67PPeULtee8WfMG8Y,2307
|
|
15
|
+
seabirdfilehandler-0.7.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
16
|
+
seabirdfilehandler-0.7.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|