shepherd-data 2025.5.3__tar.gz → 2025.6.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 (29) hide show
  1. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/PKG-INFO +11 -11
  2. shepherd_data-2025.6.2/README.md +38 -0
  3. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/pyproject.toml +2 -2
  4. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data/__init__.py +1 -1
  5. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data/cli.py +49 -12
  6. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data/reader.py +4 -4
  7. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/PKG-INFO +11 -11
  8. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/requires.txt +1 -1
  9. shepherd_data-2025.5.3/README.md +0 -38
  10. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/setup.cfg +0 -0
  11. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data/ivonne.py +0 -0
  12. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data/mppt.py +0 -0
  13. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/SOURCES.txt +0 -0
  14. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/dependency_links.txt +0 -0
  15. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/entry_points.txt +0 -0
  16. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/top_level.txt +0 -0
  17. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/shepherd_data.egg-info/zip-safe +0 -0
  18. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli.py +0 -0
  19. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_downsample.py +0 -0
  20. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_extract.py +0 -0
  21. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_extract_gpio.py +0 -0
  22. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_extract_meta.py +0 -0
  23. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_extract_uart.py +0 -0
  24. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_plot.py +0 -0
  25. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_validate.py +0 -0
  26. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_cli_version.py +0 -0
  27. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_examples.py +0 -0
  28. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_ivonne.py +0 -0
  29. {shepherd_data-2025.5.3 → shepherd_data-2025.6.2}/tests/test_reader.py +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.5.3
3
+ Version: 2025.6.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>
7
- Project-URL: Documentation, https://github.com/orgua/shepherd-datalib/blob/main/README.md
7
+ Project-URL: Documentation, https://github.com/nes-lab/shepherd-tools/blob/main/README.md
8
8
  Project-URL: Issues, https://pypi.org/project/shepherd-data/issues
9
9
  Project-URL: Source, https://pypi.org/project/shepherd-data/
10
10
  Keywords: testbed,beaglebone,pru,batteryless,energyharvesting,solar
@@ -35,7 +35,7 @@ Requires-Dist: numpy
35
35
  Requires-Dist: pandas>=2.0.0
36
36
  Requires-Dist: pyYAML
37
37
  Requires-Dist: scipy
38
- Requires-Dist: shepherd-core[inventory]>=2025.05.3
38
+ Requires-Dist: shepherd-core[inventory]>=2025.06.2
39
39
  Requires-Dist: tqdm
40
40
  Provides-Extra: elf
41
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -50,20 +50,20 @@ Requires-Dist: coverage; extra == "test"
50
50
 
51
51
  # Shepherd-Data-Tool
52
52
 
