shepherd-core 2024.7.3__tar.gz → 2024.7.4__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.7.3 → shepherd_core-2024.7.4}/PKG-INFO +9 -7
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/README.md +8 -6
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/calibration_hw_def.py +15 -12
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/calibration.py +4 -3
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/version.py +1 -1
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/PKG-INFO +9 -7
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/experiment_from_yaml.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/experiment_generic_var1.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/experiment_generic_var2.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/experiment_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/firmware_model.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/firmware_modification.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/inventory.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/uart_decode_waveform.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/uart_raw2.csv +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/vharvester_simulation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/examples/vsource_simulation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/pyproject.toml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/setup.cfg +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/commons.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/cal_measurement.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/content.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/shepherd.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/timezone.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/wrapper.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/_external_fixtures.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/energy_environment.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/energy_environment_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/firmware.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/firmware_datatype.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/virtual_harvester.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/virtual_harvester_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/virtual_source.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/virtual_source_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/experiment.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/observer_features.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/target_config.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/readme.md +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/emulation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/firmware_mod.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/harvest.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/observer_tasks.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/programming.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/testbed_tasks.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/cape.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/cape_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/gpio.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/gpio_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/mcu.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/mcu_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/observer.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/observer_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/target.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/target_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/testbed.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/testbed_fixture.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/virtual_source_doc.txt +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/decoder_waveform/uart.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/fw_tools/converter.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/fw_tools/converter_elf.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/fw_tools/patcher.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/fw_tools/validation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/inventory/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/inventory/python.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/inventory/system.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/inventory/target.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/logger.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/reader.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/cache_path.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/client_abc_fix.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/client_web.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/fixtures.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/user_model.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_converter_model.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_harvester_model.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_source_model.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/writer.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/SOURCES.txt +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/dependency_links.txt +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/requires.txt +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/top_level.txt +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core.egg-info/zip-safe +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/conftest.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/conftest.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_data.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_data_faulty.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_meas.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_meas_faulty1.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_meas_faulty2.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_emulator.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_experiment.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_experiment_alternative.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_harvester.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_testbed.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_virtsource.yaml +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_base_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_content_fixtures.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_content_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_examples.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_experiment_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_task_generation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_task_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_testbed_fixtures.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_testbed_models.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/decoder_waveform/test_decoder.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/build_msp.elf +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/build_nrf.elf +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/conftest.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/test_converter.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/test_patcher.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/fw_tools/test_validation.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/inventory/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/inventory/test_inventory.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/test_cal_hw.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/test_examples.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/test_logger.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/test_reader.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/test_writer.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/testbed_client/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/vsource/__init__.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/vsource/conftest.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/vsource/test_converter.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/vsource/test_harvester.py +0 -0
- {shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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.7.
|
|
3
|
+
Version: 2024.7.4
|
|
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>
|
|
@@ -136,28 +136,30 @@ Notes:
|
|
|
136
136
|
The Library is available via PyPI and can be installed with
|
|
137
137
|
|
|
138
138
|
```shell
|
|
139
|
-
|
|
139
|
+
pip install shepherd-core -U
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
# or for the full experience (includes core)
|
|
142
|
+
pip install shepherd-data -U
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
|
|
146
146
|
|
|
147
147
|
```Shell
|
|
148
148
|
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U
|
|
149
|
+
# and on sheep with newer debian
|
|
150
|
+
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
149
151
|
```
|
|
150
152
|
|
|
151
153
|
If you are working with ``.elf``-files (embedding into experiments) you make "objcopy" accessible to python. In Ubuntu, you can either install ``build-essential`` or ``binutils-$ARCH`` with arch being ``msp430`` or ``arm-none-eabi`` for the nRF52.
|
|
152
154
|
|
|
153
155
|
```shell
|
|
154
|
-
|
|
156
|
+
sudo apt install build-essential
|
|
155
157
|
```
|
|
156
158
|
|
|
157
159
|
For more advanced work with ``.elf``-files (modify value of symbols / target-ID) you should install
|
|
158
160
|
|
|
159
161
|
```shell
|
|
160
|
-
|
|
162
|
+
pip install shepherd-core[elf]
|
|
161
163
|
```
|
|
162
164
|
|
|
163
165
|
and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/stable/install.html) are met.
|
|
@@ -165,7 +167,7 @@ and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/s
|
|
|
165
167
|
For creating an inventory of the host-system you should install
|
|
166
168
|
|
|
167
169
|
```shell
|
|
168
|
-
|
|
170
|
+
pip install shepherd-core[inventory]
|
|
169
171
|
```
|
|
170
172
|
|
|
171
173
|
## Unittests
|
|
@@ -80,28 +80,30 @@ Notes:
|
|
|
80
80
|
The Library is available via PyPI and can be installed with
|
|
81
81
|
|
|
82
82
|
```shell
|
|
83
|
-
|
|
83
|
+
pip install shepherd-core -U
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
# or for the full experience (includes core)
|
|
86
|
+
pip install shepherd-data -U
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
|
|
90
90
|
|
|
91
91
|
```Shell
|
|
92
92
|
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U
|
|
93
|
+
# and on sheep with newer debian
|
|
94
|
+
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
93
95
|
```
|
|
94
96
|
|
|
95
97
|
If you are working with ``.elf``-files (embedding into experiments) you make "objcopy" accessible to python. In Ubuntu, you can either install ``build-essential`` or ``binutils-$ARCH`` with arch being ``msp430`` or ``arm-none-eabi`` for the nRF52.
|
|
96
98
|
|
|
97
99
|
```shell
|
|
98
|
-
|
|
100
|
+
sudo apt install build-essential
|
|
99
101
|
```
|
|
100
102
|
|
|
101
103
|
For more advanced work with ``.elf``-files (modify value of symbols / target-ID) you should install
|
|
102
104
|
|
|
103
105
|
```shell
|
|
104
|
-
|
|
106
|
+
pip install shepherd-core[elf]
|
|
105
107
|
```
|
|
106
108
|
|
|
107
109
|
and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/stable/install.html) are met.
|
|
@@ -109,7 +111,7 @@ and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/s
|
|
|
109
111
|
For creating an inventory of the host-system you should install
|
|
110
112
|
|
|
111
113
|
```shell
|
|
112
|
-
|
|
114
|
+
pip install shepherd-core[inventory]
|
|
113
115
|
```
|
|
114
116
|
|
|
115
117
|
## Unittests
|
|
@@ -32,45 +32,48 @@ RAW_MAX_ADC = 2**M_ADC - 1
|
|
|
32
32
|
RAW_MAX_DAC = 2**M_DAC - 1
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def adc_current_to_raw(current: float) -> int:
|
|
35
|
+
def adc_current_to_raw(current: float, *, limited: bool = True) -> int:
|
|
36
36
|
"""Convert back a current [A] to raw ADC value."""
|
|
37
37
|
# voltage on input of adc
|
|
38
38
|
val_adc = G_INST_AMP * R_SHT * current
|
|
39
39
|
# digital value according to ADC gain
|
|
40
40
|
val_raw = int(val_adc * (2**M_ADC) / (G_ADC_I * V_REF_ADC))
|
|
41
|
-
return min(max(val_raw, 0), 2**M_ADC - 1)
|
|
41
|
+
return min(max(val_raw, 0), 2**M_ADC - 1) if limited else val_raw
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def adc_raw_to_current(value: int) -> float:
|
|
44
|
+
def adc_raw_to_current(value: int, *, limited: bool = True) -> float:
|
|
45
45
|
"""Convert a raw ADC value to a current [A]."""
|
|
46
|
-
|
|
46
|
+
if limited:
|
|
47
|
+
value = min(max(value, 0), 2**M_ADC - 1)
|
|
47
48
|
# voltage on input of adc
|
|
48
49
|
val_adc = float(value) * (G_ADC_I * V_REF_ADC) / (2**M_ADC)
|
|
49
50
|
# current according to adc value
|
|
50
51
|
return val_adc / (R_SHT * G_INST_AMP)
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
def adc_voltage_to_raw(voltage: float) -> int:
|
|
54
|
+
def adc_voltage_to_raw(voltage: float, *, limited: bool = True) -> int:
|
|
54
55
|
"""Convert back a voltage [V] to raw ADC value."""
|
|
55
56
|
# digital value according to ADC gain
|
|
56
57
|
val_raw = int(voltage * (2**M_ADC) / (G_ADC_V * V_REF_ADC))
|
|
57
|
-
return min(max(val_raw, 0), 2**M_ADC - 1)
|
|
58
|
+
return min(max(val_raw, 0), 2**M_ADC - 1) if limited else val_raw
|
|
58
59
|
|
|
59
60
|
|
|
60
|
-
def adc_raw_to_voltage(value: int) -> float:
|
|
61
|
+
def adc_raw_to_voltage(value: int, *, limited: bool = True) -> float:
|
|
61
62
|
"""Convert a raw ADC value to a voltage [V]."""
|
|
62
|
-
|
|
63
|
+
if limited:
|
|
64
|
+
value = min(max(value, 0), 2**M_ADC - 1)
|
|
63
65
|
# voltage according to ADC value
|
|
64
66
|
return float(value) * (G_ADC_V * V_REF_ADC) / (2**M_ADC)
|
|
65
67
|
|
|
66
68
|
|
|
67
|
-
def dac_raw_to_voltage(value: int) -> float:
|
|
69
|
+
def dac_raw_to_voltage(value: int, *, limited: bool = True) -> float:
|
|
68
70
|
"""Convert back a raw DAC value to a voltage [V]."""
|
|
69
|
-
|
|
71
|
+
if limited:
|
|
72
|
+
value = min(max(value, 0), 2**M_DAC - 1)
|
|
70
73
|
return float(value) * (V_REF_DAC * G_DAC) / (2**M_DAC)
|
|
71
74
|
|
|
72
75
|
|
|
73
|
-
def dac_voltage_to_raw(voltage: float) -> int:
|
|
76
|
+
def dac_voltage_to_raw(voltage: float, *, limited: bool = True) -> int:
|
|
74
77
|
"""Convert a voltage [V] to raw DAC value."""
|
|
75
78
|
val_raw = int(voltage * (2**M_DAC) / (V_REF_DAC * G_DAC))
|
|
76
|
-
return min(max(val_raw, 0), 2**M_DAC - 1)
|
|
79
|
+
return min(max(val_raw, 0), 2**M_DAC - 1) if limited else val_raw
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/calibration.py
RENAMED
|
@@ -51,6 +51,7 @@ class CalibrationPair(ShpModel):
|
|
|
51
51
|
|
|
52
52
|
gain: PositiveFloat
|
|
53
53
|
offset: float = 0
|
|
54
|
+
# TODO: add unit
|
|
54
55
|
|
|
55
56
|
def raw_to_si(self, values_raw: Calc_t, *, allow_negative: bool = True) -> Calc_t:
|
|
56
57
|
"""Convert between physical units and raw unsigned integers."""
|
|
@@ -79,8 +80,8 @@ class CalibrationPair(ShpModel):
|
|
|
79
80
|
@classmethod
|
|
80
81
|
def from_fn(cls, fn: Callable) -> Self:
|
|
81
82
|
"""Probe linear function to determine scaling values."""
|
|
82
|
-
offset = fn(0)
|
|
83
|
-
gain_inv = fn(1.0) - offset
|
|
83
|
+
offset = fn(0, limited=False)
|
|
84
|
+
gain_inv = fn(1.0, limited=False) - offset
|
|
84
85
|
return cls(
|
|
85
86
|
gain=1.0 / float(gain_inv),
|
|
86
87
|
offset=-float(offset) / gain_inv,
|
|
@@ -274,7 +275,7 @@ class CalibrationSeries(ShpModel):
|
|
|
274
275
|
emu_port_a: bool = True,
|
|
275
276
|
) -> Self:
|
|
276
277
|
if isinstance(cal, CalibrationHarvester):
|
|
277
|
-
return cls(voltage=cal.adc_V_Sense, current=cal.
|
|
278
|
+
return cls(voltage=cal.adc_V_Sense, current=cal.adc_C_Hrv)
|
|
278
279
|
if emu_port_a:
|
|
279
280
|
return cls(voltage=cal.dac_V_A, current=cal.adc_C_A)
|
|
280
281
|
return cls(voltage=cal.dac_V_B, current=cal.adc_C_B)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2024.7.
|
|
3
|
+
Version: 2024.7.4
|
|
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>
|
|
@@ -136,28 +136,30 @@ Notes:
|
|
|
136
136
|
The Library is available via PyPI and can be installed with
|
|
137
137
|
|
|
138
138
|
```shell
|
|
139
|
-
|
|
139
|
+
pip install shepherd-core -U
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
# or for the full experience (includes core)
|
|
142
|
+
pip install shepherd-data -U
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
For bleeding-edge-features or dev-work it is possible to install directly from GitHub-Sources (here `dev`-branch):
|
|
146
146
|
|
|
147
147
|
```Shell
|
|
148
148
|
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U
|
|
149
|
+
# and on sheep with newer debian
|
|
150
|
+
pip install git+https://github.com/orgua/shepherd-datalib.git@dev#subdirectory=shepherd_core -U --break-system-packages
|
|
149
151
|
```
|
|
150
152
|
|
|
151
153
|
If you are working with ``.elf``-files (embedding into experiments) you make "objcopy" accessible to python. In Ubuntu, you can either install ``build-essential`` or ``binutils-$ARCH`` with arch being ``msp430`` or ``arm-none-eabi`` for the nRF52.
|
|
152
154
|
|
|
153
155
|
```shell
|
|
154
|
-
|
|
156
|
+
sudo apt install build-essential
|
|
155
157
|
```
|
|
156
158
|
|
|
157
159
|
For more advanced work with ``.elf``-files (modify value of symbols / target-ID) you should install
|
|
158
160
|
|
|
159
161
|
```shell
|
|
160
|
-
|
|
162
|
+
pip install shepherd-core[elf]
|
|
161
163
|
```
|
|
162
164
|
|
|
163
165
|
and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/stable/install.html) are met.
|
|
@@ -165,7 +167,7 @@ and also make sure the prereqs for the [pwntools](https://docs.pwntools.com/en/s
|
|
|
165
167
|
For creating an inventory of the host-system you should install
|
|
166
168
|
|
|
167
169
|
```shell
|
|
168
|
-
|
|
170
|
+
pip install shepherd-core[inventory]
|
|
169
171
|
```
|
|
170
172
|
|
|
171
173
|
## Unittests
|
|
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.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/cal_measurement.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/shepherd.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/base/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/content/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/experiment/experiment.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/__init__.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/emulation.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/firmware_mod.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/observer_tasks.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/programming.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/task/testbed_tasks.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/mcu_fixture.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/observer.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/target.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/testbed/testbed.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/data_models/virtual_source_doc.txt
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/cache_path.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/client_abc_fix.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/client_web.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/testbed_client/user_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_converter_model.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_harvester_model.py
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/shepherd_core/vsource/virtual_source_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_data_faulty.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_meas_faulty1.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_cal_meas_faulty2.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_emulator.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_experiment.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_harvester.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_testbed.yaml
RENAMED
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/example_config_virtsource.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_content_fixtures.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/tests/data_models/test_experiment_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{shepherd_core-2024.7.3 → shepherd_core-2024.7.4}/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
|
|
File without changes
|