seabirdfilehandler 0.7.5__py3-none-any.whl → 0.7.7__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/bottlefile.py +5 -3
- seabirdfilehandler/bottlelogfile.py +4 -2
- seabirdfilehandler/cnvfile.py +6 -4
- seabirdfilehandler/datafiles.py +4 -3
- seabirdfilehandler/file_collection.py +16 -12
- seabirdfilehandler/geomar_ctd_file_parser.py +1 -0
- seabirdfilehandler/hexfile.py +1 -0
- seabirdfilehandler/parameter.py +8 -6
- seabirdfilehandler/processing_steps.py +3 -3
- seabirdfilehandler/xmlfiles.py +4 -3
- {seabirdfilehandler-0.7.5.dist-info → seabirdfilehandler-0.7.7.dist-info}/METADATA +13 -1
- seabirdfilehandler-0.7.7.dist-info/RECORD +16 -0
- {seabirdfilehandler-0.7.5.dist-info → seabirdfilehandler-0.7.7.dist-info}/WHEEL +1 -1
- seabirdfilehandler-0.7.5.dist-info/RECORD +0 -16
- {seabirdfilehandler-0.7.5.dist-info → seabirdfilehandler-0.7.7.dist-info}/licenses/LICENSE +0 -0
seabirdfilehandler/bottlefile.py
CHANGED
|
@@ -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
|
-
|
|
4
|
-
import pandas as pd
|
|
5
|
+
|
|
5
6
|
import numpy as np
|
|
6
|
-
import
|
|
7
|
+
import pandas as pd
|
|
8
|
+
|
|
7
9
|
from seabirdfilehandler import DataFile
|
|
8
10
|
|
|
9
11
|
logger = logging.getLogger(__name__)
|
seabirdfilehandler/cnvfile.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import logging
|
|
2
2
|
from datetime import datetime, timedelta
|
|
3
|
-
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
4
5
|
import numpy as np
|
|
5
|
-
import
|
|
6
|
-
|
|
6
|
+
import pandas as pd
|
|
7
|
+
|
|
8
|
+
from seabirdfilehandler import CnvProcessingSteps, DataFile, Parameters
|
|
7
9
|
|
|
8
10
|
logger = logging.getLogger(__name__)
|
|
9
11
|
|
seabirdfilehandler/datafiles.py
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
161
|
-
self.path_to_files
|
|
162
|
-
|
|
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
|
-
|
|
308
|
-
|
|
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:
|
seabirdfilehandler/hexfile.py
CHANGED
seabirdfilehandler/parameter.py
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
153
|
-
return dictionary
|
|
153
|
+
return dictionary
|
|
154
154
|
|
|
155
155
|
def get_step(self, step: str) -> ProcessingStep | None:
|
|
156
156
|
"""
|
seabirdfilehandler/xmlfiles.py
CHANGED
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: seabirdfilehandler
|
|
3
|
-
Version: 0.7.
|
|
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
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
seabirdfilehandler/__init__.py,sha256=PSokwgSgsmpFh-2Xv2T2d3yxmmahLnIq58WLZ51l86I,276
|
|
2
|
+
seabirdfilehandler/bottlefile.py,sha256=iNhg3cBKmCXCOD5PHDlxCbjXfOWxPi___1SEco5ujl8,6048
|
|
3
|
+
seabirdfilehandler/bottlelogfile.py,sha256=EqtoKSRKqU6jqk435JDBQlk_KijbYOF62wMPv25ccOo,4312
|
|
4
|
+
seabirdfilehandler/cnvfile.py,sha256=opeJhHeKBs6mHsTM8s4tnWq67g2q3mn1imC6On2qX-c,10250
|
|
5
|
+
seabirdfilehandler/datafiles.py,sha256=kw5umO0hhv3dQoW0oog48zKEKOm9qdcEkZdj8hWUwSc,9234
|
|
6
|
+
seabirdfilehandler/file_collection.py,sha256=EPBTPQt3BVSKom0ooA1kEEpujOnqspWkZCSXSGHwgDg,16179
|
|
7
|
+
seabirdfilehandler/geomar_ctd_file_parser.py,sha256=NI6Wjd5DL74N6R7IaqRFxh7no3jH6jQmnuv7I8U5zFs,2656
|
|
8
|
+
seabirdfilehandler/hexfile.py,sha256=sx-OKc6GFsutchOMgxjspFcMntVMAj2nvpf4rmMZE5w,2145
|
|
9
|
+
seabirdfilehandler/parameter.py,sha256=HJ-yV017ia3Wn_0vs5J7rnZVeCzEiVd-dhEQWLaqp9g,16086
|
|
10
|
+
seabirdfilehandler/processing_steps.py,sha256=preEkfgDOR6shJOQiHfMZJ7MaJ71GmyPJ-0sN7bUt9s,7081
|
|
11
|
+
seabirdfilehandler/utils.py,sha256=5KXdB8Hdv65dv5tPyXxNMct1mCEOyA3S8XP54AFAnx0,1745
|
|
12
|
+
seabirdfilehandler/xmlfiles.py,sha256=sPHcz30MYCak3x2tXqtnPg4t1l9Gz5JhcbxACSPIxtU,5085
|
|
13
|
+
seabirdfilehandler-0.7.7.dist-info/METADATA,sha256=17YhEZmcvcorNHou4iVVCYyUYGlU4t5S456x6nbb8QY,2921
|
|
14
|
+
seabirdfilehandler-0.7.7.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
15
|
+
seabirdfilehandler-0.7.7.dist-info/licenses/LICENSE,sha256=Ifd1VPmYv32oJd2QVh3wIQP9X05vYJlcY6kONz360ws,34603
|
|
16
|
+
seabirdfilehandler-0.7.7.dist-info/RECORD,,
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
seabirdfilehandler/__init__.py,sha256=PSokwgSgsmpFh-2Xv2T2d3yxmmahLnIq58WLZ51l86I,276
|
|
2
|
-
seabirdfilehandler/bottlefile.py,sha256=qCh506J3MWZXM11243aw_oJRocVB0ZIipXQLEgkD5M0,6046
|
|
3
|
-
seabirdfilehandler/bottlelogfile.py,sha256=MtMmEebdAktO3mk6KbmJC7dfx9sRLbV5qqDQt2qtpJE,4310
|
|
4
|
-
seabirdfilehandler/cnvfile.py,sha256=xCkU0N9WS2Lo3OPyo2YFl-D8qvLwIpjDDO3Rco__8Mg,10248
|
|
5
|
-
seabirdfilehandler/datafiles.py,sha256=riSs_IG6qruJL_M92Ii4XqBpLp34U3pwg4yFQHchq7U,9233
|
|
6
|
-
seabirdfilehandler/file_collection.py,sha256=oLdjS-Q4_33T0qo_SYxkqg2bsaeg4gLVKBkOPxoTXx4,16111
|
|
7
|
-
seabirdfilehandler/geomar_ctd_file_parser.py,sha256=4eCnkE0mvPKC8Dic8sXP4xpfwnk3K2MQcGFBf6loT8k,2655
|
|
8
|
-
seabirdfilehandler/hexfile.py,sha256=TBplwbWHrTuJzv2qlx6xYNtoX43I2YUabDmaGZuBEDQ,2144
|
|
9
|
-
seabirdfilehandler/parameter.py,sha256=ovoYt9NjUhLudCywzgEBlnSHydgSVsueHcl45769LVg,16072
|
|
10
|
-
seabirdfilehandler/processing_steps.py,sha256=5v6FV5zT7K6flbYLU31fyBRwPwQi4225se8i9WYUTQQ,7101
|
|
11
|
-
seabirdfilehandler/utils.py,sha256=5KXdB8Hdv65dv5tPyXxNMct1mCEOyA3S8XP54AFAnx0,1745
|
|
12
|
-
seabirdfilehandler/xmlfiles.py,sha256=XqqbVNjyINySoe2ZC_qJglkAqshavZxT2-jorDOSj7Y,5084
|
|
13
|
-
seabirdfilehandler-0.7.5.dist-info/METADATA,sha256=hLyBlSy7XXyuTFkqrC58eXAOcIVI0cqGVlYGLGwBX1M,2329
|
|
14
|
-
seabirdfilehandler-0.7.5.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
|
|
15
|
-
seabirdfilehandler-0.7.5.dist-info/licenses/LICENSE,sha256=Ifd1VPmYv32oJd2QVh3wIQP9X05vYJlcY6kONz360ws,34603
|
|
16
|
-
seabirdfilehandler-0.7.5.dist-info/RECORD,,
|
|
File without changes
|