shepherd-data 2025.4.1__tar.gz → 2025.4.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.
Files changed (28) hide show
  1. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/PKG-INFO +3 -4
  2. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/pyproject.toml +7 -4
  3. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data/__init__.py +1 -1
  4. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data/cli.py +1 -2
  5. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data/ivonne.py +6 -6
  6. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data/reader.py +9 -11
  7. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/PKG-INFO +3 -4
  8. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/requires.txt +1 -1
  9. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/README.md +0 -0
  10. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/setup.cfg +0 -0
  11. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data/mppt.py +0 -0
  12. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/SOURCES.txt +0 -0
  13. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/dependency_links.txt +0 -0
  14. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/entry_points.txt +0 -0
  15. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/top_level.txt +0 -0
  16. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/shepherd_data.egg-info/zip-safe +0 -0
  17. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli.py +0 -0
  18. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_downsample.py +0 -0
  19. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_extract.py +0 -0
  20. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_extract_gpio.py +0 -0
  21. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_extract_meta.py +0 -0
  22. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_extract_uart.py +0 -0
  23. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_plot.py +0 -0
  24. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_validate.py +0 -0
  25. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_cli_version.py +0 -0
  26. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_examples.py +0 -0
  27. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_ivonne.py +0 -0
  28. {shepherd_data-2025.4.1 → shepherd_data-2025.4.2}/tests/test_reader.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.4.1
3
+ Version: 2025.4.2
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>
@@ -18,7 +18,6 @@ Classifier: Development Status :: 5 - Production/Stable
18
18
  Classifier: Intended Audience :: Developers
19
19
  Classifier: Intended Audience :: Information Technology
20
20
  Classifier: Intended Audience :: Science/Research
21
- Classifier: Programming Language :: Python :: 3.8
22
21
  Classifier: Programming Language :: Python :: 3.9
23
22
  Classifier: Programming Language :: Python :: 3.10
24
23
  Classifier: Programming Language :: Python :: 3.11
@@ -27,7 +26,7 @@ Classifier: Programming Language :: Python :: 3.13
27
26
  Classifier: License :: OSI Approved :: MIT License
28
27
  Classifier: Operating System :: OS Independent
29
28
  Classifier: Natural Language :: English
30
- Requires-Python: >=3.8
29
+ Requires-Python: >=3.9
31
30
  Description-Content-Type: text/markdown
32
31
  Requires-Dist: click
33
32
  Requires-Dist: h5py
@@ -36,7 +35,7 @@ Requires-Dist: numpy
36
35
  Requires-Dist: pandas>=2.0.0
37
36
  Requires-Dist: pyYAML
38
37
  Requires-Dist: scipy
39
- Requires-Dist: shepherd-core[inventory]>=2025.04.1
38
+ Requires-Dist: shepherd-core[inventory]>=2025.04.2
40
39
  Requires-Dist: tqdm
41
40
  Provides-Extra: elf
