shepherd-core 2023.12.1__py3-none-any.whl → 2024.4.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/__init__.py +5 -4
- shepherd_core/calibration_hw_def.py +9 -1
- shepherd_core/commons.py +2 -0
- shepherd_core/data_models/__init__.py +11 -0
- shepherd_core/data_models/base/__init__.py +4 -1
- shepherd_core/data_models/base/cal_measurement.py +18 -6
- shepherd_core/data_models/base/calibration.py +41 -16
- shepherd_core/data_models/base/content.py +20 -5
- shepherd_core/data_models/base/shepherd.py +23 -12
- shepherd_core/data_models/base/timezone.py +5 -0
- shepherd_core/data_models/base/wrapper.py +3 -3
- shepherd_core/data_models/content/__init__.py +5 -4
- shepherd_core/data_models/content/_external_fixtures.yaml +32 -16
- shepherd_core/data_models/content/energy_environment.py +7 -5
- shepherd_core/data_models/content/energy_environment_fixture.yaml +3 -0
- shepherd_core/data_models/content/firmware.py +12 -5
- shepherd_core/data_models/content/firmware_datatype.py +7 -0
- shepherd_core/data_models/content/virtual_harvester.py +25 -20
- shepherd_core/data_models/content/virtual_harvester_fixture.yaml +1 -0
- shepherd_core/data_models/content/virtual_source.py +40 -23
- shepherd_core/data_models/content/virtual_source_fixture.yaml +1 -0
- shepherd_core/data_models/experiment/__init__.py +5 -4
- shepherd_core/data_models/experiment/experiment.py +16 -15
- shepherd_core/data_models/experiment/observer_features.py +18 -12
- shepherd_core/data_models/experiment/target_config.py +11 -7
- shepherd_core/data_models/readme.md +88 -0
- shepherd_core/data_models/task/__init__.py +10 -3
- shepherd_core/data_models/task/emulation.py +9 -6
- shepherd_core/data_models/task/firmware_mod.py +4 -2
- shepherd_core/data_models/task/harvest.py +5 -4
- shepherd_core/data_models/task/observer_tasks.py +4 -2
- shepherd_core/data_models/task/programming.py +3 -1
- shepherd_core/data_models/task/testbed_tasks.py +10 -4
- shepherd_core/data_models/testbed/__init__.py +5 -2
- shepherd_core/data_models/testbed/cape.py +8 -6
- shepherd_core/data_models/testbed/gpio.py +11 -9
- shepherd_core/data_models/testbed/mcu.py +10 -10
- shepherd_core/data_models/testbed/observer.py +10 -5
- shepherd_core/data_models/testbed/observer_fixture.yaml +23 -22
- shepherd_core/data_models/testbed/target.py +5 -3
- shepherd_core/data_models/testbed/target_fixture.yaml +11 -11
- shepherd_core/data_models/testbed/testbed.py +6 -3
- shepherd_core/decoder_waveform/__init__.py +2 -0
- shepherd_core/decoder_waveform/uart.py +44 -25
- shepherd_core/fw_tools/__init__.py +2 -0
- shepherd_core/fw_tools/converter.py +20 -9
- shepherd_core/fw_tools/converter_elf.py +3 -0
- shepherd_core/fw_tools/patcher.py +16 -4
- shepherd_core/fw_tools/validation.py +25 -5
- shepherd_core/inventory/__init__.py +66 -6
- shepherd_core/inventory/python.py +4 -0
- shepherd_core/inventory/system.py +13 -1
- shepherd_core/inventory/target.py +4 -0
- shepherd_core/logger.py +5 -0
- shepherd_core/reader.py +44 -26
- shepherd_core/testbed_client/__init__.py +2 -0
- shepherd_core/testbed_client/cache_path.py +17 -0
- shepherd_core/testbed_client/client.py +14 -8
- shepherd_core/testbed_client/fixtures.py +30 -11
- shepherd_core/testbed_client/user_model.py +13 -6
- shepherd_core/vsource/__init__.py +2 -0
- shepherd_core/vsource/virtual_converter_model.py +11 -4
- shepherd_core/vsource/virtual_harvester_model.py +8 -1
- shepherd_core/vsource/virtual_source_model.py +10 -5
- shepherd_core/writer.py +28 -20
- {shepherd_core-2023.12.1.dist-info → shepherd_core-2024.4.2.dist-info}/METADATA +50 -34
- shepherd_core-2024.4.2.dist-info/RECORD +75 -0
- {shepherd_core-2023.12.1.dist-info → shepherd_core-2024.4.2.dist-info}/WHEEL +1 -1
- {shepherd_core-2023.12.1.dist-info → shepherd_core-2024.4.2.dist-info}/top_level.txt +0 -1
- shepherd_core-2023.12.1.dist-info/RECORD +0 -117
- tests/__init__.py +0 -0
- tests/conftest.py +0 -64
- tests/data_models/__init__.py +0 -0
- tests/data_models/conftest.py +0 -14
- tests/data_models/example_cal_data.yaml +0 -31
- tests/data_models/example_cal_data_faulty.yaml +0 -29
- tests/data_models/example_cal_meas.yaml +0 -178
- tests/data_models/example_cal_meas_faulty1.yaml +0 -142
- tests/data_models/example_cal_meas_faulty2.yaml +0 -136
- tests/data_models/example_config_emulator.yaml +0 -41
- tests/data_models/example_config_experiment.yaml +0 -16
- tests/data_models/example_config_experiment_alternative.yaml +0 -14
- tests/data_models/example_config_harvester.yaml +0 -15
- tests/data_models/example_config_testbed.yaml +0 -26
- tests/data_models/example_config_virtsource.yaml +0 -78
- tests/data_models/test_base_models.py +0 -205
- tests/data_models/test_content_fixtures.py +0 -41
- tests/data_models/test_content_models.py +0 -282
- tests/data_models/test_examples.py +0 -48
- tests/data_models/test_experiment_models.py +0 -277
- tests/data_models/test_task_generation.py +0 -52
- tests/data_models/test_task_models.py +0 -131
- tests/data_models/test_testbed_fixtures.py +0 -47
- tests/data_models/test_testbed_models.py +0 -187
- tests/decoder_waveform/__init__.py +0 -0
- tests/decoder_waveform/test_decoder.py +0 -34
- tests/fw_tools/__init__.py +0 -0
- tests/fw_tools/conftest.py +0 -5
- tests/fw_tools/test_converter.py +0 -76
- tests/fw_tools/test_patcher.py +0 -66
- tests/fw_tools/test_validation.py +0 -56
- tests/inventory/__init__.py +0 -0
- tests/inventory/test_inventory.py +0 -20
- tests/test_cal_hw.py +0 -34
- tests/test_examples.py +0 -40
- tests/test_logger.py +0 -15
- tests/test_reader.py +0 -283
- tests/test_writer.py +0 -169
- tests/testbed_client/__init__.py +0 -0
- tests/vsource/__init__.py +0 -0
- tests/vsource/conftest.py +0 -49
- tests/vsource/test_converter.py +0 -161
- tests/vsource/test_harvester.py +0 -73
- tests/vsource/test_z.py +0 -5
- /shepherd_core/data_models/{doc_virtual_source.py → virtual_source_doc.txt} +0 -0
- {shepherd_core-2023.12.1.dist-info → shepherd_core-2024.4.2.dist-info}/zip-safe +0 -0
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
datatype: CalMeasurementCape
|
|
3
|
-
comment: sheep0
|
|
4
|
-
parameters:
|
|
5
|
-
emulator:
|
|
6
|
-
adc_C_A: # should trigger faulty correlation
|
|
7
|
-
- reference_si: 1.0e-05
|
|
8
|
-
shepherd_raw: 647.0605606009001
|
|
9
|
-
- reference_si: 2.0e-05
|
|
10
|
-
shepherd_raw: 1247.0605606009001
|
|
11
|
-
- reference_si: 3.0e-05
|
|
12
|
-
shepherd_raw: 147.0605606009001
|
|
13
|
-
- reference_si: 10.0e-05
|
|
14
|
-
shepherd_raw: 0
|
|
15
|
-
- reference_si: 20.0e-05
|
|
16
|
-
shepherd_raw: 1111147.06056
|
|
17
|
-
adc_C_B:
|
|
18
|
-
- reference_si: 1.0e-05
|
|
19
|
-
shepherd_raw: 576.5816786854024
|
|
20
|
-
- reference_si: 1.0e-05
|
|
21
|
-
shepherd_raw: 576.5816786854024
|
|
22
|
-
dac_V_A:
|
|
23
|
-
- reference_si: 0.3003222333333334
|
|
24
|
-
shepherd_raw: 3932
|
|
25
|
-
- reference_si: 0.3003222333333334
|
|
26
|
-
shepherd_raw: 3932
|
|
27
|
-
dac_V_B:
|
|
28
|
-
- reference_si: 0.2999766666666667
|
|
29
|
-
shepherd_raw: 3932
|
|
30
|
-
- reference_si: 0.4997816
|
|
31
|
-
shepherd_raw: 6553
|
|
32
|
-
- reference_si: 0.6996186000000001
|
|
33
|
-
shepherd_raw: 9175
|
|
34
|
-
- reference_si: 0.8993501999999999
|
|
35
|
-
shepherd_raw: 11796
|
|
36
|
-
- reference_si: 1.0991329999999997
|
|
37
|
-
shepherd_raw: 14417
|
|
38
|
-
- reference_si: 1.2990616666666663
|
|
39
|
-
shepherd_raw: 17039
|
|
40
|
-
- reference_si: 1.4988709999999996
|
|
41
|
-
shepherd_raw: 19660
|
|
42
|
-
- reference_si: 1.698827333333333
|
|
43
|
-
shepherd_raw: 22282
|
|
44
|
-
- reference_si: 1.8987016666666665
|
|
45
|
-
shepherd_raw: 24903
|
|
46
|
-
- reference_si: 2.098586
|
|
47
|
-
shepherd_raw: 27525
|
|
48
|
-
- reference_si: 2.298390333333333
|
|
49
|
-
shepherd_raw: 30146
|
|
50
|
-
- reference_si: 2.498212333333334
|
|
51
|
-
shepherd_raw: 32768
|
|
52
|
-
harvester:
|
|
53
|
-
adc_C_Hrv:
|
|
54
|
-
- reference_si: 1.0e-05
|
|
55
|
-
shepherd_raw: 640.0024095179296
|
|
56
|
-
- reference_si: 3.0e-05
|
|
57
|
-
shepherd_raw: 735.0461729807887
|
|
58
|
-
- reference_si: 0.0001
|
|
59
|
-
shepherd_raw: 1076.1177490977484
|
|
60
|
-
- reference_si: 0.0003
|
|
61
|
-
shepherd_raw: 2059.0009910802773
|
|
62
|
-
- reference_si: 0.001
|
|
63
|
-
shepherd_raw: 5507.01743679997
|
|
64
|
-
- reference_si: 0.003
|
|
65
|
-
shepherd_raw: 15368.152011355087
|
|
66
|
-
- reference_si: 0.01
|
|
67
|
-
shepherd_raw: 49901.858219874135
|
|
68
|
-
adc_V_Sense:
|
|
69
|
-
- reference_si: 0.3
|
|
70
|
-
shepherd_raw: 15371.173746136044
|
|
71
|
-
- reference_si: 0.5
|
|
72
|
-
shepherd_raw: 25616.8765911925
|
|
73
|
-
- reference_si: 0.7
|
|
74
|
-
shepherd_raw: 35858.77325609033
|
|
75
|
-
- reference_si: 0.9000000000000001
|
|
76
|
-
shepherd_raw: 46100.98459438502
|
|
77
|
-
- reference_si: 1.1
|
|
78
|
-
shepherd_raw: 56369.86713557482
|
|
79
|
-
- reference_si: 1.3
|
|
80
|
-
shepherd_raw: 66615.80688466282
|
|
81
|
-
- reference_si: 1.5000000000000002
|
|
82
|
-
shepherd_raw: 76862.13213194998
|
|
83
|
-
- reference_si: 1.7000000000000002
|
|
84
|
-
shepherd_raw: 87107.99317923916
|
|
85
|
-
- reference_si: 1.9000000000000001
|
|
86
|
-
shepherd_raw: 97354.94666776135
|
|
87
|
-
- reference_si: 2.1
|
|
88
|
-
shepherd_raw: 107600.80119884663
|
|
89
|
-
- reference_si: 2.3
|
|
90
|
-
shepherd_raw: 117847.15996841929
|
|
91
|
-
- reference_si: 2.5
|
|
92
|
-
shepherd_raw: 128093.08704241508
|
|
93
|
-
dac_V_Sim:
|
|
94
|
-
- reference_si: 0.29992786666666665
|
|
95
|
-
shepherd_raw: 3932
|
|
96
|
-
- reference_si: 0.4997380666666667
|
|
97
|
-
shepherd_raw: 6553
|
|
98
|
-
- reference_si: 0.6995636999999999
|
|
99
|
-
shepherd_raw: 9175
|
|
100
|
-
- reference_si: 0.8992112333333335
|
|
101
|
-
shepherd_raw: 11796
|
|
102
|
-
- reference_si: 1.0988696666666669
|
|
103
|
-
shepherd_raw: 14417
|
|
104
|
-
- reference_si: 1.298733
|
|
105
|
-
shepherd_raw: 17039
|
|
106
|
-
- reference_si: 1.4984769999999998
|
|
107
|
-
shepherd_raw: 19660
|
|
108
|
-
- reference_si: 1.6984
|
|
109
|
-
shepherd_raw: 22282
|
|
110
|
-
- reference_si: 1.8982459999999997
|
|
111
|
-
shepherd_raw: 24903
|
|
112
|
-
- reference_si: 2.098153
|
|
113
|
-
shepherd_raw: 27525
|
|
114
|
-
- reference_si: 2.297931666666666
|
|
115
|
-
shepherd_raw: 30146
|
|
116
|
-
- reference_si: 2.4977369999999994
|
|
117
|
-
shepherd_raw: 32768
|
|
118
|
-
dac_V_Hrv:
|
|
119
|
-
- reference_si: 0.30044600000000005
|
|
120
|
-
shepherd_raw: 3932
|
|
121
|
-
- reference_si: 0.5001728333333333
|
|
122
|
-
shepherd_raw: 6553
|
|
123
|
-
- reference_si: 0.7000243666666666
|
|
124
|
-
shepherd_raw: 9175
|
|
125
|
-
- reference_si: 0.8997134666666666
|
|
126
|
-
shepherd_raw: 11796
|
|
127
|
-
- reference_si: 1.0994590000000002
|
|
128
|
-
shepherd_raw: 14417
|
|
129
|
-
- reference_si: 1.2993789999999998
|
|
130
|
-
shepherd_raw: 17039
|
|
131
|
-
- reference_si: 1.499127
|
|
132
|
-
shepherd_raw: 19660
|
|
133
|
-
- reference_si: 1.699029333333333
|
|
134
|
-
shepherd_raw: 22282
|
|
135
|
-
- reference_si: 1.8988913333333337
|
|
136
|
-
shepherd_raw: 24903
|
|
137
|
-
- reference_si: 2.0987799999999996
|
|
138
|
-
shepherd_raw: 27525
|
|
139
|
-
- reference_si: 2.2984970000000002
|
|
140
|
-
shepherd_raw: 30146
|
|
141
|
-
- reference_si: 2.4982833333333327
|
|
142
|
-
shepherd_raw: 32768
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
datatype: CalMeasurementCape
|
|
3
|
-
comment: sheep0
|
|
4
|
-
parameters:
|
|
5
|
-
emulator:
|
|
6
|
-
adc_C_A:
|
|
7
|
-
- reference_si: 1.0e-05
|
|
8
|
-
shepherd_raw: 647.0605606009001
|
|
9
|
-
- reference_si: 1.0e-05
|
|
10
|
-
shepherd_raw: 647.0605606009001
|
|
11
|
-
- reference_si: 1.0e-05
|
|
12
|
-
shepherd_raw: 647.0605606009001
|
|
13
|
-
adc_C_B:
|
|
14
|
-
- reference_si: 1.0e-05
|
|
15
|
-
shepherd_raw: 576.5816786854024
|
|
16
|
-
- reference_si: 1.0e-05
|
|
17
|
-
shepherd_raw: 576.5816786854024
|
|
18
|
-
dac_V_A: # should fail with this (>=2 entries required)
|
|
19
|
-
- reference_si: 0.3003222333333334
|
|
20
|
-
shepherd_raw: 3932
|
|
21
|
-
dac_V_B:
|
|
22
|
-
- reference_si: 0.2999766666666667
|
|
23
|
-
shepherd_raw: 3932
|
|
24
|
-
- reference_si: 0.4997816
|
|
25
|
-
shepherd_raw: 6553
|
|
26
|
-
- reference_si: 0.6996186000000001
|
|
27
|
-
shepherd_raw: 9175
|
|
28
|
-
- reference_si: 0.8993501999999999
|
|
29
|
-
shepherd_raw: 11796
|
|
30
|
-
- reference_si: 1.0991329999999997
|
|
31
|
-
shepherd_raw: 14417
|
|
32
|
-
- reference_si: 1.2990616666666663
|
|
33
|
-
shepherd_raw: 17039
|
|
34
|
-
- reference_si: 1.4988709999999996
|
|
35
|
-
shepherd_raw: 19660
|
|
36
|
-
- reference_si: 1.698827333333333
|
|
37
|
-
shepherd_raw: 22282
|
|
38
|
-
- reference_si: 1.8987016666666665
|
|
39
|
-
shepherd_raw: 24903
|
|
40
|
-
- reference_si: 2.098586
|
|
41
|
-
shepherd_raw: 27525
|
|
42
|
-
- reference_si: 2.298390333333333
|
|
43
|
-
shepherd_raw: 30146
|
|
44
|
-
- reference_si: 2.498212333333334
|
|
45
|
-
shepherd_raw: 32768
|
|
46
|
-
harvester:
|
|
47
|
-
adc_C_Hrv:
|
|
48
|
-
- reference_si: 1.0e-05
|
|
49
|
-
shepherd_raw: 640.0024095179296
|
|
50
|
-
- reference_si: 3.0e-05
|
|
51
|
-
shepherd_raw: 735.0461729807887
|
|
52
|
-
- reference_si: 0.0001
|
|
53
|
-
shepherd_raw: 1076.1177490977484
|
|
54
|
-
- reference_si: 0.0003
|
|
55
|
-
shepherd_raw: 2059.0009910802773
|
|
56
|
-
- reference_si: 0.001
|
|
57
|
-
shepherd_raw: 5507.01743679997
|
|
58
|
-
- reference_si: 0.003
|
|
59
|
-
shepherd_raw: 15368.152011355087
|
|
60
|
-
- reference_si: 0.01
|
|
61
|
-
shepherd_raw: 49901.858219874135
|
|
62
|
-
adc_V_Sense:
|
|
63
|
-
- reference_si: 0.3
|
|
64
|
-
shepherd_raw: 15371.173746136044
|
|
65
|
-
- reference_si: 0.5
|
|
66
|
-
shepherd_raw: 25616.8765911925
|
|
67
|
-
- reference_si: 0.7
|
|
68
|
-
shepherd_raw: 35858.77325609033
|
|
69
|
-
- reference_si: 0.9000000000000001
|
|
70
|
-
shepherd_raw: 46100.98459438502
|
|
71
|
-
- reference_si: 1.1
|
|
72
|
-
shepherd_raw: 56369.86713557482
|
|
73
|
-
- reference_si: 1.3
|
|
74
|
-
shepherd_raw: 66615.80688466282
|
|
75
|
-
- reference_si: 1.5000000000000002
|
|
76
|
-
shepherd_raw: 76862.13213194998
|
|
77
|
-
- reference_si: 1.7000000000000002
|
|
78
|
-
shepherd_raw: 87107.99317923916
|
|
79
|
-
- reference_si: 1.9000000000000001
|
|
80
|
-
shepherd_raw: 97354.94666776135
|
|
81
|
-
- reference_si: 2.1
|
|
82
|
-
shepherd_raw: 107600.80119884663
|
|
83
|
-
- reference_si: 2.3
|
|
84
|
-
shepherd_raw: 117847.15996841929
|
|
85
|
-
- reference_si: 2.5
|
|
86
|
-
shepherd_raw: 128093.08704241508
|
|
87
|
-
dac_V_Sim:
|
|
88
|
-
- reference_si: 0.29992786666666665
|
|
89
|
-
shepherd_raw: 3932
|
|
90
|
-
- reference_si: 0.4997380666666667
|
|
91
|
-
shepherd_raw: 6553
|
|
92
|
-
- reference_si: 0.6995636999999999
|
|
93
|
-
shepherd_raw: 9175
|
|
94
|
-
- reference_si: 0.8992112333333335
|
|
95
|
-
shepherd_raw: 11796
|
|
96
|
-
- reference_si: 1.0988696666666669
|
|
97
|
-
shepherd_raw: 14417
|
|
98
|
-
- reference_si: 1.298733
|
|
99
|
-
shepherd_raw: 17039
|
|
100
|
-
- reference_si: 1.4984769999999998
|
|
101
|
-
shepherd_raw: 19660
|
|
102
|
-
- reference_si: 1.6984
|
|
103
|
-
shepherd_raw: 22282
|
|
104
|
-
- reference_si: 1.8982459999999997
|
|
105
|
-
shepherd_raw: 24903
|
|
106
|
-
- reference_si: 2.098153
|
|
107
|
-
shepherd_raw: 27525
|
|
108
|
-
- reference_si: 2.297931666666666
|
|
109
|
-
shepherd_raw: 30146
|
|
110
|
-
- reference_si: 2.4977369999999994
|
|
111
|
-
shepherd_raw: 32768
|
|
112
|
-
dac_V_Hrv:
|
|
113
|
-
- reference_si: 0.30044600000000005
|
|
114
|
-
shepherd_raw: 3932
|
|
115
|
-
- reference_si: 0.5001728333333333
|
|
116
|
-
shepherd_raw: 6553
|
|
117
|
-
- reference_si: 0.7000243666666666
|
|
118
|
-
shepherd_raw: 9175
|
|
119
|
-
- reference_si: 0.8997134666666666
|
|
120
|
-
shepherd_raw: 11796
|
|
121
|
-
- reference_si: 1.0994590000000002
|
|
122
|
-
shepherd_raw: 14417
|
|
123
|
-
- reference_si: 1.2993789999999998
|
|
124
|
-
shepherd_raw: 17039
|
|
125
|
-
- reference_si: 1.499127
|
|
126
|
-
shepherd_raw: 19660
|
|
127
|
-
- reference_si: 1.699029333333333
|
|
128
|
-
shepherd_raw: 22282
|
|
129
|
-
- reference_si: 1.8988913333333337
|
|
130
|
-
shepherd_raw: 24903
|
|
131
|
-
- reference_si: 2.0987799999999996
|
|
132
|
-
shepherd_raw: 27525
|
|
133
|
-
- reference_si: 2.2984970000000002
|
|
134
|
-
shepherd_raw: 30146
|
|
135
|
-
- reference_si: 2.4982833333333327
|
|
136
|
-
shepherd_raw: 32768
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# This is an example configuration for shepherd.
|
|
2
|
-
# Instead of modifying, better make a copy and name it config.yml
|
|
3
|
-
# Behavior: emulate a BQ-Controller for target A, enable io-connection
|
|
4
|
-
mode: emulator
|
|
5
|
-
parameters:
|
|
6
|
-
input_path: /var/shepherd/recordings/hrv.h5
|
|
7
|
-
# output_path:
|
|
8
|
-
# - providing a directory -> file is named emu_timestamp.h5
|
|
9
|
-
# - for a complete path the filename is not changed except it exists and overwrite is disabled -> emu#num.h5
|
|
10
|
-
output_path: /var/shepherd/recordings
|
|
11
|
-
force_overwrite: false
|
|
12
|
-
|
|
13
|
-
time_start: 2042-12-13 14:15:16
|
|
14
|
-
duration: 600
|
|
15
|
-
|
|
16
|
-
enable_io: true
|
|
17
|
-
io_port: A # either Port A or B
|
|
18
|
-
pwr_port: A
|
|
19
|
-
|
|
20
|
-
voltage_aux: 3.3
|
|
21
|
-
# aux_voltage options:
|
|
22
|
-
# - None to disable (0 V),
|
|
23
|
-
# - 0-4.5 for specific const Voltage,
|
|
24
|
-
# - "mid" will output intermediate voltage (vsource storage cap),
|
|
25
|
-
# - true or "main" to mirror main target voltage
|
|
26
|
-
|
|
27
|
-
virtual_source: # provide path, name (ie. default, BQ25570) or parameters
|
|
28
|
-
inherit_from: BQ25570
|
|
29
|
-
harvester:
|
|
30
|
-
name: "mppt_bq_solar"
|
|
31
|
-
V_intermediate_init_mV: 3600
|
|
32
|
-
V_buck_drop_mV: 0
|
|
33
|
-
V_output_mV: 3000
|
|
34
|
-
|
|
35
|
-
power_tracing: null
|
|
36
|
-
gpio_tracing:
|
|
37
|
-
uart_decode: true
|
|
38
|
-
uart_baudrate: 9600
|
|
39
|
-
sys_logging:
|
|
40
|
-
dmesg: true
|
|
41
|
-
verbose: 2 # serious performance impact for value > 3
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
datatype: Experiment
|
|
3
|
-
parameters:
|
|
4
|
-
id: 4567
|
|
5
|
-
name: meaningful Test-Name
|
|
6
|
-
created: 2023-11-11 11:11:11
|
|
7
|
-
time_start: 2023-12-12 12:12:12
|
|
8
|
-
target_configs:
|
|
9
|
-
- target_IDs: [1, 2, 3, 4]
|
|
10
|
-
custom_IDs: [0, 1, 2, 3]
|
|
11
|
-
energy_env:
|
|
12
|
-
name: SolarSunny
|
|
13
|
-
virtual_source:
|
|
14
|
-
name: diode+capacitor
|
|
15
|
-
firmware1:
|
|
16
|
-
name: nrf52_demo_rf
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: 4567
|
|
3
|
-
name: meaningful Test-Name
|
|
4
|
-
created: 2023-11-11 11:11:11
|
|
5
|
-
time_start: 2023-12-12 12:12:12
|
|
6
|
-
target_configs:
|
|
7
|
-
- target_IDs: [1, 2, 3, 4]
|
|
8
|
-
custom_IDs: [0, 1, 2, 3]
|
|
9
|
-
energy_env:
|
|
10
|
-
name: SolarSunny
|
|
11
|
-
virtual_source:
|
|
12
|
-
name: diode+capacitor
|
|
13
|
-
firmware1:
|
|
14
|
-
name: nrf52_demo_rf
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# This is an example configuration for shepherd.
|
|
2
|
-
# Instead of modifying, better make a copy and name it config.yml
|
|
3
|
-
# Behavior: record data for 20s or until stopped by ctrl+c
|
|
4
|
-
mode: harvester
|
|
5
|
-
parameters:
|
|
6
|
-
duration: 20
|
|
7
|
-
# output_path:
|
|
8
|
-
# - providing a directory -> file is named hrv_timestamp.h5
|
|
9
|
-
# - for a complete path the filename is not changed except it exists and overwrite is disabled -> hrv#num.h5
|
|
10
|
-
output_path: /var/shepherd/recordings/hrv.h5
|
|
11
|
-
virtual_harvester:
|
|
12
|
-
name: ivcurves
|
|
13
|
-
use_cal_default: true
|
|
14
|
-
force_overwrite: false
|
|
15
|
-
verbose: 2 # serious performance impact for value > 3
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: 8472
|
|
3
|
-
name: undine
|
|
4
|
-
description: lore
|
|
5
|
-
observers:
|
|
6
|
-
- id: 1911
|
|
7
|
-
name: the_one
|
|
8
|
-
description: data
|
|
9
|
-
ip: 127.0.0.1
|
|
10
|
-
mac: AA-BB-CC-DD-EE-FF
|
|
11
|
-
room: bar1
|
|
12
|
-
eth_port: bar1xyz
|
|
13
|
-
cape:
|
|
14
|
-
id: 123
|
|
15
|
-
name: invisibility
|
|
16
|
-
version: v7.00
|
|
17
|
-
description: see no more
|
|
18
|
-
target_a:
|
|
19
|
-
id: 101
|
|
20
|
-
name: hirogen
|
|
21
|
-
version: v2.00
|
|
22
|
-
description: delta
|
|
23
|
-
mcu1: nRF52
|
|
24
|
-
target_b: null
|
|
25
|
-
data_on_server: /tmp
|
|
26
|
-
data_on_observer: /mnt/shp
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
VirtualSource:
|
|
2
|
-
# crosscheck against check_and_complete() in virt_source_data.py to see:
|
|
3
|
-
# - what is required
|
|
4
|
-
# - the limits and default values
|
|
5
|
-
# NOTE: input can be also float (ie. 2.3e-4), there is no proper int-formatting (like in py 1_000_000)
|
|
6
|
-
# TODO: find a way to process direct, boost, boost + buck, future: IV-Curves as input for same converter
|
|
7
|
-
|
|
8
|
-
# General Config
|
|
9
|
-
id: 0000
|
|
10
|
-
name: custom Test
|
|
11
|
-
inherit_from: neutral # to complete undefined vars, bases: neutral, direct, BQ25504 (boost), BQ25570 (boost-buck)
|
|
12
|
-
enable_boost: true # if false -> v_storage becomes v_input, output-switch-hysteresis is still usable
|
|
13
|
-
enable_buck: true # if false -> v_output becomes v_storage
|
|
14
|
-
|
|
15
|
-
interval_startup_delay_drain_ms: 0
|
|
16
|
-
|
|
17
|
-
V_input_max_mV: 3000
|
|
18
|
-
I_input_max_mA: 100
|
|
19
|
-
V_input_drop_mV: 0 # simulate input-diode
|
|
20
|
-
|
|
21
|
-
C_intermediate_uF: 100 # primary storage-Cap
|
|
22
|
-
V_intermediate_init_mV: 3000 # allow a proper / fast startup
|
|
23
|
-
I_intermediate_leak_nA: 9
|
|
24
|
-
|
|
25
|
-
V_pwr_good_enable_threshold_mV: 2900 # target is informed by pwr-good on output-pin (hysteresis) -> for intermediate voltage
|
|
26
|
-
V_pwr_good_disable_threshold_mV: 2400
|
|
27
|
-
immediate_pwr_good_signal: false # 1: activate instant schmitt-trigger, 0: stay in interval for checking thresholds
|
|
28
|
-
|
|
29
|
-
C_output_uF: 1.0 # final (always last) stage to compensate undetectable current spikes when enabling power for target
|
|
30
|
-
|
|
31
|
-
# Extra
|
|
32
|
-
V_output_log_gpio_threshold_mV: 1400 # min voltage needed to enable recording changes in gpio-bank
|
|
33
|
-
|
|
34
|
-
# Boost Converter, ie. BQ25504
|
|
35
|
-
V_input_boost_threshold_mV: 130 # min input-voltage for the boost converter to work
|
|
36
|
-
V_intermediate_max_mV: 3600 # -> boost converter shuts off
|
|
37
|
-
|
|
38
|
-
LUT_input_efficiency: [
|
|
39
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ], # rows are current -> here a[V=0][:]
|
|
40
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
41
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
42
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
43
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
44
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
45
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
46
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
47
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
48
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
49
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
50
|
-
[ 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50, 0.50 ],
|
|
51
|
-
] # input-array[12][12] depending on array[inp_voltage][log(inp_current)], influence of cap-voltage is not implemented
|
|
52
|
-
LUT_input_V_min_log2_uV: 7 # 2^7 = 128 uV -> array[0] is for inputs < 128 uV
|
|
53
|
-
LUT_input_I_min_log2_nA: 8 # 2^8 = 256 nA -> array[0] is for inputs < 256 nA
|
|
54
|
-
|
|
55
|
-
# Buck-Converter , ie. BQ25570
|
|
56
|
-
V_output_mV: 2000
|
|
57
|
-
V_buck_drop_mV: 0 # simulate LDO min voltage differential or output-diode
|
|
58
|
-
|
|
59
|
-
V_intermediate_enable_threshold_mV: 2600 # -> target gets connected (hysteresis-combo with next value)
|
|
60
|
-
V_intermediate_disable_threshold_mV: 2300 # -> target gets disconnected
|
|
61
|
-
interval_check_thresholds_ms: 64.0 # some BQs check every 64 ms if output should be disconnected
|
|
62
|
-
|
|
63
|
-
# TODO: add dropdown-voltage and option to keep output enabled
|
|
64
|
-
LUT_output_efficiency: [0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80, 0.80]
|
|
65
|
-
# array[12] depending on output_current
|
|
66
|
-
LUT_output_I_min_log2_nA: 8 # 2^8 = 256 nA -> array[0] is for inputs < 256 nA, see notes on LUT_input for explanation
|
|
67
|
-
|
|
68
|
-
# Documentation for LUTs
|
|
69
|
-
# NOTE 1:
|
|
70
|
-
# - for clarity: rows are current, columns are voltage -> first row is array[V=0][:]
|
|
71
|
-
# NOTE 2:
|
|
72
|
-
# - input -> these 0..1-values will be transformed to 8bit internally, 1.0 represented by 255
|
|
73
|
-
# - output -> values are transformed to 2^4/value (inverse)
|
|
74
|
-
# NOTE 3:
|
|
75
|
-
# - distances between these 12 values in current-dimension are not linear but log2-Scale
|
|
76
|
-
# - Input Values smaller than Min-Limits below are directed to array[0]
|
|
77
|
-
# - array[1] is used for inputs from limit to 2*limit and so on
|
|
78
|
-
# - for limit V_min_log2_uV = 0 the range equals: array[0] is for < 1 uV, array[1] is for 1 uV, array[2] is for 2-3 uV, ... , array[12] is for >= 2048 uV
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
import pytest
|
|
6
|
-
from pydantic import ValidationError
|
|
7
|
-
|
|
8
|
-
from shepherd_core.data_models.base.cal_measurement import CalMeasurementCape
|
|
9
|
-
from shepherd_core.data_models.base.calibration import CalibrationCape
|
|
10
|
-
from shepherd_core.data_models.base.calibration import CalibrationEmulator
|
|
11
|
-
from shepherd_core.data_models.base.calibration import CalibrationHarvester
|
|
12
|
-
from shepherd_core.data_models.base.calibration import CalibrationPair
|
|
13
|
-
from shepherd_core.data_models.base.calibration import CalibrationSeries
|
|
14
|
-
from shepherd_core.data_models.base.calibration import CapeData
|
|
15
|
-
from shepherd_core.data_models.base.content import ContentModel
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def test_base_model_cape_data() -> None:
|
|
19
|
-
CapeData(serial_number="xyz1")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def test_base_model_cape_data_fail() -> None:
|
|
23
|
-
with pytest.raises(ValueError):
|
|
24
|
-
CapeData()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def test_base_model_cal_pair_conv() -> None:
|
|
28
|
-
cal = CalibrationPair(gain=4.9)
|
|
29
|
-
val_raw = 500
|
|
30
|
-
val_si = cal.raw_to_si(val_raw)
|
|
31
|
-
val_rbw = cal.si_to_raw(val_si)
|
|
32
|
-
assert val_raw == val_rbw
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def test_base_model_cal_pair_conv2() -> None:
|
|
36
|
-
cal = CalibrationPair(gain=44)
|
|
37
|
-
rng = np.random.default_rng()
|
|
38
|
-
val_raw = rng.integers(low=0, high=2000, size=20)
|
|
39
|
-
val_si = cal.raw_to_si(val_raw)
|
|
40
|
-
val_rbw = cal.si_to_raw(val_si)
|
|
41
|
-
assert val_raw.size == val_rbw.size
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def test_base_model_cal_series_min() -> None:
|
|
45
|
-
CalibrationSeries()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def test_base_model_cal_series_all() -> None:
|
|
49
|
-
cal = CalibrationCape()
|
|
50
|
-
_ = CalibrationSeries.from_cal(cal.harvester)
|
|
51
|
-
_ = CalibrationSeries.from_cal(cal.emulator)
|
|
52
|
-
_ = CalibrationSeries.from_cal(cal.emulator, emu_port_a=True)
|
|
53
|
-
_ = CalibrationSeries.from_cal(cal.emulator, emu_port_a=False)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def test_base_model_cal_hrv_min() -> None:
|
|
57
|
-
cal = CalibrationHarvester()
|
|
58
|
-
cs = cal.export_for_sysfs()
|
|
59
|
-
assert len(cs) == 6
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def test_base_model_cal_emu_min() -> None:
|
|
63
|
-
cal = CalibrationEmulator()
|
|
64
|
-
cs = cal.export_for_sysfs()
|
|
65
|
-
assert len(cs) == 6
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def test_base_model_cal_cape_bytestr() -> None:
|
|
69
|
-
cal1 = CalibrationCape()
|
|
70
|
-
cb = cal1.to_bytestr()
|
|
71
|
-
cal2 = CalibrationCape.from_bytestr(cb)
|
|
72
|
-
assert cal1.get_hash() == cal2.get_hash()
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def test_base_model_cal_cape_bytestr_with_cape_data() -> None:
|
|
76
|
-
cal1 = CalibrationCape(cape=CapeData(serial_number="123"))
|
|
77
|
-
cb = cal1.to_bytestr()
|
|
78
|
-
cal2 = CalibrationCape.from_bytestr(cb, cal1.cape)
|
|
79
|
-
assert cal1.get_hash() == cal2.get_hash()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def test_base_model_cal_cape_example(tmp_path: Path) -> None:
|
|
83
|
-
cal0 = CalMeasurementCape()
|
|
84
|
-
path1 = Path(__file__).resolve().with_name("example_cal_data.yaml")
|
|
85
|
-
cal1 = CalibrationCape.from_file(path1)
|
|
86
|
-
path2 = tmp_path / "cal_data_new.yaml"
|
|
87
|
-
cal1.to_file(path2)
|
|
88
|
-
cal2 = CalibrationCape.from_file(path2)
|
|
89
|
-
assert cal0.get_hash() != cal1.get_hash()
|
|
90
|
-
assert cal1.get_hash() == cal2.get_hash()
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def test_base_model_cal_hrv_fault() -> None:
|
|
94
|
-
path = Path(__file__).resolve().with_name("example_cal_data_faulty.yaml")
|
|
95
|
-
cal = CalibrationCape.from_file(path)
|
|
96
|
-
with pytest.raises(ValueError):
|
|
97
|
-
_ = cal.harvester.export_for_sysfs()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def test_base_model_cal_emu_fault() -> None:
|
|
101
|
-
path = Path(__file__).resolve().with_name("example_cal_data_faulty.yaml")
|
|
102
|
-
cal = CalibrationCape.from_file(path)
|
|
103
|
-
with pytest.raises(ValueError):
|
|
104
|
-
_ = cal.emulator.export_for_sysfs()
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
def test_base_model_cal_meas_min() -> None:
|
|
108
|
-
cm1 = CalMeasurementCape()
|
|
109
|
-
cal1 = cm1.to_cal()
|
|
110
|
-
cal2 = CalibrationCape()
|
|
111
|
-
assert cal1.get_hash() == cal2.get_hash()
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def test_base_model_cal_meas_example() -> None:
|
|
115
|
-
path1 = Path(__file__).resolve().with_name("example_cal_meas.yaml")
|
|
116
|
-
cm1 = CalMeasurementCape.from_file(path1)
|
|
117
|
-
cal1 = cm1.to_cal()
|
|
118
|
-
cal2 = CalibrationCape()
|
|
119
|
-
assert cal1.get_hash() != cal2.get_hash()
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def test_base_model_cal_meas_fault_correlation() -> None:
|
|
123
|
-
path = Path(__file__).resolve().with_name("example_cal_meas_faulty1.yaml")
|
|
124
|
-
with pytest.raises(ValueError):
|
|
125
|
-
_ = CalMeasurementCape.from_file(path)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def test_base_model_cal_meas_fault_no_pairs() -> None:
|
|
129
|
-
path = Path(__file__).resolve().with_name("example_cal_meas_faulty2.yaml")
|
|
130
|
-
with pytest.raises(ValidationError):
|
|
131
|
-
_ = CalMeasurementCape.from_file(path)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def test_base_model_content_str_repr() -> None:
|
|
135
|
-
content = ContentModel(name="tricky", owner="peter", group="work")
|
|
136
|
-
print(content)
|
|
137
|
-
assert str(content) == "tricky"
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
def test_base_model_content_public_group() -> None:
|
|
141
|
-
_ = ContentModel(
|
|
142
|
-
name="tricky",
|
|
143
|
-
description="fake",
|
|
144
|
-
owner="peter",
|
|
145
|
-
group="work",
|
|
146
|
-
visible2group=True,
|
|
147
|
-
)
|
|
148
|
-
with pytest.raises(ValueError):
|
|
149
|
-
_ = ContentModel(name="tricky", owner="peter", group="work", visible2group=True)
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def test_base_model_content_public_all() -> None:
|
|
153
|
-
_ = ContentModel(
|
|
154
|
-
name="tricky", description="fake", owner="peter", group="work", visible2all=True
|
|
155
|
-
)
|
|
156
|
-
with pytest.raises(ValueError):
|
|
157
|
-
_ = ContentModel(name="tricky", owner="peter", group="work", visible2all=True)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
# ContentModel below is used as inheritor of ShpModel
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
def test_base_model_shepherd_scheme(tmp_path: Path) -> None:
|
|
164
|
-
os.chdir(tmp_path)
|
|
165
|
-
ContentModel.schema_to_file(tmp_path / "schema.yaml")
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
def test_base_model_shepherd_min(tmp_path: Path) -> None:
|
|
169
|
-
content = ContentModel(name="tricky", owner="peter", group="work")
|
|
170
|
-
content.to_file(tmp_path / "content1.yaml", minimal=True)
|
|
171
|
-
content.to_file(tmp_path / "content2.yaml", minimal=False)
|
|
172
|
-
# minimal should produce min-set (input dict), but does not work currently
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
def test_base_model_shepherd_fault_load_other(tmp_path: Path) -> None:
|
|
176
|
-
path = tmp_path / "content.yaml"
|
|
177
|
-
content = ContentModel(name="tricky", owner="peter", group="work")
|
|
178
|
-
content.to_file(path)
|
|
179
|
-
with pytest.raises(ValueError):
|
|
180
|
-
CalibrationCape.from_file(path)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
def test_base_model_shepherd_fault_mutation() -> None:
|
|
184
|
-
content = ContentModel(name="tricky", owner="peter", group="work")
|
|
185
|
-
with pytest.raises(ValidationError):
|
|
186
|
-
content.name = "whatever"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def test_base_model_shepherd_fault_short_str() -> None:
|
|
190
|
-
with pytest.raises(ValidationError):
|
|
191
|
-
_ = ContentModel(name="", owner="peter", group="work")
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
def test_base_model_shepherd_fault_long_str() -> None:
|
|
195
|
-
with pytest.raises(ValidationError):
|
|
196
|
-
_ = ContentModel(
|
|
197
|
-
name="very_long_123456789_123456789_1234567890", owner="peter", group="work"
|
|
198
|
-
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
def test_base_model_shepherd_fault_unsafe_str() -> None:
|
|
202
|
-
with pytest.raises(ValidationError):
|
|
203
|
-
_ = ContentModel(name="fs_trouble<>", owner="peter", group="work")
|
|
204
|
-
with pytest.raises(ValidationError):
|
|
205
|
-
_ = ContentModel(name="unicode", owner="peter", group="work", description="🐍")
|