seabirdfilehandler 0.7.5__tar.gz → 0.7.7__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.5 → seabirdfilehandler-0.7.7}/PKG-INFO +13 -1
  2. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/pyproject.toml +16 -31
  3. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/bottlefile.py +5 -3
  4. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/bottlelogfile.py +4 -2
  5. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/cnvfile.py +6 -4
  6. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/datafiles.py +4 -3
  7. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/file_collection.py +16 -12
  8. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/geomar_ctd_file_parser.py +1 -0
  9. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/hexfile.py +1 -0
  10. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/parameter.py +8 -6
  11. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/processing_steps.py +3 -3
  12. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/xmlfiles.py +4 -3
  13. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/LICENSE +0 -0
  14. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/README.md +0 -0
  15. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/__init__.py +0 -0
  16. {seabirdfilehandler-0.7.5 → seabirdfilehandler-0.7.7}/src/seabirdfilehandler/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seabirdfilehandler
3
- Version: 0.7.5
3
+ Version: 0.7.7
4
4
  Summary: Library of parsers to interact with SeaBird CTD files.
5
5
  License-File: LICENSE
6
6
  Keywords: CTD,parser,seabird,data
@@ -15,7 +15,19 @@ Classifier: Topic :: Scientific/Engineering :: Oceanography
15
15
  Classifier: Programming Language :: Python :: 3 :: Only
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Provides-Extra: docs
20
+ Provides-Extra: test
21
+ Requires-Dist: myst-parser (>=4.0.1) ; extra == "docs"
18
22
  Requires-Dist: pandas (>=2.2.1)
23
+ Requires-Dist: parameterized (>=0.9.0) ; extra == "test"
24
+ Requires-Dist: pre-commit (>=3.6.2) ; extra == "docs"
25
+ Requires-Dist: pre-commit (>=3.6.2) ; extra == "test"
26
+ Requires-Dist: pyment (>=0.3.3) ; extra == "docs"
27
+ Requires-Dist: pytest (>=8.3.0) ; extra == "test"
28
+ Requires-Dist: sphinx (>=8.2.3) ; extra == "docs"
29
+ Requires-Dist: sphinx-autodoc-typehints (>=1.24.1) ; extra == "docs"
30
+ Requires-Dist: sphinx-rtd-theme (>=1.3.0) ; extra == "docs"
19
31
  Requires-Dist: xmltodict (>=0.13.0)
20
32
  Project-URL: Documentation, https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler
21
33
  Project-URL: Homepage, https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler
@@ -15,49 +15,35 @@ classifiers = [
15
15
  "Programming Language :: Python :: 3 :: Only",
16
16
  "Programming Language :: Python :: 3.12",
17
17
  "Programming Language :: Python :: 3.13",
18
+ "Programming Language :: Python :: 3.14",
18
19
  ]
19
20
  urls.homepage = "https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler"
20
21
  urls.repository = "https://git.io-warnemuende.de/CTD-Software/SeabirdFileHandler"
21
22
  urls.documentation = "https://ctd-software.pages.io-warnemuende.de/seabirdfilehandler"
22
23
  dynamic = []
23
- version = "0.7.5"
24
+ requires-python = ">=3.12"
25
+ dependencies = ["pandas>=2.2.1", "xmltodict>=0.13.0"]
26
+ version = "0.7.7"
27
+
28
+ [project.optional-dependencies]
29
+ test = ["pytest>=8.3.0", "parameterized>=0.9.0", "pre-commit>=3.6.2"]
30
+ docs = [
31
+ "pre-commit>=3.6.2",
32
+ "sphinx>=8.2.3",
33
+ "sphinx-rtd-theme>=1.3.0",
34
+ "sphinx-autodoc-typehints>=1.24.1",
35
+ "myst-parser>=4.0.1",
36
+ "pyment>=0.3.3",
37
+ ]
24
38
 
25
39
  [tool.poetry]
26
40
 
27
41
  [tool.poetry.requires-plugins]
28
42
  poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
29
43
 
