shepherd-core 2025.4.1__tar.gz → 2025.4.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-2025.4.1 → shepherd_core-2025.4.2}/PKG-INFO +2 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/simulate_vharvester.py +1 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/simulate_vsource.py +1 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/pyproject.toml +6 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/calibration_hw_def.py +11 -11
- shepherd_core-2025.4.2/shepherd_core/commons.py +8 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/cal_measurement.py +10 -11
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/calibration.py +7 -6
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/content.py +1 -1
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/shepherd.py +6 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/wrapper.py +2 -2
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/energy_environment.py +4 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/firmware.py +9 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/virtual_harvester.py +30 -22
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/virtual_source.py +16 -15
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/experiment/experiment.py +13 -13
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/experiment/observer_features.py +7 -8
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/experiment/target_config.py +12 -12
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/__init__.py +5 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/emulation.py +13 -14
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/firmware_mod.py +11 -11
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/harvest.py +7 -6
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/observer_tasks.py +7 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/programming.py +11 -11
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/task/testbed_tasks.py +8 -8
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/cape.py +7 -6
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/gpio.py +8 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/mcu.py +8 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/observer.py +9 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/target.py +9 -7
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/testbed.py +11 -10
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/decoder_waveform/uart.py +5 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/fw_tools/converter.py +4 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/fw_tools/patcher.py +14 -15
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/fw_tools/validation.py +3 -2
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/inventory/__init__.py +6 -6
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/inventory/python.py +1 -1
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/inventory/system.py +11 -8
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/inventory/target.py +3 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/logger.py +2 -2
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/reader.py +37 -39
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/client_abc_fix.py +20 -13
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/client_web.py +18 -11
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/fixtures.py +19 -16
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/user_model.py +6 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/version.py +1 -1
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/target_model.py +3 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/virtual_converter_model.py +3 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/virtual_harvester_model.py +7 -9
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/virtual_harvester_simulation.py +6 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/virtual_source_model.py +6 -5
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/virtual_source_simulation.py +7 -6
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/writer.py +32 -34
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/PKG-INFO +2 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/conftest.py +1 -1
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/test_reader.py +4 -3
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/test_writer.py +3 -3
- shepherd_core-2025.4.1/shepherd_core/commons.py +0 -8
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/README.md +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/eenv_generator.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/experiment_from_yaml.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/experiment_generic_var1.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/experiment_generic_var2.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/experiment_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/firmware_model.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/firmware_modification.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/inventory.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/uart_decode_waveform.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/uart_raw2.csv +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/examples/vsource_debug_sim.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/setup.cfg +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/timezone.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/_external_fixtures.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/energy_environment_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/firmware_datatype.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/virtual_harvester_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/virtual_source_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/experiment/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/readme.md +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/cape_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/gpio_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/mcu_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/observer_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/target_fixture.old1 +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/target_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/testbed/testbed_fixture.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/virtual_source_doc.txt +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/fw_tools/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/fw_tools/converter_elf.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/testbed_client/cache_path.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/vsource/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/SOURCES.txt +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/dependency_links.txt +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/requires.txt +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/top_level.txt +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core.egg-info/zip-safe +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/conftest.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_cal_data.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_cal_data_faulty.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_cal_meas.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_cal_meas_faulty1.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_cal_meas_faulty2.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_emulator.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_experiment.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_experiment_alternative.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_harvester.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_testbed.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/example_config_virtsource.yaml +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_base_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_content_fixtures.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_content_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_examples.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_experiment_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_task_generation.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_task_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_testbed_fixtures.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/data_models/test_testbed_models.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/decoder_waveform/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/decoder_waveform/test_decoder.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/build_msp.elf +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/build_nrf.elf +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/conftest.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/test_converter.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/test_patcher.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/fw_tools/test_validation.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/inventory/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/inventory/test_inventory.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/test_cal_hw.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/test_examples.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/test_logger.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/testbed_client/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/vsource/__init__.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/vsource/conftest.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/vsource/test_converter.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/vsource/test_harvester.py +0 -0
- {shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/tests/vsource/test_z.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2025.4.
|
|
3
|
+
Version: 2025.4.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>
|
|
@@ -18,7 +18,6 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
18
18
|
Classifier: Intended Audience :: Developers
|
|
19
19
|
Classifier: Intended Audience :: Information Technology
|
|
20
20
|
Classifier: Intended Audience :: Science/Research
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.9
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.10
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -27,7 +26,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
27
26
|
Classifier: License :: OSI Approved :: MIT License
|
|
28
27
|
Classifier: Operating System :: OS Independent
|
|
29
28
|
Classifier: Natural Language :: English
|
|
30
|
-
Requires-Python: >=3.
|
|
29
|
+
Requires-Python: >=3.9
|
|
31
30
|
Description-Content-Type: text/markdown
|
|
32
31
|
Requires-Dist: h5py
|
|
33
32
|
Requires-Dist: numpy
|
|
@@ -61,11 +61,7 @@ with Reader(file_ivcurve, verbose=False) as file:
|
|
|
61
61
|
|
|
62
62
|
# Simulation
|
|
63
63
|
for hrv_name in hrv_list:
|
|
64
|
-
file_output = (
|
|
65
|
-
file_ivcurve.with_name(file_ivcurve.stem + "_" + hrv_name + file_ivcurve.suffix)
|
|
66
|
-
if save_files
|
|
67
|
-
else None
|
|
68
|
-
)
|
|
64
|
+
file_output = file_ivcurve.with_stem(file_ivcurve.stem + "_" + hrv_name) if save_files else None
|
|
69
65
|
E_out_Ws = simulate_harvester(
|
|
70
66
|
config=VirtualHarvesterConfig(name=hrv_name),
|
|
71
67
|
path_input=file_ivcurve,
|
|
@@ -42,11 +42,7 @@ tgt = ResistiveTarget(R_Ohm=1_000, controlled=True)
|
|
|
42
42
|
save_files = True
|
|
43
43
|
|
|
44
44
|
for src_name in src_list:
|
|
45
|
-
file_output = (
|
|
46
|
-
file_input.with_name(file_input.stem + "_emu_" + src_name + file_input.suffix)
|
|
47
|
-
if save_files
|
|
48
|
-
else None
|
|
49
|
-
)
|
|
45
|
+
file_output = file_input.with_stem(file_input.stem + "_emu_" + src_name) if save_files else None
|
|
50
46
|
|
|
51
47
|
e_out_Ws = simulate_source(
|
|
52
48
|
config=VirtualSourceConfig(
|
|
@@ -14,7 +14,6 @@ classifiers = [
|
|
|
14
14
|
"Intended Audience :: Developers",
|
|
15
15
|
"Intended Audience :: Information Technology",
|
|
16
16
|
"Intended Audience :: Science/Research",
|
|
17
|
-
"Programming Language :: Python :: 3.8",
|
|
18
17
|
"Programming Language :: Python :: 3.9",
|
|
19
18
|
"Programming Language :: Python :: 3.10",
|
|
20
19
|
"Programming Language :: Python :: 3.11",
|
|
@@ -25,7 +24,7 @@ classifiers = [
|
|
|
25
24
|
"Natural Language :: English",
|
|
26
25
|
]
|
|
27
26
|
|
|
28
|
-
requires-python = ">=3.
|
|
27
|
+
requires-python = ">=3.9"
|
|
29
28
|
dependencies = [
|
|
30
29
|
"h5py",
|
|
31
30
|
"numpy",
|
|
@@ -111,6 +110,10 @@ source = ["shepherd_core"]
|
|
|
111
110
|
omit = ["*/shepherd_data/*"]
|
|
112
111
|
|
|
113
112
|
[tool.mypy]
|
|
114
|
-
python_version = 3.
|
|
113
|
+
python_version = 3.9
|
|
115
114
|
ignore_missing_imports = true
|
|
116
115
|
disable_error_code = ["call-arg", ]
|
|
116
|
+
exclude = [
|
|
117
|
+
"build/",
|
|
118
|
+
".egg-info/",
|
|
119
|
+
]
|
|
@@ -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-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/cal_measurement.py
RENAMED
|
@@ -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 = (
|
{shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/calibration.py
RENAMED
|
@@ -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
|
|
{shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/base/shepherd.py
RENAMED
|
@@ -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
|
|
@@ -2,13 +2,14 @@
|
|
|
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):
|
|
@@ -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)
|
{shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/content/firmware.py
RENAMED
|
@@ -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")
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"""Generalized energy harvester data models."""
|
|
2
2
|
|
|
3
|
+
from collections.abc import Mapping
|
|
3
4
|
from enum import Enum
|
|
5
|
+
from typing import Annotated
|
|
6
|
+
from typing import Any
|
|
4
7
|
from typing import Optional
|
|
5
|
-
from typing import Tuple
|
|
6
8
|
|
|
7
9
|
from pydantic import Field
|
|
8
10
|
from pydantic import model_validator
|
|
9
|
-
from typing_extensions import Annotated
|
|
10
11
|
from typing_extensions import Self
|
|
11
12
|
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
13
|
+
from shepherd_core.commons import SAMPLERATE_SPS_DEFAULT
|
|
14
|
+
from shepherd_core.data_models.base.calibration import CalibrationHarvester
|
|
15
|
+
from shepherd_core.data_models.base.content import ContentModel
|
|
16
|
+
from shepherd_core.data_models.base.shepherd import ShpModel
|
|
17
|
+
from shepherd_core.logger import logger
|
|
18
|
+
from shepherd_core.testbed_client import tb_client
|
|
19
|
+
|
|
18
20
|
from .energy_environment import EnergyDType
|
|
19
21
|
|
|
20
22
|
|
|
@@ -73,7 +75,7 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
73
75
|
|
|
74
76
|
@model_validator(mode="before")
|
|
75
77
|
@classmethod
|
|
76
|
-
def query_database(cls, values: dict) -> dict:
|
|
78
|
+
def query_database(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
77
79
|
values, chain = tb_client.try_completing_model(cls.__name__, values)
|
|
78
80
|
values = tb_client.fill_in_user_data(values)
|
|
79
81
|
if values["name"] == "neutral":
|
|
@@ -114,14 +116,14 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
114
116
|
return 1 * int(for_emu) + 2 * self.rising + 4 * self.enable_linear_extrapolation
|
|
115
117
|
|
|
116
118
|
def calc_algorithm_num(self, *, for_emu: bool) -> int:
|
|
117
|
-
num =
|
|
119
|
+
num: int = ALGO_TO_NUM.get(self.algorithm, ALGO_TO_NUM["neutral"])
|
|
118
120
|
if for_emu and self.get_datatype() != EnergyDType.ivsample:
|
|
119
121
|
msg = (
|
|
120
122
|
f"[{self.name}] Select valid harvest-algorithm for emulator, "
|
|
121
123
|
f"current usage = {self.algorithm}"
|
|
122
124
|
)
|
|
123
125
|
raise ValueError(msg)
|
|
124
|
-
if not for_emu and num <
|
|
126
|
+
if not for_emu and num < ALGO_TO_NUM["isc_voc"]:
|
|
125
127
|
msg = (
|
|
126
128
|
f"[{self.name}] Select valid harvest-algorithm for harvester, "
|
|
127
129
|
f"current usage = {self.algorithm}"
|
|
@@ -129,12 +131,12 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
129
131
|
raise ValueError(msg)
|
|
130
132
|
return num
|
|
131
133
|
|
|
132
|
-
def calc_timings_ms(self, *, for_emu: bool) ->
|
|
134
|
+
def calc_timings_ms(self, *, for_emu: bool) -> tuple[float, float]:
|
|
133
135
|
"""factor-in model-internal timing-constraints."""
|
|
134
136
|
window_length = self.samples_n * (1 + self.wait_cycles)
|
|
135
|
-
time_min_ms = (1 + self.wait_cycles) * 1_000 /
|
|
137
|
+
time_min_ms = (1 + self.wait_cycles) * 1_000 / SAMPLERATE_SPS_DEFAULT
|
|
136
138
|
if for_emu:
|
|
137
|
-
window_ms = window_length * 1_000 /
|
|
139
|
+
window_ms = window_length * 1_000 / SAMPLERATE_SPS_DEFAULT
|
|
138
140
|
time_min_ms = max(time_min_ms, window_ms)
|
|
139
141
|
|
|
140
142
|
interval_ms = min(max(self.interval_ms, time_min_ms), 1_000_000)
|
|
@@ -149,7 +151,7 @@ class VirtualHarvesterConfig(ContentModel, title="Config for the Harvester"):
|
|
|
149
151
|
return interval_ms, duration_ms
|
|
150
152
|
|
|
151
153
|
def get_datatype(self) -> EnergyDType:
|
|
152
|
-
return
|
|
154
|
+
return ALGO_TO_DTYPE[self.algorithm]
|
|
153
155
|
|
|
154
156
|
def calc_window_size(
|
|
155
157
|
self,
|
|
@@ -184,7 +186,7 @@ u32 = Annotated[int, Field(ge=0, lt=2**32)]
|
|
|
184
186
|
# - harvesting on "neutral" is not possible - direct pass-through
|
|
185
187
|
# - emulation with "ivcurve" or lower is also resulting in Error
|
|
186
188
|
# - "_opt" has its own algo for emulation, but is only a fast mppt_po for harvesting
|
|
187
|
-
|
|
189
|
+
ALGO_TO_NUM: Mapping[str, int] = {
|
|
188
190
|
"neutral": 2**0,
|
|
189
191
|
"isc_voc": 2**3,
|
|
190
192
|
"ivcurve": 2**4,
|
|
@@ -195,7 +197,7 @@ algo_to_num = {
|
|
|
195
197
|
"mppt_opt": 2**14,
|
|
196
198
|
}
|
|
197
199
|
|
|
198
|
-
|
|
200
|
+
ALGO_TO_DTYPE: Mapping[str, EnergyDType] = {
|
|
199
201
|
"neutral": EnergyDType.ivsample,
|
|
200
202
|
"isc_voc": EnergyDType.isc_voc,
|
|
201
203
|
"ivcurve": EnergyDType.ivcurve,
|
|
@@ -266,9 +268,15 @@ class HarvesterPRUConfig(ShpModel):
|
|
|
266
268
|
if window_size is not None
|
|
267
269
|
else data.calc_window_size(dtype_in, for_emu=for_emu)
|
|
268
270
|
)
|
|
269
|
-
|
|
270
|
-
1e3 * voltage_step_V
|
|
271
|
-
|
|
271
|
+
if voltage_step_V is not None:
|
|
272
|
+
voltage_step_mV = 1e3 * voltage_step_V
|
|
273
|
+
elif data.voltage_step_mV is not None:
|
|
274
|
+
voltage_step_mV = data.voltage_step_mV
|
|
275
|
+
else:
|
|
276
|
+
raise ValueError(
|
|
277
|
+
"For correct emulation specify voltage_step used by harvester "
|
|
278
|
+
"e.g. via file_src.get_voltage_step()"
|
|
279
|
+
)
|
|
272
280
|
|
|
273
281
|
return cls(
|
|
274
282
|
algorithm=data.calc_algorithm_num(for_emu=for_emu),
|
|
@@ -280,7 +288,7 @@ class HarvesterPRUConfig(ShpModel):
|
|
|
280
288
|
voltage_step_uV=round(voltage_step_mV * 10**3),
|
|
281
289
|
current_limit_nA=round(data.current_limit_uA * 10**3),
|
|
282
290
|
setpoint_n8=round(min(255, data.setpoint_n * 2**8)),
|
|
283
|
-
interval_n=round(interval_ms *
|
|
284
|
-
duration_n=round(duration_ms *
|
|
291
|
+
interval_n=round(interval_ms * SAMPLERATE_SPS_DEFAULT * 1e-3),
|
|
292
|
+
duration_n=round(duration_ms * SAMPLERATE_SPS_DEFAULT * 1e-3),
|
|
285
293
|
wait_cycles_n=data.wait_cycles,
|
|
286
294
|
)
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"""Generalized virtual source data models."""
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Annotated
|
|
4
|
+
from typing import Any
|
|
4
5
|
|
|
5
6
|
from pydantic import Field
|
|
6
7
|
from pydantic import model_validator
|
|
7
|
-
from typing_extensions import Annotated
|
|
8
8
|
from typing_extensions import Self
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
13
|
-
from
|
|
14
|
-
from
|
|
10
|
+
from shepherd_core.commons import SAMPLERATE_SPS_DEFAULT
|
|
11
|
+
from shepherd_core.data_models.base.content import ContentModel
|
|
12
|
+
from shepherd_core.data_models.base.shepherd import ShpModel
|
|
13
|
+
from shepherd_core.logger import logger
|
|
14
|
+
from shepherd_core.testbed_client import tb_client
|
|
15
|
+
|
|
15
16
|
from .energy_environment import EnergyDType
|
|
16
17
|
from .virtual_harvester import HarvesterPRUConfig
|
|
17
18
|
from .virtual_harvester import VirtualHarvesterConfig
|
|
@@ -19,8 +20,8 @@ from .virtual_harvester import VirtualHarvesterConfig
|
|
|
19
20
|
# Custom Types
|
|
20
21
|
LUT_SIZE: int = 12
|
|
21
22
|
NormedNum = Annotated[float, Field(ge=0.0, le=1.0)]
|
|
22
|
-
LUT1D = Annotated[
|
|
23
|
-
LUT2D = Annotated[
|
|
23
|
+
LUT1D = Annotated[list[NormedNum], Field(min_length=LUT_SIZE, max_length=LUT_SIZE)]
|
|
24
|
+
LUT2D = Annotated[list[LUT1D], Field(min_length=LUT_SIZE, max_length=LUT_SIZE)]
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
@@ -113,7 +114,7 @@ class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
|
113
114
|
|
|
114
115
|
@model_validator(mode="before")
|
|
115
116
|
@classmethod
|
|
116
|
-
def query_database(cls, values: dict) -> dict:
|
|
117
|
+
def query_database(cls, values: dict[str, Any]) -> dict[str, Any]:
|
|
117
118
|
values, chain = tb_client.try_completing_model(cls.__name__, values)
|
|
118
119
|
values = tb_client.fill_in_user_data(values)
|
|
119
120
|
logger.debug("VSrc-Inheritances: %s", chain)
|
|
@@ -238,19 +239,19 @@ class VirtualSourceConfig(ContentModel, title="Config for the virtual Source"):
|
|
|
238
239
|
dV[uV] = constant[us/nF] * current[nA] = constant[us*V/nAs] * current[nA]
|
|
239
240
|
"""
|
|
240
241
|
C_cap_uF = max(self.C_intermediate_uF, 0.001)
|
|
241
|
-
return int((10**3 * (2**28)) // (C_cap_uF *
|
|
242
|
+
return int((10**3 * (2**28)) // (C_cap_uF * SAMPLERATE_SPS_DEFAULT))
|
|
242
243
|
|
|
243
244
|
|
|
244
245
|
u32 = Annotated[int, Field(ge=0, lt=2**32)]
|
|
245
246
|
u8 = Annotated[int, Field(ge=0, lt=2**8)]
|
|
246
247
|
lut_i = Annotated[
|
|
247
|
-
|
|
248
|
+
list[Annotated[list[u8], Field(min_length=LUT_SIZE, max_length=LUT_SIZE)]],
|
|
248
249
|
Field(
|
|
249
250
|
min_length=LUT_SIZE,
|
|
250
251
|
max_length=LUT_SIZE,
|
|
251
252
|
),
|
|
252
253
|
]
|
|
253
|
-
lut_o = Annotated[
|
|
254
|
+
lut_o = Annotated[list[u32], Field(min_length=LUT_SIZE, max_length=LUT_SIZE)]
|
|
254
255
|
|
|
255
256
|
|
|
256
257
|
class ConverterPRUConfig(ShpModel):
|
|
@@ -313,7 +314,7 @@ class ConverterPRUConfig(ShpModel):
|
|
|
313
314
|
dtype_in, log_intermediate_node=log_intermediate_node
|
|
314
315
|
),
|
|
315
316
|
interval_startup_delay_drain_n=round(
|
|
316
|
-
data.interval_startup_delay_drain_ms *
|
|
317
|
+
data.interval_startup_delay_drain_ms * SAMPLERATE_SPS_DEFAULT * 1e-3
|
|
317
318
|
),
|
|
318
319
|
V_input_max_uV=round(data.V_input_max_mV * 1e3),
|
|
319
320
|
I_input_max_nA=round(data.I_input_max_mA * 1e6),
|
|
@@ -326,7 +327,7 @@ class ConverterPRUConfig(ShpModel):
|
|
|
326
327
|
V_disable_output_threshold_uV=round(states["V_disable_output_threshold_mV"] * 1e3),
|
|
327
328
|
dV_enable_output_uV=round(states["dV_enable_output_mV"] * 1e3),
|
|
328
329
|
interval_check_thresholds_n=round(
|
|
329
|
-
data.interval_check_thresholds_ms *
|
|
330
|
+
data.interval_check_thresholds_ms * SAMPLERATE_SPS_DEFAULT * 1e-3
|
|
330
331
|
),
|
|
331
332
|
V_pwr_good_enable_threshold_uV=round(data.V_pwr_good_enable_threshold_mV * 1e3),
|
|
332
333
|
V_pwr_good_disable_threshold_uV=round(data.V_pwr_good_disable_threshold_mV * 1e3),
|
{shepherd_core-2025.4.1 → shepherd_core-2025.4.2}/shepherd_core/data_models/experiment/experiment.py
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Config for testbed experiments."""
|
|
2
2
|
|
|
3
|
+
from collections.abc import Iterable
|
|
3
4
|
from datetime import datetime
|
|
4
5
|
from datetime import timedelta
|
|
5
|
-
from typing import
|
|
6
|
-
from typing import List
|
|
6
|
+
from typing import Annotated
|
|
7
7
|
from typing import Optional
|
|
8
8
|
from typing import Union
|
|
9
9
|
from uuid import uuid4
|
|
@@ -11,16 +11,16 @@ from uuid import uuid4
|
|
|
11
11
|
from pydantic import UUID4
|
|
12
12
|
from pydantic import Field
|
|
13
13
|
from pydantic import model_validator
|
|
14
|
-
from typing_extensions import Annotated
|
|
15
14
|
from typing_extensions import Self
|
|
16
15
|
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
16
|
+
from shepherd_core.data_models.base.content import IdInt
|
|
17
|
+
from shepherd_core.data_models.base.content import NameStr
|
|
18
|
+
from shepherd_core.data_models.base.content import SafeStr
|
|
19
|
+
from shepherd_core.data_models.base.shepherd import ShpModel
|
|
20
|
+
from shepherd_core.data_models.testbed.target import Target
|
|
21
|
+
from shepherd_core.data_models.testbed.testbed import Testbed
|
|
22
|
+
from shepherd_core.version import version
|
|
23
|
+
|
|
24
24
|
from .observer_features import SystemLogging
|
|
25
25
|
from .target_config import TargetConfig
|
|
26
26
|
|
|
@@ -54,7 +54,7 @@ class Experiment(ShpModel, title="Config of an Experiment"):
|
|
|
54
54
|
abort_on_error: bool = False
|
|
55
55
|
|
|
56
56
|
# targets
|
|
57
|
-
target_configs: Annotated[
|
|
57
|
+
target_configs: Annotated[list[TargetConfig], Field(min_length=1, max_length=128)]
|
|
58
58
|
|
|
59
59
|
# for debug-purposes and later comp-checks
|
|
60
60
|
lib_ver: Optional[str] = version
|
|
@@ -70,8 +70,8 @@ class Experiment(ShpModel, title="Config of an Experiment"):
|
|
|
70
70
|
|
|
71
71
|
@staticmethod
|
|
72
72
|
def _validate_targets(configs: Iterable[TargetConfig]) -> None:
|
|
73
|
-
target_ids = []
|
|
74
|
-
custom_ids = []
|
|
73
|
+
target_ids: list[int] = []
|
|
74
|
+
custom_ids: list[int] = []
|
|
75
75
|
for _config in configs:
|
|
76
76
|
for _id in _config.target_IDs:
|
|
77
77
|
target_ids.append(_id)
|