shepherd-data 2025.5.2__py3-none-any.whl → 2025.6.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 CHANGED
@@ -11,7 +11,7 @@ from shepherd_core import Writer
11
11
 
12
12
  from .reader import Reader
13
13
 
14
- __version__ = "2025.05.2"
14
+ __version__ = "2025.06.1"
15
15
 
16
16
  __all__ = [
17
17
  "Reader",
shepherd_data/cli.py CHANGED
@@ -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:
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shepherd_data
3
- Version: 2025.5.2
3
+ Version: 2025.6.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>
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.2
38
+ Requires-Dist: shepherd-core[inventory]>=2025.06.1
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,11 @@
1
+ shepherd_data/__init__.py,sha256=bvZJl9K4890vy2Yh2RLtr2V6u-BiEuznwjmQBN3ufcA,353
2
+ shepherd_data/cli.py,sha256=8CShRsqJ5w6_nirNKInFEwYGv0gG5caXVLzExSeRGL4,15902
3
+ shepherd_data/ivonne.py,sha256=sH7c2aj9i5ygkpw6xQbjRwrbl9wtU_Toj_ZFyJVywG8,11930
4
+ shepherd_data/mppt.py,sha256=y9gVIhMs-ZG3ScL9UQTc5n8T146B13Q5dA5sfqqfjg0,3999
5
+ shepherd_data/reader.py,sha256=LMHaLM8SKu8g8_CZOjZlQsOcOXkweP4cLPRf0dnJlhY,25735
6
+ shepherd_data-2025.6.1.dist-info/METADATA,sha256=xbpdRFOLuvo9ccWn6t5VK0v7v7sQ5hypbfrsFzK8hOg,3404
7
+ shepherd_data-2025.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ shepherd_data-2025.6.1.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
9
+ shepherd_data-2025.6.1.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
10
+ shepherd_data-2025.6.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
11
+ shepherd_data-2025.6.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- shepherd_data/__init__.py,sha256=smoL-HtpycktcveBdkayEDG7aGF2n08SccXwK7yhYow,353
2
- shepherd_data/cli.py,sha256=wunO1ZQktJ_-uTGVIfq-E-sD9nGJPYSAfw7Gw6dgXco,14740
3
- shepherd_data/ivonne.py,sha256=sH7c2aj9i5ygkpw6xQbjRwrbl9wtU_Toj_ZFyJVywG8,11930
4
- shepherd_data/mppt.py,sha256=y9gVIhMs-ZG3ScL9UQTc5n8T146B13Q5dA5sfqqfjg0,3999
5
- shepherd_data/reader.py,sha256=LMHaLM8SKu8g8_CZOjZlQsOcOXkweP4cLPRf0dnJlhY,25735
6
- shepherd_data-2025.5.2.dist-info/METADATA,sha256=ddL643nRP5_PT1qOe-p_Ir56XLM8CcG8YHe-13t_O2Q,3380
7
- shepherd_data-2025.5.2.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
8
- shepherd_data-2025.5.2.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
9
- shepherd_data-2025.5.2.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
10
- shepherd_data-2025.5.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
11
- shepherd_data-2025.5.2.dist-info/RECORD,,