30
- [tool.poetry.dependencies]
31
- python = ">=3.12"
32
- pandas = ">=2.2.1"
33
- xmltodict = ">=0.13.0"
34
-
35
- [tool.poetry.group.dev.dependencies]
36
- pytest = ">=8.3.0"
37
- pytest-xdist = ">=3.6.1"
38
- pytest-cov = ">=6.0.0"
39
- parameterized = ">=0.9.0"
40
- sphinx = ">=8.2.3"
41
- sphinx-rtd-theme = ">=1.3.0"
42
- sphinx-autodoc-typehints = ">=1.24.1"
43
- pyment = ">=0.3.3"
44
- pylint = ">=3.0.2"
45
- pre-commit = ">=3.6.2"
46
- tomlkit = ">=0.13.2"
47
- myst-parser = "^4.0.1"
48
-
49
44
  [tool.pytest.ini_options]
50
45
  pythonpath = [".", "src", "src/seabirdfilehandler"]
51
- filterwarnings = [
52
- "error",
53
- "ignore::UserWarning",
54
- 'ignore::DeprecationWarning',
55
- # note the use of single quote below to denote "raw" strings in TOML
56
- 'ignore: datetime.datetime.utcfromtimestamp\(\) is deprecated:DeprecationWarning',
57
- ]
58
-
59
- [tool.coverage.run]
60
- omit = ["tests/*"]
46
+ filterwarnings = ["error", "ignore::FutureWarning"]
61
47
 
62
48
  [tool.ruff]
63
49
  line-length = 79
@@ -65,7 +51,6 @@ line-length = 79
65
51
  [tool.ruff.lint]
66
52
  ignore = ["F403", "F821"]
67
53
 
68
-
69
54
  [tool.poetry-dynamic-versioning]
70
55
  enable = false
71
56
 
@@ -1,9 +1,11 @@
1
+ import logging
2
+ from datetime import datetime, time
1
3
  from pathlib import Path
2
4
  from typing import Union
3
- from datetime import datetime, time
4
- import pandas as pd
5
+
5
6
  import numpy as np
6
- import logging
7
+ import pandas as pd
8
+
7
9
  from seabirdfilehandler import DataFile
8
10
 
9
11
  logger = logging.getLogger(__name__)
@@ -1,7 +1,9 @@
1
- from datetime import datetime
2
- import re
3
1
  import logging
2
+ import re
3
+ from datetime import datetime
4
+
4
5
  import pandas as pd
6
+
5
7
  from seabirdfilehandler import DataFile
6
8
 
7
9
  logger = logging.getLogger(__name__)
@@ -1,9 +1,11 @@
1
- from pathlib import Path
1
+ import logging
2
2
  from datetime import datetime, timedelta
3
- import pandas as pd
3
+ from pathlib import Path
4
+
4
5
  import numpy as np
5
- import logging
6
- from seabirdfilehandler import DataFile, Parameters, CnvProcessingSteps
6
+ import pandas as pd
7
+
8
+ from seabirdfilehandler import CnvProcessingSteps, DataFile, Parameters
7
9
 
8
10
  logger = logging.getLogger(__name__)
9
11
 
@@ -1,8 +1,9 @@
1
+ import logging
1
2
  from pathlib import Path
2
- import xmltodict
3
- import pandas as pd
3
+
4
4
  import numpy as np
5
- import logging
5
+ import pandas as pd
6
+ import xmltodict
6
7
 
7
8
  logger = logging.getLogger(__name__)
8
9
 
@@ -1,15 +1,18 @@
1
1
  from __future__ import annotations
2
- from pathlib import Path
2
+
3
3
  import logging
4
+ import warnings
4
5
  from collections import UserList
6
+ from pathlib import Path
5
7
  from typing import Callable, Type
6
- import warnings
7
- import pandas as pd
8
+
8
9
  import numpy as np
10
+ import pandas as pd
11
+
9
12
  from seabirdfilehandler import (
10
- CnvFile,
11
13
  BottleFile,
12
14
  BottleLogFile,
15
+ CnvFile,
13
16
  DataFile,
14
17
  HexFile,
15
18
  )
@@ -157,10 +160,13 @@ class FileCollection(UserList):
157
160
  -------
158
161
  A list of all paths found.
