shepherd-data 2025.5.3__py3-none-any.whl → 2025.6.2__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 +49 -12
- shepherd_data/reader.py +4 -4
- {shepherd_data-2025.5.3.dist-info → shepherd_data-2025.6.2.dist-info}/METADATA +11 -11
- shepherd_data-2025.6.2.dist-info/RECORD +11 -0
- {shepherd_data-2025.5.3.dist-info → shepherd_data-2025.6.2.dist-info}/WHEEL +1 -1
- shepherd_data-2025.5.3.dist-info/RECORD +0 -11
- {shepherd_data-2025.5.3.dist-info → shepherd_data-2025.6.2.dist-info}/entry_points.txt +0 -0
- {shepherd_data-2025.5.3.dist-info → shepherd_data-2025.6.2.dist-info}/top_level.txt +0 -0
- {shepherd_data-2025.5.3.dist-info → shepherd_data-2025.6.2.dist-info}/zip-safe +0 -0
shepherd_data/__init__.py
CHANGED
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
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
198
|
-
for element in
|
|
203
|
+
logs_meta = ["sheep", "kernel", "ntp"]
|
|
204
|
+
for element in logs_meta + logs_depr:
|
|
199
205
|
if element in shpr.h5file:
|
|
200
|
-
|
|
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="
|
|
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
|
|
219
|
-
"""
|
|
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:
|
shepherd_data/reader.py
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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/
|
|
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.
|
|
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
|
-
[](https://pypi.org/project/shepherd_data)
|
|
54
54
|
[](https://pypi.python.org/pypi/shepherd-data)
|
|
55
|
-
[](https://github.com/nes-lab/shepherd-tools/actions/workflows/quality_assurance.yaml)
|
|
56
56
|
[](https://github.com/astral-sh/ruff)
|
|
57
57
|
|
|
58
|
-
**Main Documentation**: <https://
|
|
58
|
+
**Main Documentation**: <https://nes-lab.github.io/shepherd>
|
|
59
59
|
|
|
60
|
-
**Source Code**: <https://github.com/
|
|
60
|
+
**Source Code**: <https://github.com/nes-lab/shepherd-tools>
|
|
61
61
|
|
|
62
|
-
**Main Project**: <https://github.com/
|
|
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/
|
|
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/
|
|
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://
|
|
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=oxMTandwVdRsPlpP4PwVgMMbH5gKuZnOlM88Wgxy3aE,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=NEIwXC5f5fkSiBEsyY85gIcgjhYHFS1tavNnA6ViE3k,25741
|
|
6
|
+
shepherd_data-2025.6.2.dist-info/METADATA,sha256=D8yzzlUl9GeZjRycigoNOWRF3NdyLLLI9Mcj85s4jVU,3404
|
|
7
|
+
shepherd_data-2025.6.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
shepherd_data-2025.6.2.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
|
|
9
|
+
shepherd_data-2025.6.2.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
|
|
10
|
+
shepherd_data-2025.6.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
11
|
+
shepherd_data-2025.6.2.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
shepherd_data/__init__.py,sha256=E2ezai4Jqp6DG_BbCxt2ak8pf9N5S_QJ7ia9ICf1BUc,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.3.dist-info/METADATA,sha256=FAabfAxowIM36FReB9DjfJ3o2H3EKgwoyel5kMKIwUw,3380
|
|
7
|
-
shepherd_data-2025.5.3.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
8
|
-
shepherd_data-2025.5.3.dist-info/entry_points.txt,sha256=6PBfY36A1xNOdzLiz-Qoukya_UzFZAwOapwmRNnPeZ8,56
|
|
9
|
-
shepherd_data-2025.5.3.dist-info/top_level.txt,sha256=7-SCTY-TG1mLY72OVKCaqte1hy-X8woxknIUAD3OIxs,14
|
|
10
|
-
shepherd_data-2025.5.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
11
|
-
shepherd_data-2025.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|