shepherd-data 2025.6.4__tar.gz → 2025.10.1__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.
Files changed (28) hide show
  1. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/PKG-INFO +5 -2
  2. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/pyproject.toml +3 -1
  3. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data/__init__.py +1 -1
  4. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data/cli.py +21 -17
  5. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data/ivonne.py +1 -2
  6. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data/reader.py +23 -15
  7. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/PKG-INFO +5 -2
  8. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/requires.txt +4 -1
  9. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli.py +0 -1
  10. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_downsample.py +0 -1
  11. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_extract.py +0 -1
  12. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_extract_gpio.py +0 -1
  13. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_extract_meta.py +0 -1
  14. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_extract_uart.py +0 -1
  15. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_plot.py +0 -1
  16. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_validate.py +0 -1
  17. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_cli_version.py +0 -1
  18. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_examples.py +1 -0
  19. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/README.md +0 -0
  20. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/setup.cfg +0 -0
  21. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data/mppt.py +0 -0
  22. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/SOURCES.txt +0 -0
  23. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/dependency_links.txt +0 -0
  24. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/entry_points.txt +0 -0
  25. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/top_level.txt +0 -0
  26. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/shepherd_data.egg-info/zip-safe +0 -0
  27. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_ivonne.py +0 -0
  28. {shepherd_data-2025.6.4 → shepherd_data-2025.10.1}/tests/test_reader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.6.4
3
+ Version: 2025.10.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>
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
25
26
  Classifier: License :: OSI Approved :: MIT License
26
27
  Classifier: Operating System :: OS Independent
27
28
  Classifier: Natural Language :: English
@@ -34,7 +35,7 @@ Requires-Dist: numpy
34
35
  Requires-Dist: pandas>=2.0.0
35
36
  Requires-Dist: pyYAML
36
37
  Requires-Dist: scipy
37
- Requires-Dist: shepherd-core[inventory]>=2025.06.4
38
+ Requires-Dist: shepherd-core[inventory]>=2025.09.1
38
39
  Requires-Dist: tqdm
39
40
  Provides-Extra: elf
40
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -46,6 +47,8 @@ Requires-Dist: shepherd-core[test]; extra == "test"
46
47
  Requires-Dist: pytest; extra == "test"
47
48
  Requires-Dist: pytest-click; extra == "test"
48
49
  Requires-Dist: coverage; extra == "test"
50
+ Provides-Extra: all
51
+ Requires-Dist: shepherd-data[dev,elf,test]; extra == "all"
49
52
 
50
53
  # Shepherd-Data-Tool
51
54
 
@@ -22,6 +22,7 @@ classifiers = [
22
22
  "Programming Language :: Python :: 3.11",
23
23
  "Programming Language :: Python :: 3.12",
24
24
  "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
25
26
  "License :: OSI Approved :: MIT License",
26
27
  "Operating System :: OS Independent",
27
28
  "Natural Language :: English",
@@ -36,7 +37,7 @@ dependencies = [
36
37
  "pandas>=2.0.0", # full-version, v2 is OK
37
38
  "pyYAML",
38
39
  "scipy", # full-version
39
- "shepherd-core[inventory]>=2025.06.4", # libs are strongly coupled
40
+ "shepherd-core[inventory]>=2025.09.1", # libs are strongly coupled
40
41
  "tqdm", # full-version
41
42
  ]
42
43
 
@@ -56,6 +57,7 @@ test = [
56
57
  "pytest-click",
57
58
  "coverage",
58
59
  ]
60
+ all = ["shepherd-data[elf,dev,test]"]
59
61
 
60
62
  [project.urls]
61
63
  Documentation = "https://github.com/nes-lab/shepherd-tools/blob/main/README.md"
@@ -11,7 +11,7 @@ from shepherd_core import Writer
11
11
 
12
12
  from .reader import Reader
13
13
 
14
- __version__ = "2025.06.4"
14
+ __version__ = "2025.10.1"
15
15
 
16
16
  __all__ = [
17
17
  "Reader",
@@ -7,13 +7,11 @@ from datetime import datetime
7
7
  from pathlib import Path
8
8
 
9
9
  import click
10
- import pydantic
10
+ from shepherd_core.logger import set_log_verbose_level
11
11
 
12
12
  from shepherd_core import get_verbose_level
13
13
  from shepherd_core import local_tz
14
- 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
- logger.info("Shepherd-Data v%s", __version__)
58
+ from importlib import metadata # noqa: PLC0415
59
+
61
60
  logger.debug("Python v%s", sys.version)
62
- logger.debug("Click v%s", click.__version__)
63
- logger.debug("Pydantic v%s", pydantic.__version__)
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
- "-a",
73
+ "-R",
71
74
  is_flag=True,
72
75
  help="Also consider files in sub-folders",
73
76
  )
@@ -105,7 +108,7 @@ def validate(in_data: Path, *, recurse: bool = False) -> None:
105
108
  "-e",
106
109
  default=None,
107
110
  type=click.FLOAT,
108
- help="End-point in seconds, will be max if omitted",
111
+ help="End-point in seconds, will be maximum if omitted",
109
112
  )
110
113
  @click.option(
111
114
  "--ds-factor",
@@ -128,7 +131,7 @@ def validate(in_data: Path, *, recurse: bool = False) -> None:
128
131
  )
129
132
  @click.option(
130
133
  "--recurse",
131
- "-a",
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
- "-a",
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
- "-a",
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
- "-a",
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
- "-a",
299
+ "-R",
297
300
  is_flag=True,
298
301
  help="Also consider files in sub-folders",
299
302
  )