159
162
  """
160
- return sorted(
161
- self.path_to_files.rglob(f"*{pattern}*{self.file_suffix}"),
162
- key=sorting_key,
163
- )
163
+ if self.path_to_files.is_file():
164
+ return [self.path_to_files]
165
+ else:
166
+ return sorted(
167
+ self.path_to_files.rglob(f"*{pattern}*{self.file_suffix}"),
168
+ key=sorting_key,
169
+ )
164
170
 
165
171
  def load_files(self, only_metadata: bool = False) -> list[DataFile]:
166
172
  """
@@ -304,10 +310,8 @@ class FileCollection(UserList):
304
310
  for parameter in df.columns:
305
311
  if parameter in ["datetime"]:
306
312
  continue
307
- try:
308
- df[parameter] = df[parameter].astype("float")
309
- finally:
310
- continue
313
+ df[parameter] = df[parameter].astype("float")
314
+ continue
311
315
  return df
312
316
 
313
317
  def select_real_scan_data(self, df: pd.DataFrame) -> pd.DataFrame:
@@ -1,4 +1,5 @@
1
1
  from pathlib import Path
2
+
2
3
  import pandas as pd
3
4
 
4
5
 
@@ -1,4 +1,5 @@
1
1
  from pathlib import Path
2
+
2
3
  from seabirdfilehandler import DataFile, XMLCONFile
3
4
 
4
5
 
@@ -1,10 +1,12 @@
1
1
  from __future__ import annotations
2
- from typing import Tuple
2
+
3
+ import logging
3
4
  import re
4
5
  from collections import UserDict
6
+ from typing import Tuple
7
+
5
8
  import numpy as np
6
9
  import pandas as pd
7
- import logging
8
10
 
9
11
  logger = logging.getLogger(__name__)
10
12
 
@@ -153,10 +155,10 @@ class Parameters(UserDict):
153
155
  post = []
154
156
  for line in self.raw_metadata:
155
157
  if line.startswith("name"):
156
- column_names.append(line.split("=")[1].strip())
158
+ column_names.append(line.split("=", 1)[1].strip())
157
159
  elif line.startswith("span"):
158
160
  past_spans = True
159
- column_value_spans.append(line.split("=")[1].strip())
161
+ column_value_spans.append(line.split("=", 1)[1].strip())
160
162
  else:
161
163
  if not past_spans:
162
164
  pre.append(line)
@@ -164,7 +166,7 @@ class Parameters(UserDict):
164
166
  post.append(line)
165
167
  assert len(column_names) == len(column_value_spans)
166
168
  self.data_table_stats = {
167
- line.split("=")[0].strip(): line.split("=")[1].strip()
169
+ line.split("=")[0].strip(): line.split("=", 1)[1].strip()
168
170
  for line in pre
169
171
  }
170
172
  self.data_table_names_and_spans = [
@@ -172,7 +174,7 @@ class Parameters(UserDict):
172
174
  for name, span in zip(column_names, column_value_spans)
173
175
  ]
174
176
  self.data_table_misc = {
175
- line.split("=")[0].strip(): line.split("=")[1].strip()
177
+ line.split("=")[0].strip(): line.split("=", 1)[1].strip()
176
178
  for line in post
177
179
  }
178
180
 
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
- from collections import UserList
2
+
3
3
  import copy
4
+ from collections import UserList
4
5
 
5
6
 
6
7
  class CnvProcessingSteps(UserList):
@@ -149,8 +150,7 @@ class CnvProcessingSteps(UserList):
149
150
  pass
150
151
  else:
151
152
  dictionary[key.strip()] = value.strip()
152
- finally:
153
- return dictionary
153
+ return dictionary
154
154
 
155
155
  def get_step(self, step: str) -> ProcessingStep | None:
156
156
  """
@@ -1,7 +1,8 @@
1
- from pathlib import Path
2
- from collections import UserDict
3
- import xml.etree.ElementTree as ET
4
1
  import json
2
+ import xml.etree.ElementTree as ET
3
+ from collections import UserDict
4
+ from pathlib import Path
5
+
5
6
  import xmltodict
6
7
 
7
8
  from seabirdfilehandler.utils import UnexpectedFileFormat