seabirdfilehandler 0.7.1__tar.gz → 0.7.2__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.

Potentially problematic release.


This version of seabirdfilehandler might be problematic. Click here for more details.

Files changed (16) hide show
  1. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/PKG-INFO +1 -1
  2. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/pyproject.toml +1 -1
  3. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/cnvfile.py +8 -10
  4. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/parameter.py +1 -1
  5. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/processing_steps.py +35 -0
  6. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/LICENSE +0 -0
  7. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/README.md +0 -0
  8. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/__init__.py +0 -0
  9. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/bottlefile.py +0 -0
  10. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/bottlelogfile.py +0 -0
  11. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/datafiles.py +0 -0
  12. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/file_collection.py +0 -0
  13. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/geomar_ctd_file_parser.py +0 -0
  14. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/hexfile.py +0 -0
  15. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/utils.py +0 -0
  16. {seabirdfilehandler-0.7.1 → seabirdfilehandler-0.7.2}/src/seabirdfilehandler/xmlfiles.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: seabirdfilehandler
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Library of parsers to interact with SeaBird CTD files.
5
5
  Keywords: CTD,parser,seabird,data
6
6
  Author: Emil Michels
@@ -20,7 +20,7 @@ urls.homepage = "https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler
20
20
  urls.repository = "https://git.io-warnemuende.de/CTD-Software/SeabirdFileHandler"
21
21
  urls.documentation = "https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler"
22
22
  dynamic = []
23
- version = "0.7.1"
23
+ version = "0.7.2"
24
24
 
25
25
  [tool.poetry]
26
26
 
@@ -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, addition: str | list):
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
- addition: str:
227
- the new information line
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
- if isinstance(addition, str):
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:
@@ -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="<U20")
81
+ return np.array(row_list, dtype="str")
82
82
 
83
83
  def create_parameter_instances(
84
84
  self,
@@ -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
  """