53
- [![PyPiVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
53
+ [![PyPIVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
54
54
  [![image](https://img.shields.io/pypi/pyversions/shepherd_data.svg)](https://pypi.python.org/pypi/shepherd-data)
55
- [![Pytest](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml/badge.svg)](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml)
55
+ [![QA-Tests](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml/badge.svg)](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml)
56
56
  [![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
57
57
 
58
- **Main Documentation**: <https://orgua.github.io/shepherd>
58
+ **Main Documentation**: <https://nes-lab.github.io/shepherd>
59
59
 
60
- **Source Code**: <https://github.com/orgua/shepherd-datalib>
60
+ **Source Code**: <https://github.com/nes-lab/shepherd-tools>
61
61
 
62
- **Main Project**: <https://github.com/orgua/shepherd>
62
+ **Main Project**: <https://github.com/nes-lab/shepherd>
63
63
 
64
64
  ---
65
65
 
66
- `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/orgua/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
66
+ `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/nes-lab/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
67
67
 
68
68
  ## Installation
69
69
 
@@ -76,12 +76,12 @@ pip3 install shepherd-data -U
76
76
  For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
77
77
 
78
78
  ```Shell
79
- pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_data -U
79
+ pip install git+https://github.com/nes-lab/shepherd-tools.git@dev#subdirectory=shepherd_data -U
80
80
  ```
81
81
 
82
82
  ## More
83
83
 
84
- Please consult the [official documentation](https://orgua.github.io/shepherd) for more, it covers:
84
+ Please consult the [official documentation](https://nes-lab.github.io/shepherd) for more, it covers:
85
85
 
86
86
  - general context
87
87
  - command-line interface
@@ -0,0 +1,38 @@
1
+ # Shepherd-Data-Tool
2
+
3
+ [![PyPIVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
4
+ [![image](https://img.shields.io/pypi/pyversions/shepherd_data.svg)](https://pypi.python.org/pypi/shepherd-data)
5
+ [![QA-Tests](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml/badge.svg)](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml)
6
+ [![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
7
+
8
+ **Main Documentation**: <https://nes-lab.github.io/shepherd>
9
+
10
+ **Source Code**: <https://github.com/nes-lab/shepherd-tools>
11
+
12
+ **Main Project**: <https://github.com/nes-lab/shepherd>
13
+
14
+ ---
15
+
16
+ `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/nes-lab/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
17
+
18
+ ## Installation
19
+
20
+ ### PIP - Online
21
+
22
+ ```shell
23
+ pip3 install shepherd-data -U
24
+ ```
25
+
26
+ For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
27
+
28
+ ```Shell
29
+ pip install git+https://github.com/nes-lab/shepherd-tools.git@dev#subdirectory=shepherd_data -U
30
+ ```
31
+
32
+ ## More
33
+
34
+ Please consult the [official documentation](https://nes-lab.github.io/shepherd) for more, it covers:
35
+
36
+ - general context
37
+ - command-line interface
38
+ - programming interface
@@ -37,7 +37,7 @@ dependencies = [
37
37
  "pandas>=2.0.0", # full-version, v2 is OK
38
38
  "pyYAML",
39
39
  "scipy", # full-version
40
- "shepherd-core[inventory]>=2025.05.3", # libs are strongly coupled
40
+ "shepherd-core[inventory]>=2025.06.2", # libs are strongly coupled
41
41
  "tqdm", # full-version
42
42
  ]
43
43
 
@@ -59,7 +59,7 @@ test = [
59
59
  ]
60
60
 
61
61
  [project.urls]
62
- Documentation = "https://github.com/orgua/shepherd-datalib/blob/main/README.md"
62
+ Documentation = "https://github.com/nes-lab/shepherd-tools/blob/main/README.md"
63
63
  Issues = "https://pypi.org/project/shepherd-data/issues"
64
64
  Source = "https://pypi.org/project/shepherd-data/"
65
65
 
@@ -11,7 +11,7 @@ from shepherd_core import Writer
11
11
 
12
12
  from .reader import Reader
13
13
 
14
- __version__ = "2025.05.3"
14
+ __version__ = "2025.06.2"
15
15
 
16
16
  __all__ = [
17
17
  "Reader",
@@ -177,7 +177,15 @@ def extract(
177
177
  is_flag=True,
178
178
  help="Also consider files in sub-folders",
179
179
  )
180
- def extract_meta(in_data: Path, separator: str, *, recurse: bool = False) -> None:
180
+ @click.option(
181
+ "--debug",
182
+ "-d",
183
+ is_flag=True,
184
+ help="Also extract system logs like kernel, ",
185
+ )
186
+ def extract_meta(
187
+ in_data: Path, separator: str, *, recurse: bool = False, debug: bool = False
188
+ ) -> None:
181
189
  """Extract metadata and logs from file or directory containing shepherd-recordings."""
182
190
  files = path_to_flist(in_data, recurse=recurse)
183
191
  verbose_level = get_verbose_level()
@@ -188,25 +196,54 @@ def extract_meta(in_data: Path, separator: str, *, recurse: bool = False) -> Non
188
196
  try:
189
197
  with Reader(file, verbose=verbose_level > 2) as shpr:
190
198
  shpr.save_metadata()
191
- csvs_depr = ["sysutil", "timesync"]
192
- csvs = ["ptp", "phc2sys", "sys_util", "pru_util"]
193
- for element in csvs + csvs_depr:
194
- if element in shpr.h5file:
195
- shpr.save_csv(shpr[element], separator)
199
+ if "uart" in shpr.h5file:
200
+ shpr.save_log(shpr["uart"])
201
+
196
202
  logs_depr = ["shepherd-log", "dmesg", "exceptions"]
197
- logs = ["sheep", "kernel", "ntp", "uart"]
198
- for element in logs + logs_depr:
203
+ logs_meta = ["sheep", "kernel", "ntp"]
204
+ for element in logs_meta + logs_depr:
199
205
  if element in shpr.h5file:
200
- shpr.save_log(shpr[element])
206
+ if debug:
207
+ shpr.save_log(shpr[element])
201
208
  # TODO: allow omitting timestamp,
202
209
  # also test if segmented uart is correctly written
203
210
  shpr.warn_logs(element, show=True)
211
+ if not debug:
212
+ continue
213
+ csv_depr = ["sysutil", "timesync"]
214
+ csv_meta = ["ptp", "phc2sys", "sys_util", "pru_util"]
215
+ for element in csv_meta + csv_depr:
216
+ if element in shpr.h5file:
217
+ shpr.save_csv(shpr[element], separator)
218
+ except TypeError:
219
+ logger.exception("ERROR: Will skip file. It caused an exception.")
220
+
221
+
222
+ @cli.command()
223
+ @click.argument("in_data", type=click.Path(exists=True, resolve_path=True))
224
+ @click.option(
225
+ "--recurse",
226
+ "-a",
227
+ is_flag=True,
228
+ help="Also consider files in sub-folders",
229
+ )
230
+ def extract_uart(in_data: Path, *, recurse: bool = False) -> None:
231
+ """Log from file or directory containing shepherd-recordings."""
232
+ files = path_to_flist(in_data, recurse=recurse)
233
+ verbose_level = get_verbose_level()
234
+ for file in files:
235
+ logger.info("Extracting UART-log from '%s' ...", file.name)
236
+ try:
237
+ with Reader(file, verbose=verbose_level > 2) as shpr:
238
+ shpr.save_metadata()
239
+ if "uart" in shpr.h5file:
240
+ shpr.save_log(shpr["uart"])
204
241
  except TypeError:
205
242
  logger.exception("ERROR: Will skip file. It caused an exception.")
206
243
 
207
244
 
208
245
  @cli.command(
209
- short_help="Extracts uart from gpio-trace in file or directory containing shepherd-recordings"
246
+ short_help="Decode uart from gpio-trace in file or directory containing shepherd-recordings"
210
247
  )
211
248
  @click.argument("in_data", type=click.Path(exists=True, resolve_path=True))
212
249
  @click.option(
@@ -215,8 +252,8 @@ def extract_meta(in_data: Path, separator: str, *, recurse: bool = False) -> Non
215
252
  is_flag=True,
216
253
  help="Also consider files in sub-folders",
217
254
  )
218
- def extract_uart(in_data: Path, *, recurse: bool = False) -> None:
219
- """Extract UART from GPIO-trace in file or directory containing shepherd-recordings."""
255
+ def decode_uart(in_data: Path, *, recurse: bool = False) -> None:
256
+ """Decode UART from GPIO-trace in file or directory containing shepherd-recordings."""
220
257
  files = path_to_flist(in_data, recurse=recurse)
221
258
  verbose_level = get_verbose_level()
222
259
  for file in files:
@@ -18,7 +18,7 @@ from shepherd_core import Writer as CoreWriter
18
18
  from shepherd_core import local_tz
19
19
  from shepherd_core.data_models import EnergyDType
20
20
  from shepherd_core.logger import get_verbose_level
21
- from shepherd_core.logger import logger
21
+ from shepherd_core.logger import log
22
22
 
23
23
  # import samplerate # noqa: ERA001, TODO: just a test-fn for now
24
24
 
@@ -308,12 +308,12 @@ class Reader(CoreReader):
308
308
 
309
309
  dst_file = self.file_path.resolve().with_suffix(cut_str + ds_str + ".h5")
310
310
  if dst_file.exists():
311
- logger.warning(
311
+ self._logger.warning(
312
312
  "Cut & Downsample skipped because output-file %s already exists.", dst_file.name
313
313
  )
314
314
  return dst_file
315
315
 
316
- logger.debug(
316
+ self._logger.debug(
317
317
  "Cut & Downsample '%s' from %.3f s to %.3f s with factor = %.1f ...",
318
318
  self.file_path.name,
319
319
  start_s,
@@ -635,7 +635,7 @@ class Reader(CoreReader):
635
635
  Path(plot_path).resolve().with_suffix(f".multiplot_{start_str}_to_{end_str}.png")
636
636
  )
637
637
  if plot_path.exists():
638
- logger.warning("Plot exists, will skip & not overwrite!")
638
+ log.warning("Plot exists, will skip & not overwrite!")
639
639
  return None
640
640
  fig = Reader.assemble_plot(data, width, height, only_pwr=only_pwr)
641
641
  plt.savefig(plot_path)
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.5.3
3
+ Version: 2025.6.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>
7
- Project-URL: Documentation, https://github.com/orgua/shepherd-datalib/blob/main/README.md
7
+ Project-URL: Documentation, https://github.com/nes-lab/shepherd-tools/blob/main/README.md
8
8
  Project-URL: Issues, https://pypi.org/project/shepherd-data/issues
9
9
  Project-URL: Source, https://pypi.org/project/shepherd-data/
10
10
  Keywords: testbed,beaglebone,pru,batteryless,energyharvesting,solar
@@ -35,7 +35,7 @@ Requires-Dist: numpy
35
35
  Requires-Dist: pandas>=2.0.0
36
36
  Requires-Dist: pyYAML
37
37
  Requires-Dist: scipy
38
- Requires-Dist: shepherd-core[inventory]>=2025.05.3
38
+ Requires-Dist: shepherd-core[inventory]>=2025.06.2
39
39
  Requires-Dist: tqdm
40
40
  Provides-Extra: elf
41
41
  Requires-Dist: shepherd-core[elf]; extra == "elf"
@@ -50,20 +50,20 @@ Requires-Dist: coverage; extra == "test"
50
50
 
51
51
  # Shepherd-Data-Tool
52
52
 
53
- [![PyPiVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
53
+ [![PyPIVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
54
54
  [![image](https://img.shields.io/pypi/pyversions/shepherd_data.svg)](https://pypi.python.org/pypi/shepherd-data)
55
- [![Pytest](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml/badge.svg)](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml)
55
+ [![QA-Tests](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml/badge.svg)](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml)
56
56
  [![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
57
57
 
58
- **Main Documentation**: <https://orgua.github.io/shepherd>
58
+ **Main Documentation**: <https://nes-lab.github.io/shepherd>
59
59
 
60
- **Source Code**: <https://github.com/orgua/shepherd-datalib>
60
+ **Source Code**: <https://github.com/nes-lab/shepherd-tools>
61
61
 
62
- **Main Project**: <https://github.com/orgua/shepherd>
62
+ **Main Project**: <https://github.com/nes-lab/shepherd>
63
63
 
64
64
  ---
65
65
 
66
- `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/orgua/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
66
+ `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/nes-lab/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
67
67
 
68
68
  ## Installation
69
69
 
@@ -76,12 +76,12 @@ pip3 install shepherd-data -U
76
76
  For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
77
77
 
78
78
  ```Shell
79
- pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_data -U
79
+ pip install git+https://github.com/nes-lab/shepherd-tools.git@dev#subdirectory=shepherd_data -U
80
80
  ```
81
81
 
82
82
  ## More
83
83
 
84
- Please consult the [official documentation](https://orgua.github.io/shepherd) for more, it covers:
84
+ Please consult the [official documentation](https://nes-lab.github.io/shepherd) for more, it covers:
85
85
 
86
86
  - general context
87
87
  - command-line interface
@@ -5,7 +5,7 @@ numpy
5
5
  pandas>=2.0.0
6
6
  pyYAML
7
7
  scipy
8
- shepherd-core[inventory]>=2025.05.3
8
+ shepherd-core[inventory]>=2025.06.2
9
9
  tqdm
10
10
 
11
11
  [dev]
@@ -1,38 +0,0 @@
1
- # Shepherd-Data-Tool
2
-
3
- [![PyPiVersion](https://img.shields.io/pypi/v/shepherd_data.svg)](https://pypi.org/project/shepherd_data)
4
- [![image](https://img.shields.io/pypi/pyversions/shepherd_data.svg)](https://pypi.python.org/pypi/shepherd-data)
5
- [![Pytest](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml/badge.svg)](https://github.com/orgua/shepherd-datalib/actions/workflows/py_unittest.yml)
6
- [![CodeStyle](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
7
-
8
- **Main Documentation**: <https://orgua.github.io/shepherd>
9
-
10
- **Source Code**: <https://github.com/orgua/shepherd-datalib>
11
-
12
- **Main Project**: <https://github.com/orgua/shepherd>
13
-
14
- ---
15
-
16
- `shepherd-data` eases the handling of hdf5-recordings used by the [shepherd](https://github.com/orgua/shepherd)-testbed. Users can read, validate and create files and also extract, down-sample and plot information.
17
-
18
- ## Installation
19
-
20
- ### PIP - Online
21
-
22
- ```shell
23
- pip3 install shepherd-data -U
24
- ```
25
-
26
- For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
27
-
28
- ```Shell
29
- pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_data -U
30
- ```
31
-
32
- ## More
33
-
34
- Please consult the [official documentation](https://orgua.github.io/shepherd) for more, it covers:
35
-
36
- - general context
37
- - command-line interface
38
- - programming interface