shepherd-data 2025.6.4__py3-none-any.whl → 2025.8.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.
- shepherd_data/__init__.py +1 -1
- shepherd_data/cli.py +17 -13
- shepherd_data/reader.py +20 -12
- {shepherd_data-2025.6.4.dist-info → shepherd_data-2025.8.1.dist-info}/METADATA +4 -2
- shepherd_data-2025.8.1.dist-info/RECORD +11 -0
- shepherd_data-2025.6.4.dist-info/RECORD +0 -11
- {shepherd_data-2025.6.4.dist-info → shepherd_data-2025.8.1.dist-info}/WHEEL +0 -0
- {shepherd_data-2025.6.4.dist-info → shepherd_data-2025.8.1.dist-info}/entry_points.txt +0 -0
- {shepherd_data-2025.6.4.dist-info → shepherd_data-2025.8.1.dist-info}/top_level.txt +0 -0
- {shepherd_data-2025.6.4.dist-info → shepherd_data-2025.8.1.dist-info}/zip-safe +0 -0
shepherd_data/__init__.py
CHANGED
shepherd_data/cli.py
CHANGED
|
@@ -7,13 +7,11 @@ from datetime import datetime
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
|
|
9
9
|
import click
|
|
10
|
-
import pydantic
|
|
11
10
|
|
|
12
11
|
from shepherd_core import get_verbose_level
|
|
13
12
|
from shepherd_core import local_tz
|
|
14
13
|
from shepherd_core.logger import set_log_verbose_level
|
|
15
14
|
|
|
16
|
-
from . import __version__
|
|
17
15
|
from .reader import Reader
|
|
18
16
|
|
|
19
17
|
logger = logging.getLogger("SHPData.cli")
|
|
@@ -57,17 +55,22 @@ def cli(ctx: click.Context, *, verbose: bool) -> None:
|
|
|
57
55
|
@cli.command(short_help="Print version-info (combine with -v for more)")
|
|
58
56
|
def version() -> None:
|
|
59
57
|
"""Print version-info (combine with -v for more)."""
|
|
60
|
-
|
|
58
|
+
from importlib import metadata # noqa: PLC0415
|
|
59
|
+
|
|
61
60
|
logger.debug("Python v%s", sys.version)
|
|
62
|
-
logger.
|
|
63
|
-
logger.debug("
|
|
61
|
+
logger.info("Shepherd-Data v%s", metadata.version("shepherd_data"))
|
|
62
|
+
logger.debug("Shepherd-Core v%s", metadata.version("shepherd_core"))
|
|
63
|
+
logger.debug("h5py v%s", metadata.version("h5py"))
|
|
64
|
+
logger.debug("numpy v%s", metadata.version("numpy"))
|
|
65
|
+
logger.debug("Click v%s", metadata.version("click"))
|
|
66
|
+
logger.debug("Pydantic v%s", metadata.version("pydantic"))
|
|
64
67
|
|
|
65
68
|
|
|
66
69
|
@cli.command(short_help="Validates a file or directory containing shepherd-recordings")
|
|
67
70
|
@click.argument("in_data", type=click.Path(exists=True, resolve_path=True))
|
|
68
71
|
@click.option(
|
|
69
72
|
"--recurse",
|
|
70
|
-
"-
|
|
73
|
+
"-R",
|
|
71
74
|
is_flag=True,
|
|
72
75
|
help="Also consider files in sub-folders",
|
|
73
76
|
)
|
|
@@ -128,7 +131,7 @@ def validate(in_data: Path, *, recurse: bool = False) -> None:
|
|
|
128
131
|
)
|
|
129
132
|
@click.option(
|
|
130
133
|
"--recurse",
|
|
131
|
-
"-
|
|
134
|
+
"-R",
|
|
132
135
|
is_flag=True,
|
|
133
136
|
help="Also consider files in sub-folders",
|
|
134
137
|
)
|
|
@@ -172,7 +175,7 @@ def extract(
|
|
|
172
175
|
)
|
|
173
176
|
@click.option(
|
|
174
177
|
"--recurse",
|
|
175
|
-
"-
|
|
178
|
+
"-R",
|
|
176
179
|
is_flag=True,
|
|
177
180
|
help="Also consider files in sub-folders",
|
|
178
181
|
)
|
|
@@ -222,7 +225,7 @@ def extract_meta(
|
|
|
222
225
|
@click.argument("in_data", type=click.Path(exists=True, resolve_path=True))
|
|
223
226
|
@click.option(
|
|
224
227
|
"--recurse",
|
|
225
|
-
"-
|
|
228
|
+
"-R",
|
|
226
229
|
is_flag=True,
|
|
227
230
|
help="Also consider files in sub-folders",
|
|
228
231
|
)
|
|
@@ -247,7 +250,7 @@ def extract_uart(in_data: Path, *, recurse: bool = False) -> None:
|
|
|
247
250
|
@click.argument("in_data", type=click.Path(exists=True, resolve_path=True))
|
|
248
251
|
@click.option(
|
|
249
252
|
"--recurse",
|
|
250
|
-
"-
|
|
253
|
+
"-R",
|
|
251
254
|
is_flag=True,
|
|
252
255
|
help="Also consider files in sub-folders",
|
|
253
256
|
)
|
|
@@ -293,7 +296,7 @@ def decode_uart(in_data: Path, *, recurse: bool = False) -> None:
|
|
|
293
296
|
) # TODO: also configure decimal point
|
|
294
297
|
@click.option(
|
|
295
298
|
"--recurse",
|
|
296
|
-
"-
|
|
299
|
+
"-R",
|
|
297
300
|
is_flag=True,
|
|
298
301
|
help="Also consider files in sub-folders",
|
|
299
302
|
)
|
|
@@ -346,7 +349,7 @@ def extract_gpio(in_data: Path, separator: str, *, recurse: bool = False) -> Non
|
|
|
346
349
|
)
|
|
347
350
|
@click.option(
|
|
348
351
|
"--recurse",
|
|
349
|
-
"-
|
|
352
|
+
"-R",
|
|
350
353
|
is_flag=True,
|
|
351
354
|
help="Also consider files in sub-folders",
|
|
352
355
|
)
|
|
@@ -424,10 +427,11 @@ def downsample(
|
|
|
424
427
|
)
|
|
425
428
|
@click.option(
|
|
426
429
|
"--recurse",
|
|
427
|
-
"-
|
|
430
|
+
"-R",
|
|
428
431
|
is_flag=True,
|
|
429
432
|
help="Also consider files in sub-folders",
|
|
430
433
|
)
|
|
434
|
+
# TODO: allow SVG-output
|
|
431
435
|
def plot(
|
|
432
436
|
in_data: Path,
|
|
433
437
|
start: float | None,
|
shepherd_data/reader.py
CHANGED
|
@@ -185,19 +185,23 @@ class Reader(CoreReader):
|
|
|
185
185
|
:param is_time: time is not really down-sampled, but decimated
|
|
186
186
|
:return: resampled h5-dataset or numpy-array
|
|
187
187
|
"""
|
|
188
|
-
|
|
188
|
+
# import only when needed, due to massive delay
|
|
189
|
+
from scipy import signal # noqa: PLC0415
|
|
189
190
|
|
|
190
191
|
if self.get_datatype() == EnergyDType.ivsurface:
|
|
191
192
|
self._logger.warning("Downsampling-Function was not written for IVSurfaces")
|
|
192
193
|
ds_factor = max(1, math.floor(ds_factor))
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
if not isinstance(start_n, int):
|
|
195
|
+
raise TypeError("start_n must be an integer")
|
|
196
|
+
if isinstance(end_n, int):
|
|
197
|
+
end_n = min(data_src.shape[0], end_n)
|
|
198
|
+
elif isinstance(end_n, float):
|
|
199
|
+
raise TypeError("end_n must be an integer")
|
|
196
200
|
else:
|
|
197
|
-
|
|
201
|
+
end_n = data_src.shape[0]
|
|
198
202
|
|
|
199
|
-
start_n = min(
|
|
200
|
-
data_len =
|
|
203
|
+
start_n = min(end_n, start_n)
|
|
204
|
+
data_len = end_n - start_n # TODO: one-off to calculation below ?
|
|
201
205
|
if data_len == 0:
|
|
202
206
|
self._logger.warning("downsampling failed because of data_len = 0")
|
|
203
207
|
return data_dst
|
|
@@ -380,13 +384,17 @@ class Reader(CoreReader):
|
|
|
380
384
|
if self.get_datatype() == EnergyDType.ivsurface:
|
|
381
385
|
self._logger.warning("Resampling-Function was not written for IVSurfaces")
|
|
382
386
|
return data_dst
|
|
383
|
-
if isinstance(
|
|
384
|
-
|
|
387
|
+
if not isinstance(start_n, int):
|
|
388
|
+
raise TypeError("start_n must be an integer")
|
|
389
|
+
if isinstance(end_n, int):
|
|
390
|
+
end_n = min(data_src.shape[0], end_n)
|
|
391
|
+
elif isinstance(end_n, float):
|
|
392
|
+
raise TypeError("end_n must be an integer")
|
|
385
393
|
else:
|
|
386
|
-
|
|
394
|
+
end_n = data_src.shape[0]
|
|
387
395
|
|
|
388
|
-
start_n = min(
|
|
389
|
-
data_len =
|
|
396
|
+
start_n = min(end_n, start_n)
|
|
397
|
+
data_len = end_n - start_n
|
|
390
398
|
if data_len == 0:
|
|
391
399
|
self._logger.warning("resampling failed because of data_len = 0")
|
|
392
400
|
return data_dst
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shepherd_data
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.8.1
|
|
4
4
|
Summary: Programming- and CLI-Interface for the h5-dataformat of the Shepherd-Testbed
|
|
5
5
|
Author-email: Ingmar Splitt <ingmar.splitt@tu-dresden.de>
|
|
6
6
|
Maintainer-email: Ingmar Splitt <ingmar.splitt@tu-dresden.de>
|
|
@@ -34,7 +34,7 @@ Requires-Dist: numpy
|
|
|
34
34
|
Requires-Dist: pandas>=2.0.0
|
|
35
35
|
Requires-Dist: pyYAML
|
|
36
36
|
Requires-Dist: scipy
|
|
37
|
-
Requires-Dist: shepherd-core[inventory]>=2025.
|
|
37
|
+
Requires-Dist: shepherd-core[inventory]>=2025.08.1
|
|
38
38
|
Requires-Dist: tqdm
|
|
39
39
|
Provides-Extra: elf
|
|
40
40
|
Requires-Dist: shepherd-core[elf]; extra == "elf"
|
|
@@ -46,6 +46,8 @@ Requires-Dist: shepherd-core[test]; extra == "test"
|
|
|
46
46
|
Requires-Dist: pytest; extra == "test"
|
|
47
47
|
Requires-Dist: pytest-click; extra == "test"
|
|
48
48
|
Requires-Dist: coverage; extra == "test"
|
|
49
|
+
Provides-Extra: all
|
|
50
|
+
Requires-Dist: shepherd-data[dev,elf,test]; extra == "all"
|
|
49
51
|
|
|
50
52
|
# Shepherd-Data-Tool
|
|
51
53
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
shepherd_data/__init__.py,sha256=oEhjHkoauQ5UG6iosVocZ1DpmjIp_MfNtgAvVuj5L4c,353
|
|
2
|
+
shepherd_data/cli.py,sha256=CHlOIYMx1hcOukYUpK1LWrjj_7ESL0FKxJascVqnrqM,16118
|
|
3
|
+
shepherd_data/ivonne.py,sha256=vh0XyMoSjbanzy4sqpNfVo6DEnbWNJPRUgNKPfHP2Yc,11875
|
|
4
|
+
shepherd_data/mppt.py,sha256=y9gVIhMs-ZG3ScL9UQTc5n8T146B13Q5dA5sfqqfjg0,3999
|
|
5
|
+
shepherd_data/reader.py,sha256=jHDPmLCZ-wDiIAlpLkyjguMdcueJ-TbqL6Nq7AxzPu0,25997
|
|
6
|
+
shepherd_data-2025.8.1.dist-info/METADATA,sha256=BleD3ZIR6dUuFPPVPi9sgQkfZTyHT_gGj-6-ABuXhSw,3434
|
|
7
|
+
shepherd_data-2025.8.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
shepherd_data-2025.8.1.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
|
|
9
|
+
shepherd_data-2025.8.1.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
|
|
10
|
+
shepherd_data-2025.8.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
11
|
+
shepherd_data-2025.8.1.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
shepherd_data/__init__.py,sha256=0HoU3_Q8b3XcNieFrTsUETlr214rYk6k_t2HIqbwaIk,353
|
|
2
|
-
shepherd_data/cli.py,sha256=GjPkETMwZXHAxJETgDu6REsRAQPFe_gJVU-W-YPEWKI,15859
|
|
3
|
-
shepherd_data/ivonne.py,sha256=vh0XyMoSjbanzy4sqpNfVo6DEnbWNJPRUgNKPfHP2Yc,11875
|
|
4
|
-
shepherd_data/mppt.py,sha256=y9gVIhMs-ZG3ScL9UQTc5n8T146B13Q5dA5sfqqfjg0,3999
|
|
5
|
-
shepherd_data/reader.py,sha256=5uemJBos3QI1BE48Q4xSG_sPD-V0Pc4Y5SpaWmObLfU,25620
|
|
6
|
-
shepherd_data-2025.6.4.dist-info/METADATA,sha256=HHmW87by721iBs5czK6m3teisTXH5suTgJzFwOGRoDw,3355
|
|
7
|
-
shepherd_data-2025.6.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
shepherd_data-2025.6.4.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
|
|
9
|
-
shepherd_data-2025.6.4.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
|
|
10
|
-
shepherd_data-2025.6.4.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
11
|
-
shepherd_data-2025.6.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|