shepherd-core 2025.4.1__py3-none-any.whl → 2025.5.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_core/calibration_hw_def.py +11 -11
- shepherd_core/commons.py +4 -4
- shepherd_core/data_models/__init__.py +2 -0
- shepherd_core/data_models/base/cal_measurement.py +10 -11
- shepherd_core/data_models/base/calibration.py +7 -6
- shepherd_core/data_models/base/content.py +1 -1
- shepherd_core/data_models/base/shepherd.py +6 -7
- shepherd_core/data_models/base/wrapper.py +2 -2
- shepherd_core/data_models/content/_external_fixtures.yaml +32 -32
- shepherd_core/data_models/content/energy_environment.py +6 -5
- shepherd_core/data_models/content/firmware.py +9 -7
- shepherd_core/data_models/content/virtual_harvester.py +34 -26
- shepherd_core/data_models/content/virtual_harvester_fixture.yaml +2 -2
- shepherd_core/data_models/content/virtual_source.py +20 -17
- shepherd_core/data_models/content/virtual_source_fixture.yaml +3 -3
- shepherd_core/data_models/experiment/experiment.py +15 -15
- shepherd_core/data_models/experiment/observer_features.py +109 -16
- shepherd_core/data_models/experiment/target_config.py +17 -12
- shepherd_core/data_models/task/__init__.py +11 -8
- shepherd_core/data_models/task/emulation.py +32 -17
- shepherd_core/data_models/task/firmware_mod.py +11 -11
- shepherd_core/data_models/task/harvest.py +7 -6
- shepherd_core/data_models/task/observer_tasks.py +7 -7
- shepherd_core/data_models/task/programming.py +13 -12
- shepherd_core/data_models/task/testbed_tasks.py +8 -8
- shepherd_core/data_models/testbed/cape.py +7 -6
- shepherd_core/data_models/testbed/gpio.py +8 -7
- shepherd_core/data_models/testbed/mcu.py +8 -7
- shepherd_core/data_models/testbed/mcu_fixture.yaml +4 -4
- shepherd_core/data_models/testbed/observer.py +9 -7
- shepherd_core/data_models/testbed/target.py +9 -7
- shepherd_core/data_models/testbed/testbed.py +11 -10
- shepherd_core/data_models/virtual_source_doc.txt +3 -3
- shepherd_core/decoder_waveform/uart.py +5 -5
- shepherd_core/fw_tools/converter.py +10 -6
- shepherd_core/fw_tools/patcher.py +14 -15
- shepherd_core/fw_tools/validation.py +11 -6
- shepherd_core/inventory/__init__.py +6 -6
- shepherd_core/inventory/python.py +1 -1
- shepherd_core/inventory/system.py +11 -8
- shepherd_core/inventory/target.py +3 -3
- shepherd_core/logger.py +2 -2
- shepherd_core/reader.py +105 -78
- shepherd_core/testbed_client/client_abc_fix.py +22 -16
- shepherd_core/testbed_client/client_web.py +18 -11
- shepherd_core/testbed_client/fixtures.py +21 -22
- shepherd_core/testbed_client/user_model.py +6 -5
- shepherd_core/version.py +1 -1
- shepherd_core/vsource/target_model.py +3 -3
- shepherd_core/vsource/virtual_converter_model.py +3 -3
- shepherd_core/vsource/virtual_harvester_model.py +7 -9
- shepherd_core/vsource/virtual_harvester_simulation.py +7 -6
- shepherd_core/vsource/virtual_source_model.py +6 -5
- shepherd_core/vsource/virtual_source_simulation.py +8 -7
- shepherd_core/writer.py +37 -39
- {shepherd_core-2025.4.1.dist-info → shepherd_core-2025.5.2.dist-info}/METADATA +2 -3
- shepherd_core-2025.5.2.dist-info/RECORD +81 -0
- {shepherd_core-2025.4.1.dist-info → shepherd_core-2025.5.2.dist-info}/WHEEL +1 -1
- shepherd_core-2025.4.1.dist-info/RECORD +0 -81
- {shepherd_core-2025.4.1.dist-info → shepherd_core-2025.5.2.dist-info}/top_level.txt +0 -0
- {shepherd_core-2025.4.1.dist-info → shepherd_core-2025.5.2.dist-info}/zip-safe +0 -0
|
@@ -10,26 +10,26 @@ currently configured for cape v2.4c
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
12
|
# both current channels have a 0.1 % shunt resistance of
|
|
13
|
-
R_SHT = 2.0 # [ohm]
|
|
13
|
+
R_SHT: float = 2.0 # [ohm]
|
|
14
14
|
# the instrumentation amplifiers are configured for gain of
|
|
15
|
-
G_INST_AMP = 48 # [n]
|
|
15
|
+
G_INST_AMP: int = 48 # [n]
|
|
16
16
|
# we use the ADC's internal reference with
|
|
17
|
-
V_REF_ADC = 4.096 # [V]
|
|
17
|
+
V_REF_ADC: float = 4.096 # [V]
|
|
18
18
|
# range of current channels is
|
|
19
|
-
G_ADC_I = 1.25 # [gain / V_REF]
|
|
19
|
+
G_ADC_I: float = 1.25 # [gain / V_REF]
|
|
20
20
|
# range of voltage channels is
|
|
21
|
-
G_ADC_V = 1.25 # [gain / V_REF]
|
|
21
|
+
G_ADC_V: float = 1.25 # [gain / V_REF]
|
|
22
22
|
# bit resolution of ADC
|
|
23
|
-
M_ADC = 18 # [bit]
|
|
23
|
+
M_ADC: int = 18 # [bit]
|
|
24
24
|
# DACs use internal reference with
|
|
25
|
-
V_REF_DAC = 2.5 # [V]
|
|
25
|
+
V_REF_DAC: float = 2.5 # [V]
|
|
26
26
|
# gain of DAC is set to
|
|
27
|
-
G_DAC = 2 # [n]
|
|
27
|
+
G_DAC: int = 2 # [n]
|
|
28
28
|
# bit resolution of DAC
|
|
29
|
-
M_DAC = 16 # [bit]
|
|
29
|
+
M_DAC: int = 16 # [bit]
|
|
30
30
|
# DERIVED VARIABLES
|
|
31
|
-
RAW_MAX_ADC = 2**M_ADC - 1
|
|
32
|
-
RAW_MAX_DAC = 2**M_DAC - 1
|
|
31
|
+
RAW_MAX_ADC: int = 2**M_ADC - 1
|
|
32
|
+
RAW_MAX_DAC: int = 2**M_DAC - 1
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
def adc_current_to_raw(current: float, *, limited: bool = True) -> int:
|
shepherd_core/commons.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Container for commonly shared constants."""
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
SAMPLERATE_SPS_DEFAULT: int = 100_000
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
UID_NAME: str = "SHEPHERD_NODE_ID"
|
|
6
|
+
UID_SIZE: int = 2
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
TESTBED_SERVER_URI: str = "http://127.0.0.1:8000/shepherd"
|
|
@@ -31,6 +31,7 @@ from .experiment.observer_features import GpioLevel
|
|
|
31
31
|
from .experiment.observer_features import GpioTracing
|
|
32
32
|
from .experiment.observer_features import PowerTracing
|
|
33
33
|
from .experiment.observer_features import SystemLogging
|
|
34
|
+
from .experiment.observer_features import UartTracing
|
|
34
35
|
from .experiment.target_config import TargetConfig
|
|
35
36
|
|
|
36
37
|
__all__ = [
|
|
@@ -54,6 +55,7 @@ __all__ = [
|
|
|
54
55
|
"ShpModel",
|
|
55
56
|
"SystemLogging",
|
|
56
57
|
"TargetConfig",
|
|
58
|
+
"UartTracing",
|
|
57
59
|
"VirtualHarvesterConfig",
|
|
58
60
|
"VirtualSourceConfig",
|
|
59
61
|
"Wrapper",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"""Models for the process of calibration a device by measurements."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Annotated
|
|
4
4
|
from typing import Optional
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
from pydantic import Field
|
|
8
8
|
from pydantic import PositiveFloat
|
|
9
9
|
from pydantic import validate_call
|
|
10
|
-
from typing_extensions import Annotated
|
|
11
10
|
|
|
12
11
|
from .calibration import CalibrationCape
|
|
13
12
|
from .calibration import CalibrationEmulator
|
|
@@ -24,7 +23,7 @@ class CalMeasurementPair(ShpModel):
|
|
|
24
23
|
reference_si: float = 0
|
|
25
24
|
|
|
26
25
|
|
|
27
|
-
CalMeasPairs = Annotated[
|
|
26
|
+
CalMeasPairs = Annotated[list[CalMeasurementPair], Field(min_length=2)]
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
@validate_call
|
|
@@ -37,16 +36,16 @@ def meas_to_cal(data: CalMeasPairs, component: str) -> CalibrationPair:
|
|
|
37
36
|
y[i] = pair.reference_si
|
|
38
37
|
|
|
39
38
|
model = np.polyfit(x, y, 1)
|
|
40
|
-
offset = model[1]
|
|
41
|
-
gain = model[0]
|
|
39
|
+
offset: float = float(model[1])
|
|
40
|
+
gain: float = float(model[0])
|
|
42
41
|
|
|
43
42
|
# r-squared, Pearson correlation coefficient
|
|
44
|
-
|
|
45
|
-
yhat =
|
|
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
|
|
43
|
+
_p = np.poly1d(model)
|
|
44
|
+
yhat = _p(x)
|
|
45
|
+
ybar: float = np.sum(y) / len(y)
|
|
46
|
+
ssreg: float = np.sum((yhat - ybar) ** 2)
|
|
47
|
+
sstot: float = np.sum((y - ybar) ** 2)
|
|
48
|
+
rval: float = ssreg / sstot
|
|
50
49
|
|
|
51
50
|
if rval < 0.999:
|
|
52
51
|
msg = (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"""Models for the calibration-data to convert between raw & SI-Values."""
|
|
2
2
|
|
|
3
3
|
import struct
|
|
4
|
+
from collections.abc import Generator
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from collections.abc import Sequence
|
|
4
7
|
from typing import Callable
|
|
5
|
-
from typing import Generator
|
|
6
|
-
from typing import Mapping
|
|
7
8
|
from typing import Optional
|
|
8
|
-
from typing import Sequence
|
|
9
9
|
from typing import TypeVar
|
|
10
10
|
from typing import Union
|
|
11
11
|
|
|
@@ -18,9 +18,10 @@ from pydantic import constr
|
|
|
18
18
|
from pydantic import validate_call
|
|
19
19
|
from typing_extensions import Self
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
21
|
+
from shepherd_core.calibration_hw_def import adc_current_to_raw
|
|
22
|
+
from shepherd_core.calibration_hw_def import adc_voltage_to_raw
|
|
23
|
+
from shepherd_core.calibration_hw_def import dac_voltage_to_raw
|
|
24
|
+
|
|
24
25
|
from .shepherd import ShpModel
|
|
25
26
|
from .timezone import local_iso_date
|
|
26
27
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import hashlib
|
|
4
4
|
from datetime import datetime
|
|
5
|
+
from typing import Annotated
|
|
5
6
|
from typing import Optional
|
|
6
7
|
from typing import Union
|
|
7
8
|
from uuid import uuid4
|
|
@@ -10,7 +11,6 @@ from pydantic import UUID4
|
|
|
10
11
|
from pydantic import Field
|
|
11
12
|
from pydantic import StringConstraints
|
|
12
13
|
from pydantic import model_validator
|
|
13
|
-
from typing_extensions import Annotated
|
|
14
14
|
from typing_extensions import Self
|
|
15
15
|
from typing_extensions import deprecated
|
|
16
16
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import hashlib
|
|
4
4
|
import pathlib
|
|
5
|
+
from collections.abc import Generator
|
|
5
6
|
from datetime import timedelta
|
|
6
7
|
from ipaddress import IPv4Address
|
|
7
8
|
from pathlib import Path
|
|
8
9
|
from typing import Any
|
|
9
|
-
from typing import Generator
|
|
10
10
|
from typing import Optional
|
|
11
11
|
from typing import Union
|
|
12
12
|
from uuid import UUID
|
|
@@ -15,27 +15,26 @@ import yaml
|
|
|
15
15
|
from pydantic import BaseModel
|
|
16
16
|
from pydantic import ConfigDict
|
|
17
17
|
from typing_extensions import Self
|
|
18
|
-
from yaml import
|
|
18
|
+
from yaml import Node
|
|
19
19
|
from yaml import SafeDumper
|
|
20
|
-
from yaml import ScalarNode
|
|
21
20
|
|
|
22
21
|
from .timezone import local_now
|
|
23
22
|
from .wrapper import Wrapper
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
def path2str(
|
|
27
|
-
dumper:
|
|
28
|
-
) ->
|
|
26
|
+
dumper: SafeDumper, data: Union[pathlib.Path, pathlib.WindowsPath, pathlib.PosixPath]
|
|
27
|
+
) -> Node:
|
|
29
28
|
"""Add a yaml-representation for a specific datatype."""
|
|
30
29
|
return dumper.represent_scalar("tag:yaml.org,2002:str", str(data.as_posix()))
|
|
31
30
|
|
|
32
31
|
|
|
33
|
-
def time2int(dumper:
|
|
32
|
+
def time2int(dumper: SafeDumper, data: timedelta) -> Node:
|
|
34
33
|
"""Add a yaml-representation for a specific datatype."""
|
|
35
34
|
return dumper.represent_scalar("tag:yaml.org,2002:int", str(int(data.total_seconds())))
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
def generic2str(dumper:
|
|
37
|
+
def generic2str(dumper: SafeDumper, data: Any) -> Node:
|
|
39
38
|
"""Add a yaml-representation for a specific datatype."""
|
|
40
39
|
return dumper.represent_scalar("tag:yaml.org,2002:str", str(data))
|
|
41
40
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"""Wrapper-related ecosystem for transferring models."""
|
|
2
2
|
|
|
3
3
|
from datetime import datetime
|
|
4
|
+
from typing import Annotated
|
|
4
5
|
from typing import Optional
|
|
5
6
|
|
|
6
7
|
from pydantic import BaseModel
|
|
7
8
|
from pydantic import StringConstraints
|
|
8
|
-
from typing_extensions import Annotated
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from shepherd_core.version import version
|
|
11
11
|
|
|
12
12
|
SafeStrClone = Annotated[str, StringConstraints(pattern=r"^[ -~]+$")]
|
|
13
13
|
# ⤷ copy avoids circular import
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
- datatype: EnergyEnvironment
|
|
2
|
-
created:
|
|
2
|
+
created: 2025-05-12 17:28:39.756999+02:00
|
|
3
3
|
parameters:
|
|
4
4
|
id: 2639560972524229652
|
|
5
5
|
name: eenv_static_2000mV_10mA_3600s
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
indoor: true
|
|
23
23
|
location: Lab-VSrc
|
|
24
24
|
- datatype: EnergyEnvironment
|
|
25
|
-
created:
|
|
25
|
+
created: 2025-05-12 17:28:39.764595+02:00
|
|
26
26
|
parameters:
|
|
27
27
|
id: 9823394105967169626
|
|
28
28
|
name: eenv_static_2000mV_1mA_3600s
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
indoor: true
|
|
46
46
|
location: Lab-VSrc
|
|
47
47
|
- datatype: EnergyEnvironment
|
|
48
|
-
created:
|
|
48
|
+
created: 2025-05-12 17:28:39.772144+02:00
|
|
49
49
|
parameters:
|
|
50
50
|
id: 3900615675169501222
|
|
51
51
|
name: eenv_static_2000mV_50mA_3600s
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
indoor: true
|
|
69
69
|
location: Lab-VSrc
|
|
70
70
|
- datatype: EnergyEnvironment
|
|
71
|
-
created:
|
|
71
|
+
created: 2025-05-12 17:28:39.779737+02:00
|
|
72
72
|
parameters:
|
|
73
73
|
id: 14796673729431137386
|
|
74
74
|
name: eenv_static_2000mV_5mA_3600s
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
indoor: true
|
|
92
92
|
location: Lab-VSrc
|
|
93
93
|
- datatype: EnergyEnvironment
|
|
94
|
-
created:
|
|
94
|
+
created: 2025-05-12 17:28:39.787329+02:00
|
|
95
95
|
parameters:
|
|
96
96
|
id: 6648482606607441403
|
|
97
97
|
name: eenv_static_3000mV_10mA_3600s
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
indoor: true
|
|
115
115
|
location: Lab-VSrc
|
|
116
116
|
- datatype: EnergyEnvironment
|
|
117
|
-
created:
|
|
117
|
+
created: 2025-05-12 17:28:39.794922+02:00
|
|
118
118
|
parameters:
|
|
119
119
|
id: 13566000951043177991
|
|
120
120
|
name: eenv_static_3000mV_1mA_3600s
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
indoor: true
|
|
138
138
|
location: Lab-VSrc
|
|
139
139
|
- datatype: EnergyEnvironment
|
|
140
|
-
created:
|
|
140
|
+
created: 2025-05-12 17:28:39.802410+02:00
|
|
141
141
|
parameters:
|
|
142
142
|
id: 7977778327156610158
|
|
143
143
|
name: eenv_static_3000mV_50mA_3600s
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
indoor: true
|
|
161
161
|
location: Lab-VSrc
|
|
162
162
|
- datatype: EnergyEnvironment
|
|
163
|
-
created:
|
|
163
|
+
created: 2025-05-12 17:28:39.810147+02:00
|
|
164
164
|
parameters:
|
|
165
165
|
id: 4900162978999238419
|
|
166
166
|
name: eenv_static_3000mV_5mA_3600s
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
indoor: true
|
|
184
184
|
location: Lab-VSrc
|
|
185
185
|
- datatype: Firmware
|
|
186
|
-
created:
|
|
186
|
+
created: 2025-05-12 17:28:39.825659+02:00
|
|
187
187
|
parameters:
|
|
188
188
|
id: 3000
|
|
189
189
|
name: msp430_deep_sleep
|
|
@@ -198,10 +198,10 @@
|
|
|
198
198
|
mcu:
|
|
199
199
|
id: 1002
|
|
200
200
|
name: MSP430FR
|
|
201
|
-
description: 16MHz Ultra-Low-Pwr MCU with
|
|
201
|
+
description: 16MHz Ultra-Low-Pwr MCU with 256 KB FRAM
|
|
202
202
|
comment: null
|
|
203
203
|
platform: MSP430
|
|
204
|
-
core:
|
|
204
|
+
core: MSP430FR5994
|
|
205
205
|
prog_protocol: SBW
|
|
206
206
|
prog_voltage: 3.0
|
|
207
207
|
prog_datarate: 500000
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
data_hash: null
|
|
212
212
|
data_local: false
|
|
213
213
|
- datatype: Firmware
|
|
214
|
-
created:
|
|
214
|
+
created: 2025-05-12 17:28:39.834276+02:00
|
|
215
215
|
parameters:
|
|
216
216
|
id: 3001
|
|
217
217
|
name: msp430_spi_fram
|
|
@@ -226,10 +226,10 @@
|
|
|
226
226
|
mcu:
|
|
227
227
|
id: 1002
|
|
228
228
|
name: MSP430FR
|
|
229
|
-
description: 16MHz Ultra-Low-Pwr MCU with
|
|
229
|
+
description: 16MHz Ultra-Low-Pwr MCU with 256 KB FRAM
|
|
230
230
|
comment: null
|
|
231
231
|
platform: MSP430
|
|
232
|
-
core:
|
|
232
|
+
core: MSP430FR5994
|
|
233
233
|
prog_protocol: SBW
|
|
234
234
|
prog_voltage: 3.0
|
|
235
235
|
prog_datarate: 500000
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
data_hash: null
|
|
240
240
|
data_local: false
|
|
241
241
|
- datatype: Firmware
|
|
242
|
-
created:
|
|
242
|
+
created: 2025-05-12 17:28:39.842993+02:00
|
|
243
243
|
parameters:
|
|
244
244
|
id: 3002
|
|
245
245
|
name: msp430_testable
|
|
@@ -254,10 +254,10 @@
|
|
|
254
254
|
mcu:
|
|
255
255
|
id: 1002
|
|
256
256
|
name: MSP430FR
|
|
257
|
-
description: 16MHz Ultra-Low-Pwr MCU with
|
|
257
|
+
description: 16MHz Ultra-Low-Pwr MCU with 256 KB FRAM
|
|
258
258
|
comment: null
|
|
259
259
|
platform: MSP430
|
|
260
|
-
core:
|
|
260
|
+
core: MSP430FR5994
|
|
261
261
|
prog_protocol: SBW
|
|
262
262
|
prog_voltage: 3.0
|
|
263
263
|
prog_datarate: 500000
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
data_hash: null
|
|
268
268
|
data_local: false
|
|
269
269
|
- datatype: Firmware
|
|
270
|
-
created:
|
|
270
|
+
created: 2025-05-12 17:28:39.851412+02:00
|
|
271
271
|
parameters:
|
|
272
272
|
id: 7163917825449888392
|
|
273
273
|
name: nrf52_deep_sleep
|
|
@@ -282,20 +282,20 @@
|
|
|
282
282
|
mcu:
|
|
283
283
|
id: 1001
|
|
284
284
|
name: nRF52
|
|
285
|
-
description:
|
|
285
|
+
description: MCU with RF, 802.15.4, Bluetooth v5.0, 2.4GHz
|
|
286
286
|
comment: null
|
|
287
287
|
platform: nRF52
|
|
288
288
|
core: nRF52840
|
|
289
289
|
prog_protocol: SWD
|
|
290
290
|
prog_voltage: 3.0
|
|
291
291
|
prog_datarate: 500000
|
|
292
|
-
fw_name_default:
|
|
292
|
+
fw_name_default: nrf52_deep_sleep
|
|
293
293
|
data: /var/shepherd/content/fw/nes_lab/nrf52_deep_sleep/build.elf
|
|
294
294
|
data_type: path_elf
|
|
295
295
|
data_hash: null
|
|
296
296
|
data_local: false
|
|
297
297
|
- datatype: Firmware
|
|
298
|
-
created:
|
|
298
|
+
created: 2025-05-12 17:28:39.859962+02:00
|
|
299
299
|
parameters:
|
|
300
300
|
id: 2000
|
|
301
301
|
name: nrf52_demo_rf
|
|
@@ -310,20 +310,20 @@
|
|
|
310
310
|
mcu:
|
|
311
311
|
id: 1001
|
|
312
312
|
name: nRF52
|
|
313
|
-
description:
|
|
313
|
+
description: MCU with RF, 802.15.4, Bluetooth v5.0, 2.4GHz
|
|
314
314
|
comment: null
|
|
315
315
|
platform: nRF52
|
|
316
316
|
core: nRF52840
|
|
317
317
|
prog_protocol: SWD
|
|
318
318
|
prog_voltage: 3.0
|
|
319
319
|
prog_datarate: 500000
|
|
320
|
-
fw_name_default:
|
|
320
|
+
fw_name_default: nrf52_deep_sleep
|
|
321
321
|
data: /var/shepherd/content/fw/nes_lab/nrf52_demo_rf/build.elf
|
|
322
322
|
data_type: path_elf
|
|
323
323
|
data_hash: null
|
|
324
324
|
data_local: false
|
|
325
325
|
- datatype: Firmware
|
|
326
|
-
created:
|
|
326
|
+
created: 2025-05-12 17:28:39.868340+02:00
|
|
327
327
|
parameters:
|
|
328
328
|
id: 3174430733058172825
|
|
329
329
|
name: nrf52_rf_survey
|
|
@@ -339,20 +339,20 @@
|
|
|
339
339
|
mcu:
|
|
340
340
|
id: 1001
|
|
341
341
|
name: nRF52
|
|
342
|
-
description:
|
|
342
|
+
description: MCU with RF, 802.15.4, Bluetooth v5.0, 2.4GHz
|
|
343
343
|
comment: null
|
|
344
344
|
platform: nRF52
|
|
345
345
|
core: nRF52840
|
|
346
346
|
prog_protocol: SWD
|
|
347
347
|
prog_voltage: 3.0
|
|
348
348
|
prog_datarate: 500000
|
|
349
|
-
fw_name_default:
|
|
349
|
+
fw_name_default: nrf52_deep_sleep
|
|
350
350
|
data: /var/shepherd/content/fw/nes_lab/nrf52_rf_survey/build.elf
|
|
351
351
|
data_type: path_elf
|
|
352
352
|
data_hash: null
|
|
353
353
|
data_local: false
|
|
354
354
|
- datatype: Firmware
|
|
355
|
-
created:
|
|
355
|
+
created: 2025-05-12 17:28:39.876819+02:00
|
|
356
356
|
parameters:
|
|
357
357
|
id: 16381936580724580968
|
|
358
358
|
name: nrf52_rf_test
|
|
@@ -367,20 +367,20 @@
|
|
|
367
367
|
mcu:
|
|
368
368
|
id: 1001
|
|
369
369
|
name: nRF52
|
|
370
|
-
description:
|
|
370
|
+
description: MCU with RF, 802.15.4, Bluetooth v5.0, 2.4GHz
|
|
371
371
|
comment: null
|
|
372
372
|
platform: nRF52
|
|
373
373
|
core: nRF52840
|
|
374
374
|
prog_protocol: SWD
|
|
375
375
|
prog_voltage: 3.0
|
|
376
376
|
prog_datarate: 500000
|
|
377
|
-
fw_name_default:
|
|
377
|
+
fw_name_default: nrf52_deep_sleep
|
|
378
378
|
data: /var/shepherd/content/fw/nes_lab/nrf52_rf_test/build.elf
|
|
379
379
|
data_type: path_elf
|
|
380
380
|
data_hash: null
|
|
381
381
|
data_local: false
|
|
382
382
|
- datatype: Firmware
|
|
383
|
-
created:
|
|
383
|
+
created: 2025-05-12 17:28:39.885271+02:00
|
|
384
384
|
parameters:
|
|
385
385
|
id: 2002
|
|
386
386
|
name: nrf52_testable
|
|
@@ -396,14 +396,14 @@
|
|
|
396
396
|
mcu:
|
|
397
397
|
id: 1001
|
|
398
398
|
name: nRF52
|
|
399
|
-
description:
|
|
399
|
+
description: MCU with RF, 802.15.4, Bluetooth v5.0, 2.4GHz
|
|
400
400
|
comment: null
|
|
401
401
|
platform: nRF52
|
|
402
402
|
core: nRF52840
|
|
403
403
|
prog_protocol: SWD
|
|
404
404
|
prog_voltage: 3.0
|
|
405
405
|
prog_datarate: 500000
|
|
406
|
-
fw_name_default:
|
|
406
|
+
fw_name_default: nrf52_deep_sleep
|
|
407
407
|
data: /var/shepherd/content/fw/nes_lab/nrf52_testable/build.elf
|
|
408
408
|
data_type: path_elf
|
|
409
409
|
data_hash: null
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
5
6
|
from typing import Optional
|
|
6
7
|
|
|
7
8
|
from pydantic import PositiveFloat
|
|
8
9
|
from pydantic import model_validator
|
|
9
10
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
11
|
+
from shepherd_core.data_models.base.content import ContentModel
|
|
12
|
+
from shepherd_core.testbed_client import tb_client
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class EnergyDType(str, Enum):
|
|
15
16
|
"""Data-Type-Options for energy environments."""
|
|
16
17
|
|
|
17
|
-
ivsample = ivsamples = "ivsample"
|
|
18
|
-
|
|
18
|
+
ivtrace = ivsample = ivsamples = "ivsample"
|
|
19
|
+
ivsurface = ivcurve = ivcurves = "ivcurve"
|
|
19
20
|
isc_voc = "isc_voc"
|
|
20
21
|
|
|
21
22
|
|
|
@@ -46,7 +47,7 @@ class EnergyEnvironment(ContentModel):
|
|
|
46
47
|
|
|
47
48
|
@model_validator(mode="before")
|
|
48
49
|
@classmethod
|
|
49
|
-
def query_database(cls, values: dict) -> dict:
|
|
50
|
+
def query_database(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
50
51
|
values, _ = tb_client.try_completing_model(cls.__name__, values)
|
|
51
52
|
# TODO: figure out a way to crosscheck type with actual data
|
|
52
53
|
return tb_client.fill_in_user_data(values)
|
|
@@ -4,6 +4,8 @@ TODO: should be more generalized - currently only supports msp & nRF
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
from pathlib import Path
|
|
7
|
+
from typing import Annotated
|
|
8
|
+
from typing import Any
|
|
7
9
|
from typing import Optional
|
|
8
10
|
from typing import TypedDict
|
|
9
11
|
from typing import Union
|
|
@@ -11,15 +13,15 @@ from typing import Union
|
|
|
11
13
|
from pydantic import StringConstraints
|
|
12
14
|
from pydantic import model_validator
|
|
13
15
|
from pydantic import validate_call
|
|
14
|
-
from typing_extensions import Annotated
|
|
15
16
|
from typing_extensions import Self
|
|
16
17
|
from typing_extensions import Unpack
|
|
17
18
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
19
|
+
from shepherd_core import fw_tools
|
|
20
|
+
from shepherd_core.data_models.base.content import ContentModel
|
|
21
|
+
from shepherd_core.data_models.testbed.mcu import MCU
|
|
22
|
+
from shepherd_core.logger import logger
|
|
23
|
+
from shepherd_core.testbed_client import tb_client
|
|
24
|
+
|
|
23
25
|
from .firmware_datatype import FirmwareDType
|
|
24
26
|
|
|
25
27
|
suffix_to_DType: dict = {
|
|
@@ -64,7 +66,7 @@ class Firmware(ContentModel, title="Firmware of Target"):
|
|
|
64
66
|
|
|
65
67
|
@model_validator(mode="before")
|
|
66
68
|
@classmethod
|
|
67
|
-
def query_database(cls, values: dict) -> dict:
|
|
69
|
+
def query_database(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
68
70
|
values, _ = tb_client.try_completing_model(cls.__name__, values)
|
|
69
71
|
# crosscheck type with actual data
|
|
70
72
|
_type = values.get("data_type")
|