@@ -342,11 +345,11 @@ def extract_gpio(in_data: Path, separator: str, *, recurse: bool = False) -> Non
342
345
  "-e",
343
346
  default=None,
344
347
  type=click.FLOAT,
345
- help="End-point in seconds, will be max if omitted",
348
+ help="End-point in seconds, will be maximum if omitted",
346
349
  )
347
350
  @click.option(
348
351
  "--recurse",
349
- "-a",
352
+ "-R",
350
353
  is_flag=True,
351
354
  help="Also consider files in sub-folders",
352
355
  )
@@ -394,7 +397,7 @@ def downsample(
394
397
  "-e",
395
398
  default=None,
396
399
  type=click.FLOAT,
397
- help="End-point in seconds, will be max if omitted",
400
+ help="End-point in seconds, will be maximum if omitted",
398
401
  )
399
402
  @click.option(
400
403
  "--width",
@@ -424,10 +427,11 @@ def downsample(
424
427
  )
425
428
  @click.option(
426
429
  "--recurse",
427
- "-a",
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,
@@ -19,11 +19,10 @@ from types import TracebackType
19
19
 
20
20
  import numpy as np
21
21
  import pandas as pd
22
+ from shepherd_core.writer import Writer as CoreWriter
22
23
  from tqdm import trange
23
24
  from typing_extensions import Self
24
25
 
25
- from shepherd_core.writer import Writer as CoreWriter
26
-
27
26
  from .mppt import MPPTracker
28
27
  from .mppt import OptimalTracker
29
28
  from .mppt import iv_model
@@ -9,14 +9,14 @@ from pathlib import Path
9
9
  import h5py
10
10
  import numpy as np
11
11
  from matplotlib import pyplot as plt
12
+ from shepherd_core.data_models import EnergyDType
13
+ from shepherd_core.logger import get_verbose_level
14
+ from shepherd_core.logger import log
12
15
  from tqdm import trange
13
16
 
14
17
  from shepherd_core import Reader as CoreReader
15
18
  from shepherd_core import Writer as CoreWriter
16
19
  from shepherd_core import local_tz
17
- from shepherd_core.data_models import EnergyDType
18
- from shepherd_core.logger import get_verbose_level
19
- from shepherd_core.logger import log
20
20
 
21
21
  # import samplerate # noqa: ERA001, TODO: just a test-fn for now
22
22
 
@@ -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
- from scipy import signal # here due to massive delay
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
- if isinstance(end_n, (int, float)):
195
- _end_n = min(data_src.shape[0], round(end_n))
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
- _end_n = data_src.shape[0]
201
+ end_n = data_src.shape[0]
198
202
 
199
- start_n = min(_end_n, round(start_n))
200
- data_len = _end_n - start_n # TODO: one-off to calculation below ?
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(end_n, (int, float)):
384
- _end_n = min(data_src.shape[0], round(end_n))
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
- _end_n = data_src.shape[0]
394
+ end_n = data_src.shape[0]
387
395
 
388
- start_n = min(_end_n, round(start_n))
389
- data_len = _end_n - start_n
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.6.4
3
+ Version: 2025.10.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>
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
24
  Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
25
26
  Classifier: License :: OSI Approved :: MIT License
26
27
  Classifier: Operating System :: OS Independent
27
28
  Classifier: Natural Language :: English
@@ -34,7 +35,7 @@ Requires-Dist: numpy
34
35
  Requires-Dist: pandas>=2.0.0
35
36
  Requires-Dist: pyYAML
36
37
  Requires-Dist: scipy
37
- Requires-Dist: shepherd-core[inventory]>=2025.06.4
38
+ Requires-Dist: shepherd-core[inventory]>=2025.09.1
38
39
  Requires-Dist: tqdm
39
40
  Provides-Extra: elf
40
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -46,6 +47,8 @@ Requires-Dist: shepherd-core[test]; extra == "test"
46
47
  Requires-Dist: pytest; extra == "test"
47
48
  Requires-Dist: pytest-click; extra == "test"
48
49
  Requires-Dist: coverage; extra == "test"
50
+ Provides-Extra: all
51
+ Requires-Dist: shepherd-data[dev,elf,test]; extra == "all"
49
52
 
50
53
  # Shepherd-Data-Tool
51
54
 
@@ -5,9 +5,12 @@ numpy
5
5
  pandas>=2.0.0
6
6
  pyYAML
7
7
  scipy
8
- shepherd-core[inventory]>=2025.06.4
8
+ shepherd-core[inventory]>=2025.09.1
9
9
  tqdm
10
10
 
11
+ [all]
12
+ shepherd-data[dev,elf,test]
13
+
11
14
  [dev]
12
15
  shepherd-core[dev]
13
16
  pandas-stubs
@@ -1,5 +1,4 @@
1
1
  from click.testing import CliRunner
2
-
3
2
  from shepherd_data.cli import cli
4
3
 
5
4
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
  from .conftest import generate_h5_file
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -1,7 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
3
  from click.testing import CliRunner
4
-
5
4
  from shepherd_data.cli import cli
6
5
 
7
6
 
@@ -14,6 +14,7 @@ def example_path() -> Path:
14
14
 
15
15
 
16
16
  examples = [
17
+ # could be automatic discovery, but this allows ordered exec
17
18
  "convert_ivonne.py",
18
19
  "extract_logs.py",
19
20
  "generate_sawtooth.py",