42
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -18,7 +18,6 @@ classifiers = [
18
18
  "Intended Audience :: Developers",
19
19
  "Intended Audience :: Information Technology",
20
20
  "Intended Audience :: Science/Research",
21
- "Programming Language :: Python :: 3.8",
22
21
  "Programming Language :: Python :: 3.9",
23
22
  "Programming Language :: Python :: 3.10",
24
23
  "Programming Language :: Python :: 3.11",
@@ -29,7 +28,7 @@ classifiers = [
29
28
  "Natural Language :: English",
30
29
  ]
31
30
 
32
- requires-python = ">=3.8"
31
+ requires-python = ">=3.9"
33
32
  dependencies = [
34
33
  "click",
35
34
  "h5py",
@@ -38,7 +37,7 @@ dependencies = [
38
37
  "pandas>=2.0.0", # full-version, v2 is OK
39
38
  "pyYAML",
40
39
  "scipy", # full-version
41
- "shepherd-core[inventory]>=2025.04.1", # libs are strongly coupled
40
+ "shepherd-core[inventory]>=2025.04.2", # libs are strongly coupled
42
41
  "tqdm", # full-version
43
42
  ]
44
43
 
@@ -101,6 +100,10 @@ addopts = "-vvv --stepwise" # opts: verbose result for each tests
101
100
  source = ["shepherd_data"]
102
101
 
103
102
  [tool.mypy]
104
- python_version = 3.8
103
+ python_version = 3.9
105
104
  ignore_missing_imports = true
106
105
  disable_error_code = ["call-arg", ]
106
+ exclude = [
107
+ "build/",
108
+ ".egg-info/",
109
+ ]
@@ -11,7 +11,7 @@ from shepherd_core import Writer
11
11
 
12
12
  from .reader import Reader
13
13
 
14
- __version__ = "2025.04.1"
14
+ __version__ = "2025.04.2"
15
15
 
16
16
  __all__ = [
17
17
  "Reader",
@@ -5,7 +5,6 @@ import sys
5
5
  from contextlib import suppress
6
6
  from datetime import datetime
7
7
  from pathlib import Path
8
- from typing import List
9
8
  from typing import Optional
10
9
 
11
10
  import click
@@ -21,7 +20,7 @@ from .reader import Reader
21
20
  logger = logging.getLogger("SHPData.cli")
22
21
 
23
22
 
24
- def path_to_flist(data_path: Path, *, recurse: bool = False) -> List[Path]:
23
+ def path_to_flist(data_path: Path, *, recurse: bool = False) -> list[Path]:
25
24
  """Every path gets transformed to a list of paths.
26
25
 
27
26
  Transformations:
@@ -17,14 +17,14 @@ import pickle
17
17
  from pathlib import Path
18
18
  from types import TracebackType
19
19
  from typing import Optional
20
- from typing import Type
21
20
 
22
21
  import numpy as np
23
22
  import pandas as pd
24
23
  from tqdm import trange
25
24
  from typing_extensions import Self
26
25
 
27
- from . import Writer
26
+ from shepherd_core.writer import Writer as CoreWriter
27
+
28
28
  from .mppt import MPPTracker
29
29
  from .mppt import OptimalTracker
30
30
  from .mppt import iv_model
@@ -88,7 +88,7 @@ class Reader:
88
88
 
89
89
  def __exit__(
90
90
  self,
91
- typ: Optional[Type[BaseException]] = None,
91
+ typ: Optional[type[BaseException]] = None,
92
92
  exc: Optional[BaseException] = None,
93
93
  tb: Optional[TracebackType] = None,
94
94
  extra_arg: int = 0,
@@ -132,7 +132,7 @@ class Reader:
132
132
 
133
133
  v_proto = np.linspace(0, v_max, pts_per_curve)
134
134
 
135
- with Writer(shp_output, datatype="ivcurve", window_samples=pts_per_curve) as sfw:
135
+ with CoreWriter(shp_output, datatype="ivcurve", window_samples=pts_per_curve) as sfw:
136
136
  sfw.store_hostname("IVonne")
137
137
  curve_interval_us = round(sfw.sample_interval_ns * pts_per_curve / 1000)
138
138
  up_factor = self.sample_interval_ns // sfw.sample_interval_ns
@@ -207,7 +207,7 @@ class Reader:
207
207
  v_max,
208
208
  )
209
209
 
210
- with Writer(shp_output, datatype="ivsample") as sfw:
210
+ with CoreWriter(shp_output, datatype="ivsample") as sfw:
211
211
  sfw.store_hostname("IVonne")
212
212
  interval_us = round(sfw.sample_interval_ns / 1000)
213
213
  up_factor = self.sample_interval_ns // sfw.sample_interval_ns
@@ -260,7 +260,7 @@ class Reader:
260
260
  self._logger.info("File already exists, will skip '%s'", shp_output.name)
261
261
  return
262
262
 
263
- with Writer(shp_output, datatype="isc_voc") as sfw:
263
+ with CoreWriter(shp_output, datatype="isc_voc") as sfw:
264
264
  sfw.store_hostname("IVonne")
265
265
  interval_us = round(sfw.sample_interval_ns / 1000)
266
266
  up_factor = self.sample_interval_ns // sfw.sample_interval_ns
@@ -1,13 +1,11 @@
1
1
  """Reader-Baseclass for opening shepherds hdf5-files."""
2
2
 
3
3
  import math
4
+ from collections.abc import Mapping
5
+ from collections.abc import Sequence
4
6
  from datetime import datetime
5
7
  from pathlib import Path
6
- from typing import Dict
7
- from typing import List
8
- from typing import Mapping
9
8
  from typing import Optional
10
- from typing import Sequence
11
9
  from typing import Union
12
10
 
13
11
  import h5py
@@ -36,9 +34,9 @@ class Reader(CoreReader):
36
34
 
37
35
  def __init__(
38
36
  self,
39
- file_path: Optional[Path],
37
+ file_path: Path,
40
38
  *,
41
- verbose: Optional[bool] = True,
39
+ verbose: bool = True,
42
40
  ) -> None:
43
41
  super().__init__(file_path, verbose=verbose)
44
42
 
@@ -59,13 +57,13 @@ class Reader(CoreReader):
59
57
  if csv_path.exists():
60
58
  self._logger.info("File already exists, will skip '%s'", csv_path.name)
61
59
  return 0
62
- datasets: List[str] = [
60
+ datasets: list[str] = [
63
61
  str(key) for key in h5_group if isinstance(h5_group[key], h5py.Dataset)
64
62
  ]
65
63
  datasets.remove("time")
66
64
  datasets = ["time", *datasets]
67
65
  separator = separator.strip().ljust(2)
68
- header_elements: List[str] = [
66
+ header_elements: list[str] = [
69
67
  str(h5_group[key].attrs["description"]).replace(", ", separator) for key in datasets
70
68
  ]
71
69
  header: str = separator.join(header_elements)
@@ -74,10 +72,10 @@ class Reader(CoreReader):
74
72
  csv_file.write(header + "\n")
75
73
  ts_gain = h5_group["time"].attrs.get("gain", 1e-9)
76
74
  # for converting data to si - if raw=false
77
- gains: Dict[str, float] = {
75
+ gains: dict[str, float] = {
78
76
  key: h5_group[key].attrs.get("gain", 1.0) for key in datasets[1:]
79
77
  }
80
- offsets: Dict[str, float] = {
78
+ offsets: dict[str, float] = {
81
79
  key: h5_group[key].attrs.get("offset", 1.0) for key in datasets[1:]
82
80
  }
83
81
  for idx, time_ns in enumerate(h5_group["time"][:]):
@@ -460,7 +458,7 @@ class Reader(CoreReader):
460
458
  end_s: Optional[float] = None,
461
459
  *,
462
460
  relative_timestamp: bool = True,
463
- ) -> Optional[Dict]:
461
+ ) -> Optional[dict]:
464
462
  """Provide down-sampled iv-data that can be fed into plot_to_file().
465
463
 
466
464
  :param start_s: time in seconds, relative to start of recording
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.4.1
3
+ Version: 2025.4.2
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>
@@ -18,7 +18,6 @@ Classifier: Development Status :: 5 - Production/Stable
18
18
  Classifier: Intended Audience :: Developers
19
19
  Classifier: Intended Audience :: Information Technology
20
20
  Classifier: Intended Audience :: Science/Research
21
- Classifier: Programming Language :: Python :: 3.8
22
21
  Classifier: Programming Language :: Python :: 3.9
23
22
  Classifier: Programming Language :: Python :: 3.10
24
23
  Classifier: Programming Language :: Python :: 3.11
@@ -27,7 +26,7 @@ Classifier: Programming Language :: Python :: 3.13
27
26
  Classifier: License :: OSI Approved :: MIT License
28
27
  Classifier: Operating System :: OS Independent
29
28
  Classifier: Natural Language :: English
30
- Requires-Python: >=3.8
29
+ Requires-Python: >=3.9
31
30
  Description-Content-Type: text/markdown
32
31
  Requires-Dist: click
33
32
  Requires-Dist: h5py
@@ -36,7 +35,7 @@ Requires-Dist: numpy
36
35
  Requires-Dist: pandas>=2.0.0
37
36
  Requires-Dist: pyYAML
38
37
  Requires-Dist: scipy
39
- Requires-Dist: shepherd-core[inventory]>=2025.04.1
38
+ Requires-Dist: shepherd-core[inventory]>=2025.04.2
40
39
  Requires-Dist: tqdm
41
40
  Provides-Extra: elf
42
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -5,7 +5,7 @@ numpy
5
5
  pandas>=2.0.0
6
6
  pyYAML
7
7
  scipy
8
- shepherd-core[inventory]>=2025.04.1
8
+ shepherd-core[inventory]>=2025.04.2
9
9
  tqdm
10
10
 
11
11
  [dev]