shepherd-core 2024.5.1__tar.gz → 2024.7.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.
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/PKG-INFO +1 -2
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/pyproject.toml +6 -5
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/__init__.py +1 -1
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/cal_measurement.py +12 -8
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/programming.py +1 -1
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/observer.py +7 -5
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/fw_tools/validation.py +6 -8
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/inventory/system.py +33 -7
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/reader.py +17 -5
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/fixtures.py +1 -3
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/PKG-INFO +1 -2
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/requires.txt +0 -1
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_task_models.py +6 -5
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/test_reader.py +0 -14
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/README.md +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/experiment_from_yaml.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/experiment_generic_var1.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/experiment_generic_var2.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/experiment_models.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/firmware_model.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/firmware_modification.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/inventory.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/uart_decode_waveform.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/uart_raw2.csv +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/vharvester_simulation.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/examples/vsource_simulation.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/setup.cfg +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/calibration_hw_def.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/commons.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/calibration.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/content.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/shepherd.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/timezone.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/wrapper.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/_external_fixtures.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/energy_environment.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/energy_environment_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/firmware.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/firmware_datatype.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/virtual_harvester.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/virtual_harvester_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/virtual_source.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/virtual_source_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/experiment.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/observer_features.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/target_config.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/readme.md +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/emulation.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/firmware_mod.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/harvest.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/observer_tasks.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/testbed_tasks.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/cape.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/cape_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/gpio.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/gpio_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/mcu.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/mcu_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/observer_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/target.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/target_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/testbed.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/testbed_fixture.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/virtual_source_doc.txt +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/decoder_waveform/uart.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/fw_tools/converter.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/fw_tools/converter_elf.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/fw_tools/patcher.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/inventory/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/inventory/python.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/inventory/target.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/logger.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/cache_path.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/client.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/user_model.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_converter_model.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_harvester_model.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_source_model.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/writer.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/SOURCES.txt +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/dependency_links.txt +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/top_level.txt +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/zip-safe +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/conftest.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/conftest.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_data.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_data_faulty.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_meas.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_meas_faulty1.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_meas_faulty2.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_emulator.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_experiment.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_experiment_alternative.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_harvester.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_testbed.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_virtsource.yaml +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_base_models.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_content_fixtures.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_content_models.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_examples.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_experiment_models.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_task_generation.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_testbed_fixtures.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_testbed_models.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/decoder_waveform/test_decoder.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/build_msp.elf +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/build_nrf.elf +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/conftest.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/test_converter.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/test_patcher.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/fw_tools/test_validation.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/inventory/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/inventory/test_inventory.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/test_cal_hw.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/test_examples.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/test_logger.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/test_writer.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/vsource/__init__.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/vsource/conftest.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/vsource/test_converter.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/vsource/test_harvester.py +0 -0
- {shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/vsource/test_z.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.7.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>
|
|
@@ -33,7 +33,6 @@ Requires-Dist: numpy
|
|
|
33
33
|
Requires-Dist: pyYAML
|
|
34
34
|
Requires-Dist: chromalog
|
|
35
35
|
Requires-Dist: pydantic[email]>2.0.0
|
|
36
|
-
Requires-Dist: scipy
|
|
37
36
|
Requires-Dist: tqdm
|
|
38
37
|
Requires-Dist: intelhex
|
|
39
38
|
Requires-Dist: requests
|
|
@@ -6,7 +6,6 @@ keywords = ["testbed", "beaglebone", "pru", "batteryless", "energyharvesting", "
|
|
|
6
6
|
authors = [{name = "Ingmar Splitt", email = "ingmar.splitt@tu-dresden.de"},]
|
|
7
7
|
maintainers = [{name = "Ingmar Splitt", email = "ingmar.splitt@tu-dresden.de"},]
|
|
8
8
|
|
|
9
|
-
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
9
|
license = {file = "LICENSE"}
|
|
11
10
|
dynamic = ["version"]
|
|
12
11
|
|
|
@@ -32,7 +31,6 @@ dependencies = [
|
|
|
32
31
|
"pyYAML",
|
|
33
32
|
"chromalog",
|
|
34
33
|
"pydantic[email]>2.0.0",
|
|
35
|
-
"scipy",
|
|
36
34
|
"tqdm",
|
|
37
35
|
"intelhex",
|
|
38
36
|
"requests",
|
|
@@ -54,7 +52,6 @@ inventory = [
|
|
|
54
52
|
"psutil",
|
|
55
53
|
]
|
|
56
54
|
|
|
57
|
-
|
|
58
55
|
dev = [
|
|
59
56
|
"twine",
|
|
60
57
|
"pre-commit",
|
|
@@ -69,13 +66,17 @@ test = [
|
|
|
69
66
|
"coverage",
|
|
70
67
|
]
|
|
71
68
|
|
|
69
|
+
[project.readme]
|
|
70
|
+
file = "README.md"
|
|
71
|
+
content-type = "text/markdown"
|
|
72
|
+
|
|
72
73
|
[project.urls]
|
|
73
74
|
Documentation = "https://github.com/orgua/shepherd-datalib/blob/main/README.md"
|
|
74
75
|
Issues = "https://github.com/orgua/shepherd-datalib/issues"
|
|
75
76
|
Source = "https://pypi.org/project/shepherd-core/"
|
|
76
77
|
|
|
77
78
|
[build-system]
|
|
78
|
-
requires = ["setuptools", "setuptools-scm"]
|
|
79
|
+
requires = ["setuptools>=61.2", "setuptools-scm"]
|
|
79
80
|
build-backend = "setuptools.build_meta"
|
|
80
81
|
|
|
81
82
|
[tool.setuptools]
|
|
@@ -98,7 +99,7 @@ version = {attr = "shepherd_core.__version__"}
|
|
|
98
99
|
[tool.pytest.ini_options]
|
|
99
100
|
markers = [
|
|
100
101
|
"converter: automatically added when no objcopy is found (on ubuntu install build-essential)",
|
|
101
|
-
"elf: automatically added when no elf-support is found (on windows or missing shepherd-core[elf])"
|
|
102
|
+
"elf: automatically added when no elf-support is found (on windows or missing shepherd-core[elf])",
|
|
102
103
|
]
|
|
103
104
|
|
|
104
105
|
addopts = "-vvv --stepwise" # opts: verbose result for each tests
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/cal_measurement.py
RENAMED
|
@@ -16,8 +16,6 @@ from .calibration import CalibrationPair
|
|
|
16
16
|
from .calibration import CapeData
|
|
17
17
|
from .shepherd import ShpModel
|
|
18
18
|
|
|
19
|
-
# TODO: move to shepherd_data to remove scipy-dependency from _core
|
|
20
|
-
|
|
21
19
|
|
|
22
20
|
class CalMeasurementPair(ShpModel):
|
|
23
21
|
"""Value-container for a calibration-measurement."""
|
|
@@ -32,17 +30,23 @@ CalMeasPairs = Annotated[List[CalMeasurementPair], Field(min_length=2)]
|
|
|
32
30
|
@validate_call
|
|
33
31
|
def meas_to_cal(data: CalMeasPairs, component: str) -> CalibrationPair:
|
|
34
32
|
"""Convert values from calibration-measurement to the calibration itself."""
|
|
35
|
-
from scipy import stats # placed here due to massive delay
|
|
36
|
-
|
|
37
33
|
x = np.empty(len(data))
|
|
38
34
|
y = np.empty(len(data))
|
|
39
35
|
for i, pair in enumerate(data):
|
|
40
36
|
x[i] = pair.shepherd_raw
|
|
41
37
|
y[i] = pair.reference_si
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
|
|
39
|
+
model = np.polyfit(x, y, 1)
|
|
40
|
+
offset = model[1]
|
|
41
|
+
gain = model[0]
|
|
42
|
+
|
|
43
|
+
# r-squared, Pearson correlation coefficient
|
|
44
|
+
p = np.poly1d(model)
|
|
45
|
+
yhat = p(x)
|
|
46
|
+
ybar = np.sum(y) / len(y)
|
|
47
|
+
ssreg = np.sum((yhat - ybar) ** 2)
|
|
48
|
+
sstot = np.sum((y - ybar) ** 2)
|
|
49
|
+
rval = ssreg / sstot
|
|
46
50
|
|
|
47
51
|
if rval < 0.999:
|
|
48
52
|
msg = (
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/programming.py
RENAMED
|
@@ -43,7 +43,7 @@ class ProgrammingTask(ShpModel):
|
|
|
43
43
|
def post_validation(self) -> Self:
|
|
44
44
|
d_type = suffix_to_DType.get(self.firmware_file.suffix.lower())
|
|
45
45
|
if d_type != FirmwareDType.base64_hex:
|
|
46
|
-
ValueError(
|
|
46
|
+
raise ValueError("Firmware is not intel-.hex ('%s')", self.firmware_file.as_posix())
|
|
47
47
|
return self
|
|
48
48
|
|
|
49
49
|
@classmethod
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/observer.py
RENAMED
|
@@ -70,11 +70,13 @@ class Observer(ShpModel, title="Shepherd-Sheep"):
|
|
|
70
70
|
return self
|
|
71
71
|
|
|
72
72
|
def has_target(self, target_id: int) -> bool:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
case_a = (
|
|
74
|
+
self.target_a is not None and target_id == self.target_a.id and self.target_a.active
|
|
75
|
+
)
|
|
76
|
+
case_b = (
|
|
77
|
+
self.target_b is not None and target_id == self.target_b.id and self.target_b.active
|
|
78
|
+
)
|
|
79
|
+
return case_a or case_b
|
|
78
80
|
|
|
79
81
|
def get_target_port(self, target_id: int) -> TargetPort:
|
|
80
82
|
if self.has_target(target_id):
|
|
@@ -56,10 +56,9 @@ def is_hex_msp430(file: Path) -> bool:
|
|
|
56
56
|
value = int.from_bytes(ih.gets(0xFFFE, 2), byteorder="little", signed=False)
|
|
57
57
|
if 0x4000 > value >= 0xFF80:
|
|
58
58
|
return False
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return True
|
|
59
|
+
|
|
60
|
+
# conservative test for now - should be well below 128 kB + 8kB for msp430fr5962
|
|
61
|
+
return ih.get_memory_size() <= 270_000
|
|
63
62
|
return False
|
|
64
63
|
|
|
65
64
|
|
|
@@ -74,10 +73,9 @@ def is_hex_nrf52(file: Path) -> bool:
|
|
|
74
73
|
ih = IntelHex(file.as_posix())
|
|
75
74
|
if ih.minaddr() != 0x0000:
|
|
76
75
|
return False
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return True
|
|
76
|
+
|
|
77
|
+
# conservative test for now - should be well below 1 MB + 256 kB
|
|
78
|
+
return ih.get_memory_size() < 1310720
|
|
81
79
|
return False
|
|
82
80
|
|
|
83
81
|
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import platform
|
|
4
4
|
import subprocess
|
|
5
5
|
import time
|
|
6
|
-
from contextlib import suppress
|
|
7
6
|
from datetime import datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import List
|
|
8
9
|
from typing import Optional
|
|
9
10
|
|
|
10
11
|
from typing_extensions import Self
|
|
@@ -48,6 +49,9 @@ class SystemInventory(ShpModel):
|
|
|
48
49
|
# ip IPvAnyAddress
|
|
49
50
|
# mac MACStr
|
|
50
51
|
|
|
52
|
+
fs_root: List[str] = None
|
|
53
|
+
beagle: List[str] = None
|
|
54
|
+
|
|
51
55
|
model_config = ConfigDict(str_min_length=0)
|
|
52
56
|
|
|
53
57
|
@classmethod
|
|
@@ -67,6 +71,31 @@ class SystemInventory(ShpModel):
|
|
|
67
71
|
ifs2 = {name: (_if[1].address, _if[0].address) for name, _if in ifs1 if len(_if) > 1}
|
|
68
72
|
uptime = time.time() - psutil.boot_time()
|
|
69
73
|
|
|
74
|
+
fs_cmd = ["/usr/bin/df", "-h", "/"]
|
|
75
|
+
fs_out = []
|
|
76
|
+
if Path(fs_cmd[0]).is_file():
|
|
77
|
+
reply = subprocess.run( # noqa: S603
|
|
78
|
+
fs_cmd, timeout=30, capture_output=True, check=False
|
|
79
|
+
)
|
|
80
|
+
fs_out = str(reply.stdout).split(r"\n")
|
|
81
|
+
|
|
82
|
+
beagle_cmd = ["/usr/bin/beagle-version"]
|
|
83
|
+
beagle_out = []
|
|
84
|
+
if Path(beagle_cmd[0]).is_file():
|
|
85
|
+
reply = subprocess.run( # noqa: S603
|
|
86
|
+
beagle_cmd, timeout=30, capture_output=True, check=False
|
|
87
|
+
)
|
|
88
|
+
beagle_out = str(reply.stdout).split(r"\n")
|
|
89
|
+
|
|
90
|
+
ptp_cmd = ["/usr/sbin/ptp4l", "-v"]
|
|
91
|
+
ptp_out = None
|
|
92
|
+
if Path(ptp_cmd[0]).is_file():
|
|
93
|
+
reply = subprocess.run( # noqa: S603
|
|
94
|
+
ptp_cmd, timeout=30, capture_output=True, check=False
|
|
95
|
+
)
|
|
96
|
+
ptp_out = f"{ reply.stdout }, { reply.stderr }"
|
|
97
|
+
# alternative: check_output - seems to be lighter
|
|
98
|
+
|
|
70
99
|
model_dict = {
|
|
71
100
|
"uptime": round(uptime),
|
|
72
101
|
"timestamp": ts,
|
|
@@ -77,12 +106,9 @@ class SystemInventory(ShpModel):
|
|
|
77
106
|
"processor": platform.processor(),
|
|
78
107
|
"hostname": platform.node(),
|
|
79
108
|
"interfaces": ifs2,
|
|
80
|
-
|
|
109
|
+
"fs_root": fs_out,
|
|
110
|
+
"beagle": beagle_out,
|
|
111
|
+
"ptp": ptp_out,
|
|
81
112
|
}
|
|
82
113
|
|
|
83
|
-
with suppress(FileNotFoundError):
|
|
84
|
-
ret = subprocess.run(["/usr/sbin/ptp4l", "-v"], check=False) # noqa: S603
|
|
85
|
-
model_dict["ptp"] = ret.stdout
|
|
86
|
-
# alternative: check_output - seems to be lighter
|
|
87
|
-
|
|
88
114
|
return cls(**model_dict)
|
|
@@ -124,7 +124,10 @@ class Reader:
|
|
|
124
124
|
if not hasattr(self, "_cal"):
|
|
125
125
|
cal_dict = CalibrationSeries().model_dump()
|
|
126
126
|
for ds, param in product(["current", "voltage", "time"], ["gain", "offset"]):
|
|
127
|
-
|
|
127
|
+
try:
|
|
128
|
+
cal_dict[ds][param] = self.h5file["data"][ds].attrs[param]
|
|
129
|
+
except KeyError: # noqa: PERF203
|
|
130
|
+
self._logger.debug("Cal-Param '%s' for dataset '%s' not found!", param, ds)
|
|
128
131
|
self._cal = CalibrationSeries(**cal_dict)
|
|
129
132
|
|
|
130
133
|
self._refresh_file_stats()
|
|
@@ -257,6 +260,8 @@ class Reader:
|
|
|
257
260
|
return EnergyDType[self.h5file["data"].attrs["datatype"]]
|
|
258
261
|
except KeyError:
|
|
259
262
|
return None
|
|
263
|
+
except ValueError:
|
|
264
|
+
return None
|
|
260
265
|
else:
|
|
261
266
|
return None
|
|
262
267
|
|
|
@@ -531,9 +536,9 @@ class Reader:
|
|
|
531
536
|
def count_errors_in_log(self, group_name: str = "sheep", min_level: int = 40) -> int:
|
|
532
537
|
if group_name not in self.h5file:
|
|
533
538
|
return 0
|
|
534
|
-
if "level" not in self.h5file[
|
|
539
|
+
if "level" not in self.h5file[group_name]:
|
|
535
540
|
return 0
|
|
536
|
-
_lvl = self.h5file[
|
|
541
|
+
_lvl = self.h5file[group_name]["level"]
|
|
537
542
|
if _lvl.shape[0] < 1:
|
|
538
543
|
return 0
|
|
539
544
|
_items = [1 for _x in _lvl[:] if _x >= min_level]
|
|
@@ -631,7 +636,7 @@ class Reader:
|
|
|
631
636
|
Algo: create an offset-by-one vector and compare against original.
|
|
632
637
|
"""
|
|
633
638
|
if len(data.shape) > 1:
|
|
634
|
-
ValueError("Array must be 1D")
|
|
639
|
+
raise ValueError("Array must be 1D")
|
|
635
640
|
data_1 = np.concatenate(([not data[0]], data[:-1]))
|
|
636
641
|
return data != data_1
|
|
637
642
|
|
|
@@ -683,4 +688,11 @@ class Reader:
|
|
|
683
688
|
gpio_wf = pin_wf.astype(float)
|
|
684
689
|
gpio_wf[:, 0] = gpio_wf[:, 0] / 1e9
|
|
685
690
|
|
|
686
|
-
|
|
691
|
+
try:
|
|
692
|
+
return Uart(gpio_wf).get_lines()
|
|
693
|
+
except TypeError:
|
|
694
|
+
self._logger.error("TypeError: Extracting UART from GPIO failed - will skip file.")
|
|
695
|
+
return None
|
|
696
|
+
except ValueError:
|
|
697
|
+
self._logger.error("ValueError: Extracting UART from GPIO failed - will skip file.")
|
|
698
|
+
return None
|
|
@@ -168,9 +168,7 @@ def file_older_than(file: Path, delta: timedelta) -> bool:
|
|
|
168
168
|
"""Decide if file is older than a specific duration of time."""
|
|
169
169
|
cutoff = local_now() - delta
|
|
170
170
|
mtime = datetime.fromtimestamp(file.stat().st_mtime, tz=local_tz())
|
|
171
|
-
|
|
172
|
-
return True
|
|
173
|
-
return False
|
|
171
|
+
return mtime < cutoff
|
|
174
172
|
|
|
175
173
|
|
|
176
174
|
class Fixtures:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.7.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>
|
|
@@ -33,7 +33,6 @@ Requires-Dist: numpy
|
|
|
33
33
|
Requires-Dist: pyYAML
|
|
34
34
|
Requires-Dist: chromalog
|
|
35
35
|
Requires-Dist: pydantic[email]>2.0.0
|
|
36
|
-
Requires-Dist: scipy
|
|
37
36
|
Requires-Dist: tqdm
|
|
38
37
|
Requires-Dist: intelhex
|
|
39
38
|
Requires-Dist: requests
|
|
@@ -125,8 +125,9 @@ def test_task_model_prog_min() -> None:
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def test_task_model_prog_fault_elf() -> None:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
with pytest.raises(ValidationError):
|
|
129
|
+
ProgrammingTask(
|
|
130
|
+
firmware_file=Path("fw_to_load.elf"),
|
|
131
|
+
protocol=ProgrammerProtocol.SWD,
|
|
132
|
+
mcu_type="nrf52",
|
|
133
|
+
)
|
|
@@ -179,20 +179,6 @@ def test_reader_fault_no_voltage(data_h5: Path) -> None:
|
|
|
179
179
|
Reader(data_h5, verbose=True)
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
def test_reader_fault_no_gain(data_h5: Path) -> None:
|
|
183
|
-
with Writer(data_h5, modify_existing=True) as sfw:
|
|
184
|
-
del sfw.h5file["data"]["time"].attrs["gain"]
|
|
185
|
-
with pytest.raises(KeyError):
|
|
186
|
-
Reader(data_h5, verbose=True)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def test_reader_fault_no_offset(data_h5: Path) -> None:
|
|
190
|
-
with Writer(data_h5, modify_existing=True) as sfw:
|
|
191
|
-
del sfw.h5file["data"]["time"].attrs["offset"]
|
|
192
|
-
with pytest.raises(KeyError):
|
|
193
|
-
Reader(data_h5, verbose=True)
|
|
194
|
-
|
|
195
|
-
|
|
196
182
|
def test_reader_fault_non_eq_time(data_h5: Path) -> None:
|
|
197
183
|
with Writer(data_h5, modify_existing=True) as sfw:
|
|
198
184
|
sfw.h5file["data"]["time"].resize((0,))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/calibration.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/shepherd.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/base/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/content/firmware.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/experiment/experiment.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/emulation.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/firmware_mod.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/observer_tasks.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/task/testbed_tasks.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/mcu_fixture.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/target.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/testbed/testbed.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/data_models/virtual_source_doc.txt
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/decoder_waveform/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/cache_path.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/testbed_client/user_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_converter_model.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_harvester_model.py
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core/vsource/virtual_source_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/shepherd_core.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_data_faulty.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_meas_faulty1.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_cal_meas_faulty2.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_emulator.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_experiment.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_harvester.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_testbed.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/example_config_virtsource.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_content_fixtures.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_experiment_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.5.1 → shepherd_core-2024.7.2}/tests/data_models/test_testbed_fixtures.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|