shepherd-core 2025.8.1__py3-none-any.whl → 2025.10.1__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/data_models/__init__.py +4 -2
- shepherd_core/data_models/base/content.py +2 -0
- shepherd_core/data_models/content/__init__.py +4 -2
- shepherd_core/data_models/content/{virtual_harvester.py → virtual_harvester_config.py} +3 -3
- shepherd_core/data_models/content/{virtual_source.py → virtual_source_config.py} +82 -58
- shepherd_core/data_models/content/virtual_source_fixture.yaml +24 -24
- shepherd_core/data_models/content/virtual_storage_config.py +426 -0
- shepherd_core/data_models/content/virtual_storage_fixture_creator.py +267 -0
- shepherd_core/data_models/content/virtual_storage_fixture_ideal.yaml +637 -0
- shepherd_core/data_models/content/virtual_storage_fixture_lead.yaml +49 -0
- shepherd_core/data_models/content/virtual_storage_fixture_lipo.yaml +735 -0
- shepherd_core/data_models/content/virtual_storage_fixture_mlcc.yaml +200 -0
- shepherd_core/data_models/content/virtual_storage_fixture_param_experiments.py +151 -0
- shepherd_core/data_models/content/virtual_storage_fixture_super.yaml +150 -0
- shepherd_core/data_models/content/virtual_storage_fixture_tantal.yaml +550 -0
- shepherd_core/data_models/experiment/target_config.py +1 -1
- shepherd_core/data_models/task/emulation.py +1 -1
- shepherd_core/data_models/task/harvest.py +1 -1
- shepherd_core/decoder_waveform/uart.py +1 -1
- shepherd_core/inventory/system.py +1 -1
- shepherd_core/reader.py +4 -3
- shepherd_core/version.py +1 -1
- shepherd_core/vsource/__init__.py +4 -0
- shepherd_core/vsource/virtual_converter_model.py +27 -26
- shepherd_core/vsource/virtual_harvester_model.py +27 -19
- shepherd_core/vsource/virtual_harvester_simulation.py +38 -39
- shepherd_core/vsource/virtual_source_model.py +17 -13
- shepherd_core/vsource/virtual_source_simulation.py +71 -73
- shepherd_core/vsource/virtual_storage_model.py +164 -0
- shepherd_core/vsource/virtual_storage_model_fixed_point_math.py +58 -0
- shepherd_core/vsource/virtual_storage_models_kibam.py +449 -0
- shepherd_core/vsource/virtual_storage_simulator.py +104 -0
- {shepherd_core-2025.8.1.dist-info → shepherd_core-2025.10.1.dist-info}/METADATA +2 -1
- {shepherd_core-2025.8.1.dist-info → shepherd_core-2025.10.1.dist-info}/RECORD +37 -25
- shepherd_core/data_models/virtual_source_doc.txt +0 -207
- {shepherd_core-2025.8.1.dist-info → shepherd_core-2025.10.1.dist-info}/WHEEL +0 -0
- {shepherd_core-2025.8.1.dist-info → shepherd_core-2025.10.1.dist-info}/top_level.txt +0 -0
- {shepherd_core-2025.8.1.dist-info → shepherd_core-2025.10.1.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""Simulator for the virtual storage models / algorithms."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Callable
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
from pydantic import PositiveFloat
|
|
8
|
+
from pydantic import validate_call
|
|
9
|
+
|
|
10
|
+
from shepherd_core import log
|
|
11
|
+
|
|
12
|
+
from .virtual_storage_model import ModelStorage
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class StorageSimulator:
|
|
16
|
+
"""The simulator benchmarks a set of storage-models.
|
|
17
|
+
|
|
18
|
+
- monitors cell-current and voltage, open circuit voltage, state of charge and time
|
|
19
|
+
- takes config with a list of storage-models and timebase
|
|
20
|
+
- runs with a total step-count as config and a current-providing function
|
|
21
|
+
taking time, cell-voltage and SoC as arguments
|
|
22
|
+
|
|
23
|
+
The recorded data can be visualized by generating plots.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, models: list[ModelStorage], dt_s: PositiveFloat) -> None:
|
|
27
|
+
self.models = models
|
|
28
|
+
self.dt_s = dt_s
|
|
29
|
+
for model in self.models:
|
|
30
|
+
if self.dt_s != model.dt_s:
|
|
31
|
+
raise ValueError("timebase on models do not match")
|
|
32
|
+
self.t_s: np.ndarray | None = None
|
|
33
|
+
|
|
34
|
+
# models return V_cell, SoC_eff, V_OC
|
|
35
|
+
self.I_input: np.ndarray | None = None
|
|
36
|
+
self.V_OC: np.ndarray | None = None
|
|
37
|
+
self.V_cell: np.ndarray | None = None
|
|
38
|
+
self.SoC: np.ndarray | None = None
|
|
39
|
+
self.SoC_eff: np.ndarray | None = None
|
|
40
|
+
|
|
41
|
+
@validate_call
|
|
42
|
+
def run(self, fn: Callable, duration_s: PositiveFloat) -> None:
|
|
43
|
+
self.t_s = np.arange(0, duration_s, self.dt_s)
|
|
44
|
+
self.I_input = np.zeros((len(self.models), self.t_s.shape[0]))
|
|
45
|
+
self.V_OC = np.zeros((len(self.models), self.t_s.shape[0]))
|
|
46
|
+
self.V_cell = np.zeros((len(self.models), self.t_s.shape[0]))
|
|
47
|
+
self.SoC = np.zeros((len(self.models), self.t_s.shape[0]))
|
|
48
|
+
self.SoC_eff = np.zeros((len(self.models), self.t_s.shape[0]))
|
|
49
|
+
for i, model in enumerate(self.models):
|
|
50
|
+
SoC = 1.0
|
|
51
|
+
V_cell = 0.0
|
|
52
|
+
for j, t_s in enumerate(self.t_s):
|
|
53
|
+
I_charge = fn(t_s, SoC, V_cell)
|
|
54
|
+
V_OC, V_cell, SoC, SoC_eff = model.step(I_charge)
|
|
55
|
+
self.I_input[i, j] = I_charge
|
|
56
|
+
self.V_OC[i, j] = V_OC
|
|
57
|
+
self.V_cell[i, j] = V_cell
|
|
58
|
+
self.SoC[i, j] = SoC
|
|
59
|
+
self.SoC_eff[i, j] = SoC_eff
|
|
60
|
+
|
|
61
|
+
@validate_call
|
|
62
|
+
def plot(self, path: Path, title: str, *, plot_delta_v: bool = False) -> None:
|
|
63
|
+
try:
|
|
64
|
+
# keep dependencies low
|
|
65
|
+
from matplotlib import pyplot as plt # noqa: PLC0415
|
|
66
|
+
except ImportError:
|
|
67
|
+
log.warning("Matplotlib not installed, plotting of results disabled")
|
|
68
|
+
return
|
|
69
|
+
|
|
70
|
+
offset = 1 if plot_delta_v else 0
|
|
71
|
+
fig, axs = plt.subplots(4 + offset, 1, sharex="all", figsize=(10, 2 * 6), layout="tight")
|
|
72
|
+
axs[0].set_title(title)
|
|
73
|
+
axs[0].set_ylabel("State of Charge [n]")
|
|
74
|
+
# ⤷ Note: SoC-eff is also available, but unused
|
|
75
|
+
axs[0].grid(visible=True)
|
|
76
|
+
axs[1].set_ylabel("Open-circuit voltage [V]")
|
|
77
|
+
axs[1].grid(visible=True)
|
|
78
|
+
axs[2].set_ylabel("Cell voltage [V]")
|
|
79
|
+
axs[2].grid(visible=True)
|
|
80
|
+
if plot_delta_v:
|
|
81
|
+
axs[3].set_ylabel("Cell voltage delta [V]")
|
|
82
|
+
axs[3].grid(visible=True)
|
|
83
|
+
axs[3 + offset].set_ylabel("Charge current [A]")
|
|
84
|
+
axs[3 + offset].set_xlabel("time [s]")
|
|
85
|
+
axs[3 + offset].grid(visible=True)
|
|
86
|
+
|
|
87
|
+
for i, model in enumerate(self.models):
|
|
88
|
+
axs[0].plot(
|
|
89
|
+
self.t_s, self.SoC[i], label=f"{type(model).__name__} {model.cfg.name}", alpha=0.7
|
|
90
|
+
)
|
|
91
|
+
axs[1].plot(self.t_s, self.V_OC[i], label=type(model).__name__, alpha=0.7)
|
|
92
|
+
axs[2].plot(self.t_s, self.V_cell[i], label=type(model).__name__, alpha=0.7)
|
|
93
|
+
if plot_delta_v: # assumes that timestamps are identical
|
|
94
|
+
axs[3].plot(
|
|
95
|
+
self.t_s,
|
|
96
|
+
[v - ref for v, ref in zip(self.V_cell[i], self.V_cell[0], strict=False)],
|
|
97
|
+
label=type(model).__name__,
|
|
98
|
+
alpha=0.7,
|
|
99
|
+
)
|
|
100
|
+
axs[3 + offset].plot(self.t_s, self.I_input[i], label=type(model).__name__, alpha=0.7)
|
|
101
|
+
axs[0].legend()
|
|
102
|
+
plt.savefig(path / f"{title}.png")
|
|
103
|
+
plt.close(fig)
|
|
104
|
+
plt.clf()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shepherd_core
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.10.1
|
|
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>
|
|
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
26
|
Classifier: License :: OSI Approved :: MIT License
|
|
26
27
|
Classifier: Operating System :: OS Independent
|
|
27
28
|
Classifier: Natural Language :: English
|
|
@@ -3,37 +3,45 @@ shepherd_core/calibration_hw_def.py,sha256=aL94bA1Sf14L5A3PLdVvQVYtGi28S4NUWA65w
|
|
|
3
3
|
shepherd_core/commons.py,sha256=_phovuhCgLmO5gcazQ5hyykUPc907dyK9KpY2lUtoIM,205
|
|
4
4
|
shepherd_core/config.py,sha256=YegFEXuBUBnbq5mb67em8ozEnSkEQSPXjqHlKA2HXCQ,967
|
|
5
5
|
shepherd_core/logger.py,sha256=Plx7JFZXSYWAKbeOTyo7uApe3sDBKEQhG4ovhiET9Sc,1772
|
|
6
|
-
shepherd_core/reader.py,sha256=
|
|
7
|
-
shepherd_core/version.py,sha256=
|
|
6
|
+
shepherd_core/reader.py,sha256=irae0ezLOG6FkJNVsh_u7QG-u8B_qo7MEnzm51IjJ5w,29392
|
|
7
|
+
shepherd_core/version.py,sha256=tUkZ6me00iSazuJnSdnp61gMccxWO_JUMJuiZDvpTfg,76
|
|
8
8
|
shepherd_core/writer.py,sha256=W4jWCQ2br_iJHvgknnuCThC5JQ9p5VxsWhsMnviOGHY,14489
|
|
9
|
-
shepherd_core/data_models/__init__.py,sha256=
|
|
9
|
+
shepherd_core/data_models/__init__.py,sha256=S13slmH4yByO9juym0PXVbi4_D-ymEcECIRB5eVoyso,2016
|
|
10
10
|
shepherd_core/data_models/readme.md,sha256=DHPVmkWqDksWomRHRTVWVHy9wXF9oMJrITgKs4Pnz2g,2494
|
|
11
|
-
shepherd_core/data_models/virtual_source_doc.txt,sha256=OK_7zYbLvr6cEj3KaUcWwZJ9naoFB2KwAaXudbhzouQ,6076
|
|
12
11
|
shepherd_core/data_models/base/__init__.py,sha256=PSJ6acWViqBm0Eiom8DIgKfFVrp5lzYr8OsDvP79vwI,94
|
|
13
12
|
shepherd_core/data_models/base/cal_measurement.py,sha256=ZZYoXfpehZkKRLnRqzuPakYHrpMwIMJVaPkUw0W_Ybo,3340
|
|
14
13
|
shepherd_core/data_models/base/calibration.py,sha256=69ihSXuIjogqICRLhbZJu9-KdkGR8UXyMyBDSAY2ajY,10713
|
|
15
|
-
shepherd_core/data_models/base/content.py,sha256=
|
|
14
|
+
shepherd_core/data_models/base/content.py,sha256=35VQ4CRduULa0j2xridrBXp7T0cBwCJR8yuD6GEfgG8,2188
|
|
16
15
|
shepherd_core/data_models/base/shepherd.py,sha256=bkG4UA4q6AXMnwvnZlDITnP-cYMr21tDthPi7DRVFAY,7345
|
|
17
16
|
shepherd_core/data_models/base/timezone.py,sha256=2T6E46hJ1DAvmqKfu6uIgCK3RSoAKjGXRyzYNaqKyjY,665
|
|
18
17
|
shepherd_core/data_models/base/wrapper.py,sha256=W82OHSfRIFQgBR19B-xVu-vPspkQjgo_aHKOMwcFR0g,747
|
|
19
|
-
shepherd_core/data_models/content/__init__.py,sha256=
|
|
18
|
+
shepherd_core/data_models/content/__init__.py,sha256=m3U5qbtHGWpox0B8tv0UVP-V2jQNWsftHK5vn-_B-04,624
|
|
20
19
|
shepherd_core/data_models/content/_external_fixtures.yaml,sha256=BsHW5UP1UtrEkcI-efCHq4gFtnsuOvoCPv1ri-f6JOI,12132
|
|
21
20
|
shepherd_core/data_models/content/energy_environment.py,sha256=y_DiLKkABFn0kP9XFEy918JQg-mBSXgOEMISOTV7S0g,1593
|
|
22
21
|
shepherd_core/data_models/content/energy_environment_fixture.yaml,sha256=UBXTdGT7MK98zx5w_RBCu-f9uNCKxRgiFBQFbmDUxPc,1301
|
|
23
22
|
shepherd_core/data_models/content/firmware.py,sha256=1N9dFY3hDiis4rmqrNyXHVNN5TLscIb3OwJ8R9aaKd0,6114
|
|
24
23
|
shepherd_core/data_models/content/firmware_datatype.py,sha256=XPU9LOoT3h5qFOlE8WU0vAkw-vymNxzor9kVFyEqsWg,255
|
|
25
|
-
shepherd_core/data_models/content/
|
|
24
|
+
shepherd_core/data_models/content/virtual_harvester_config.py,sha256=6bUGvuzMrlVebtnkqLKdKdAH9YFfFyUuHTymYgp2IGM,20275
|
|
26
25
|
shepherd_core/data_models/content/virtual_harvester_fixture.yaml,sha256=4eNQyFI9LozpButOTlBQ07T0MFCaPEYIxwtedMjUf3U,4575
|
|
27
|
-
shepherd_core/data_models/content/
|
|
28
|
-
shepherd_core/data_models/content/virtual_source_fixture.yaml,sha256=
|
|
26
|
+
shepherd_core/data_models/content/virtual_source_config.py,sha256=RF6yS0De-6kfiQgRuBeE7-hLruy-VoRbkCKATf2ESBA,16671
|
|
27
|
+
shepherd_core/data_models/content/virtual_source_fixture.yaml,sha256=eW5JFlt7RxCF3WgLI5OW2i4sDd2uLITzhCRIiikbce4,11151
|
|
28
|
+
shepherd_core/data_models/content/virtual_storage_config.py,sha256=U6ky_Wh3_Orreope-dovkaQ-YMA3JTdW0HV0uKAhnHM,15778
|
|
29
|
+
shepherd_core/data_models/content/virtual_storage_fixture_creator.py,sha256=pFBNekbLvT61xZDMA00inIfvmuy2ujVkz3M-19fDmBs,9281
|
|
30
|
+
shepherd_core/data_models/content/virtual_storage_fixture_ideal.yaml,sha256=_fal7Egnq1_yIMCh-clZhrs2yNKIBxAUpxm4Y4J6JtM,11838
|
|
31
|
+
shepherd_core/data_models/content/virtual_storage_fixture_lead.yaml,sha256=m3aptqq7S0WCuHbkG_7Ly9isTcioVsayjV56CSBvfrs,926
|
|
32
|
+
shepherd_core/data_models/content/virtual_storage_fixture_lipo.yaml,sha256=zAFUapOxAeW14ndqQHKnFgUOUylB4DCuwngC1ERMsGw,13788
|
|
33
|
+
shepherd_core/data_models/content/virtual_storage_fixture_mlcc.yaml,sha256=DjvQVw3YY3Qwq_MUkSgt-mTHyixra_T73uZBiSJKc9A,3778
|
|
34
|
+
shepherd_core/data_models/content/virtual_storage_fixture_param_experiments.py,sha256=7fFA_4K0QPYimjzRkW89s6daKSsTLud5RX65CmRoQOo,5209
|
|
35
|
+
shepherd_core/data_models/content/virtual_storage_fixture_super.yaml,sha256=I4vuW4Pg94qxh17miNj8a_batVEFAL-nAhZS0hHPOKI,2875
|
|
36
|
+
shepherd_core/data_models/content/virtual_storage_fixture_tantal.yaml,sha256=7E0zby__SvxWXO_saHbR8ir7N0KwuvGCyKlitZMUoeM,10600
|
|
29
37
|
shepherd_core/data_models/experiment/__init__.py,sha256=lorsx0M-JWPIrt_UZfexsLwaITv5slFb3krBOt0idm8,618
|
|
30
38
|
shepherd_core/data_models/experiment/experiment.py,sha256=6fv-UMIFweWHtJT4KxGcIrqk2EY8MKi0SXZQj0EADHo,4268
|
|
31
39
|
shepherd_core/data_models/experiment/observer_features.py,sha256=culZr3_PXHas5SL9prSKCGLEyzd3mfVj6jDnYCKDy6I,8341
|
|
32
|
-
shepherd_core/data_models/experiment/target_config.py,sha256=
|
|
40
|
+
shepherd_core/data_models/experiment/target_config.py,sha256=u1bGf5GFuwkMI5fznjT_iYZ_dT7IaiK0XlsUxYK05s8,4217
|
|
33
41
|
shepherd_core/data_models/task/__init__.py,sha256=lW-U3Ativerhan_8JMlNSgvHvvS6PH02zmTJviLYoNg,3633
|
|
34
|
-
shepherd_core/data_models/task/emulation.py,sha256=
|
|
42
|
+
shepherd_core/data_models/task/emulation.py,sha256=h3wuAcGwLj8bbipp2Fjb82enuP3VgGsdlQDPBHQoU6s,7873
|
|
35
43
|
shepherd_core/data_models/task/firmware_mod.py,sha256=0UjCGi7SZ00B-ggZMowXrRlpV9bYjKjYMHEk23c_3Z0,3472
|
|
36
|
-
shepherd_core/data_models/task/harvest.py,sha256=
|
|
44
|
+
shepherd_core/data_models/task/harvest.py,sha256=dKLSvAoGN7kcC74f2uiOYh9_XH381rc3csocYx7bLeQ,3723
|
|
37
45
|
shepherd_core/data_models/task/helper_paths.py,sha256=AOfbZekT1OxH8pUV_B0S_SR7O4tcRbJalhnUBGPfvd4,440
|
|
38
46
|
shepherd_core/data_models/task/observer_tasks.py,sha256=udkAEfOjYnpDONHeZ5iPnM4qnARQMH_M_t8LG2UHSEI,3991
|
|
39
47
|
shepherd_core/data_models/task/programming.py,sha256=zJ84oW-bchu4CNPK8z3dDQvBNc5FAtUI8bbXd3s2zOY,2932
|
|
@@ -53,7 +61,7 @@ shepherd_core/data_models/testbed/target_fixture.yaml,sha256=aoP7Al_sXw8nBQpIP25
|
|
|
53
61
|
shepherd_core/data_models/testbed/testbed.py,sha256=e2szb1vFG0aiYMaYOT5Y1y1Y8mqvgnoP3oq9DcQgSGk,3727
|
|
54
62
|
shepherd_core/data_models/testbed/testbed_fixture.yaml,sha256=ca5LI-fWoc3I9m2QScVAh84Bv-ftkSGAizR3ZR0lkC8,980
|
|
55
63
|
shepherd_core/decoder_waveform/__init__.py,sha256=-ohGz0fA2tKxUJk4FAQXKtI93d6YGdy0CrkdhOod1QU,120
|
|
56
|
-
shepherd_core/decoder_waveform/uart.py,sha256=
|
|
64
|
+
shepherd_core/decoder_waveform/uart.py,sha256=zQX64dBXmhEYXN__OfS2h_1fDgZLomhbptQX34-Fobc,10989
|
|
57
65
|
shepherd_core/fw_tools/__init__.py,sha256=D9GGj9TzLWZfPjG_iV2BsF-Q1TGTYTgEzWTUI5ReVAA,2090
|
|
58
66
|
shepherd_core/fw_tools/converter.py,sha256=wRJvcaFyMpApUTNBTh3a-vqqfRXDJWYppEaH0oyrACY,3626
|
|
59
67
|
shepherd_core/fw_tools/converter_elf.py,sha256=DC-zDi1v7pCFTA1d4VqErDvIMAYwAbv_efqh17wLeRA,1058
|
|
@@ -61,7 +69,7 @@ shepherd_core/fw_tools/patcher.py,sha256=V5Dg-uhTxT7Ro4UdFS7pVl2GwkKHLWd8YIvZKxM
|
|
|
61
69
|
shepherd_core/fw_tools/validation.py,sha256=unm6jsj2538EfIAuRcrpnA2dee1-THD5_dKWFVmCmMI,5095
|
|
62
70
|
shepherd_core/inventory/__init__.py,sha256=yQxP55yV61xXWfZSSzekQQYopPZCspFpHSyG7VTqtpg,3819
|
|
63
71
|
shepherd_core/inventory/python.py,sha256=uchavGsssM4CTYQ23kF6hxhl3NUeEpGVvJYX8t7dWU4,1210
|
|
64
|
-
shepherd_core/inventory/system.py,sha256=
|
|
72
|
+
shepherd_core/inventory/system.py,sha256=1BkS71SCOGscD6aW9EDW47-CZM9gyBLED28cy1u83Es,3162
|
|
65
73
|
shepherd_core/inventory/target.py,sha256=4ju4HwXxEJ2naNEfL-gS8Z6s0eacllMmBu4iKKz-14Y,489
|
|
66
74
|
shepherd_core/testbed_client/__init__.py,sha256=QtbsBUzHwOoM6rk0qa21ywuz63YV7af1fwUtWW8Vg_4,234
|
|
67
75
|
shepherd_core/testbed_client/cache_path.py,sha256=BXklO72gFDhJ9i2gGlgw5MbuxexGA42two7DCdpd9dM,437
|
|
@@ -69,15 +77,19 @@ shepherd_core/testbed_client/client_abc_fix.py,sha256=DX51I8Wh4ROU4SBwdeM-2VznIN
|
|
|
69
77
|
shepherd_core/testbed_client/client_web.py,sha256=7dEPjYOWXAbeU_zaJ7Pk9cj7LafKjFBfCw8UBD5v7HA,5939
|
|
70
78
|
shepherd_core/testbed_client/fixtures.py,sha256=PzQLsMxs8Ddz01dMtpt59nOPGMWTKQ10dBDu49BjMyA,9317
|
|
71
79
|
shepherd_core/testbed_client/user_model.py,sha256=9vqW9Vzs-QwD3SqgXDyNGLR8siQ9-2ueRcaI3yxs6yA,2037
|
|
72
|
-
shepherd_core/vsource/__init__.py,sha256=
|
|
80
|
+
shepherd_core/vsource/__init__.py,sha256=D8FB8ugsFp3XBM5io33j6SJTYy3TfK_-3FW7boLDCaw,933
|
|
73
81
|
shepherd_core/vsource/target_model.py,sha256=BjOlwX_gIOJ91e4OOLB4_OsCpuhq9vm57ERjM-iBhAM,5129
|
|
74
|
-
shepherd_core/vsource/virtual_converter_model.py,sha256=
|
|
75
|
-
shepherd_core/vsource/virtual_harvester_model.py,sha256=
|
|
76
|
-
shepherd_core/vsource/virtual_harvester_simulation.py,sha256=
|
|
77
|
-
shepherd_core/vsource/virtual_source_model.py,sha256=
|
|
78
|
-
shepherd_core/vsource/virtual_source_simulation.py,sha256=
|
|
79
|
-
shepherd_core
|
|
80
|
-
shepherd_core
|
|
81
|
-
shepherd_core
|
|
82
|
-
shepherd_core
|
|
83
|
-
shepherd_core-2025.
|
|
82
|
+
shepherd_core/vsource/virtual_converter_model.py,sha256=k-Et_u4XZ7YIEMyCWqoC2J-vnz1Y1DYmf8IT2IBEirs,11618
|
|
83
|
+
shepherd_core/vsource/virtual_harvester_model.py,sha256=n0kBtEGuXpCOmLC8w7lnLEeveCyplSOMi5rg2P2X7go,10091
|
|
84
|
+
shepherd_core/vsource/virtual_harvester_simulation.py,sha256=0o9TgA-7UQ_Q9QGxRYdLXPUfEU93yzKTAQ9AtyA-h1Q,2659
|
|
85
|
+
shepherd_core/vsource/virtual_source_model.py,sha256=N0oDy6lalUDzQ6yNe-BCvCND7nvhpgIOfFaisxIG5wk,3411
|
|
86
|
+
shepherd_core/vsource/virtual_source_simulation.py,sha256=aiDGJZYdD5n61H1eVIdgSbixAZpsjJ7nQZ2Vy9QiKRA,5512
|
|
87
|
+
shepherd_core/vsource/virtual_storage_model.py,sha256=UNV5HkU4ahiHE213ygpovs4FqgtIc3v6TWW1aaijKCc,5634
|
|
88
|
+
shepherd_core/vsource/virtual_storage_model_fixed_point_math.py,sha256=v4SbEb7bY4ZBg0p9xgHd76Pq2B3M98xSZ16AWRyUNTQ,2050
|
|
89
|
+
shepherd_core/vsource/virtual_storage_models_kibam.py,sha256=Gubk6VSBcXYfoa_yNLxTy2Qj_Iu4FDJz5czEtnTGVSE,18292
|
|
90
|
+
shepherd_core/vsource/virtual_storage_simulator.py,sha256=qPWHwIdey9aDOA8oSJjNX5WKBMV8avzWkcEpp1m3uyY,4268
|
|
91
|
+
shepherd_core-2025.10.1.dist-info/METADATA,sha256=muJaAktfPNxE3R4RzBqTcG_5SRpg8m57pE0q5hjEVfc,7680
|
|
92
|
+
shepherd_core-2025.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
93
|
+
shepherd_core-2025.10.1.dist-info/top_level.txt,sha256=wy-t7HRBrKARZxa-Y8_j8d49oVHnulh-95K9ikxVhew,14
|
|
94
|
+
shepherd_core-2025.10.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
95
|
+
shepherd_core-2025.10.1.dist-info/RECORD,,
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from ..data_models import ShpModel
|
|
4
|
-
from .content import VirtualHarvesterConfig
|
|
5
|
-
from .content.virtual_source import LUT1D
|
|
6
|
-
from .content.virtual_source import LUT2D
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@DeprecationWarning
|
|
10
|
-
class VirtualSourceDoc(ShpModel, title="Virtual Source (Documented, Testversion)"):
|
|
11
|
-
# General Config
|
|
12
|
-
name: str = Field(
|
|
13
|
-
title="Name of Virtual Source",
|
|
14
|
-
description="Slug to use this Name as later reference",
|
|
15
|
-
default="neutral",
|
|
16
|
-
)
|
|
17
|
-
inherit_from: str = Field(
|
|
18
|
-
description="Name of converter to derive defaults from",
|
|
19
|
-
default="neutral",
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
enable_boost: bool = Field(
|
|
23
|
-
description="If false -> V_intermediate becomes V_input, "
|
|
24
|
-
"output-switch-hysteresis is still usable",
|
|
25
|
-
default=False,
|
|
26
|
-
)
|
|
27
|
-
enable_buck: bool = Field(
|
|
28
|
-
description="If false -> V_output becomes V_intermediate",
|
|
29
|
-
default=False,
|
|
30
|
-
)
|
|
31
|
-
log_intermediate_voltage: bool = Field(
|
|
32
|
-
description="Record / log virtual intermediate (cap-)voltage and "
|
|
33
|
-
"-current (out) instead of output-voltage and -current",
|
|
34
|
-
default=False,
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
interval_startup_delay_drain_ms: float = Field(
|
|
38
|
-
description="Model begins running but Target is not draining the storage capacitor",
|
|
39
|
-
default=0,
|
|
40
|
-
ge=0,
|
|
41
|
-
le=10e3,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
harvester: VirtualHarvesterConfig = Field(
|
|
45
|
-
description="Only active / needed if input is ivsurface / curves,
|
|
46
|
-
default=VirtualHarvesterConfig(name="mppt_opt"),
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
V_input_max_mV: float = Field(
|
|
50
|
-
description="Maximum input Voltage [mV]",
|
|
51
|
-
default=10_000,
|
|
52
|
-
ge=0,
|
|
53
|
-
le=10e3,
|
|
54
|
-
)
|
|
55
|
-
I_input_max_mA: float = Field(
|
|
56
|
-
description="Maximum input Current [mA]",
|
|
57
|
-
default=4_200,
|
|
58
|
-
ge=0,
|
|
59
|
-
le=4.29e3,
|
|
60
|
-
)
|
|
61
|
-
V_input_drop_mV: float = Field(
|
|
62
|
-
title="Drop of Input-Voltage [mV]",
|
|
63
|
-
description="Simulate an input-diode",
|
|
64
|
-
default=0,
|
|
65
|
-
ge=0,
|
|
66
|
-
le=4.29e6,
|
|
67
|
-
)
|
|
68
|
-
R_input_mOhm: float = Field(
|
|
69
|
-
description="Resistance only active with disabled boost, range [1 mOhm; 1MOhm]",
|
|
70
|
-
default=0,
|
|
71
|
-
ge=0,
|
|
72
|
-
le=4.29e6,
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
C_intermediate_uF: float = Field(
|
|
76
|
-
description="Capacity of primary Storage-Capacitor",
|
|
77
|
-
default=0,
|
|
78
|
-
ge=0,
|
|
79
|
-
le=100_000,
|
|
80
|
-
)
|
|
81
|
-
V_intermediate_init_mV: float = Field(
|
|
82
|
-
description="Allow a proper / fast startup",
|
|
83
|
-
default=3_000,
|
|
84
|
-
ge=0,
|
|
85
|
-
le=10_000,
|
|
86
|
-
)
|
|
87
|
-
I_intermediate_leak_nA: float = Field(
|
|
88
|
-
description="Current leakage of intermediate storage capacitor",
|
|
89
|
-
default=0,
|
|
90
|
-
ge=0,
|
|
91
|
-
le=4.29e9,
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
V_intermediate_enable_threshold_mV: float = Field(
|
|
95
|
-
description="Target gets connected (hysteresis-combo with next value)",
|
|
96
|
-
default=1,
|
|
97
|
-
ge=0,
|
|
98
|
-
le=10_000,
|
|
99
|
-
)
|
|
100
|
-
V_intermediate_disable_threshold_mV: float = Field(
|
|
101
|
-
description="Target gets disconnected",
|
|
102
|
-
default=0,
|
|
103
|
-
ge=0,
|
|
104
|
-
le=10_000,
|
|
105
|
-
)
|
|
106
|
-
interval_check_thresholds_ms: float = Field(
|
|
107
|
-
description="Some BQs check every 64 ms if output should be disconnected",
|
|
108
|
-
default=0,
|
|
109
|
-
ge=0,
|
|
110
|
-
le=4.29e3,
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
V_pwr_good_enable_threshold_mV: float = Field(
|
|
114
|
-
description="Target is informed by pwr-good on output-pin (hysteresis) "
|
|
115
|
-
"-> for intermediate voltage",
|
|
116
|
-
default=2800,
|
|
117
|
-
ge=0,
|
|
118
|
-
le=10_000,
|
|
119
|
-
)
|
|
120
|
-
V_pwr_good_disable_threshold_mV: float = Field(
|
|
121
|
-
description="Target is informed by pwr-good on output-pin (hysteresis) "
|
|
122
|
-
"-> for intermediate voltage",
|
|
123
|
-
default=2200,
|
|
124
|
-
ge=0,
|
|
125
|
-
le=10_000,
|
|
126
|
-
)
|
|
127
|
-
immediate_pwr_good_signal: bool = Field(
|
|
128
|
-
description="1: activate instant schmitt-trigger, "
|
|
129
|
-
"0: stay in interval for checking thresholds",
|
|
130
|
-
default=True,
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
C_output_uF: float = Field(
|
|
134
|
-
description="Final (always last) stage to compensate undetectable "
|
|
135
|
-
"current spikes when enabling power for target",
|
|
136
|
-
default=1.0,
|
|
137
|
-
ge=0,
|
|
138
|
-
le=4.29e6,
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
# Extra
|
|
142
|
-
V_output_log_gpio_threshold_mV: float = Field(
|
|
143
|
-
description="Min voltage needed to enable recording changes in gpio-bank",
|
|
144
|
-
default=1400,
|
|
145
|
-
ge=0,
|
|
146
|
-
le=4.29e6,
|
|
147
|
-
)
|
|
148
|
-
|
|
149
|
-
# Boost Converter
|
|
150
|
-
V_input_boost_threshold_mV: float = Field(
|
|
151
|
-
description="min input-voltage for the boost converter to work",
|
|
152
|
-
default=0,
|
|
153
|
-
ge=0,
|
|
154
|
-
le=10_000,
|
|
155
|
-
)
|
|
156
|
-
V_intermediate_max_mV: float = Field(
|
|
157
|
-
description="Threshold for shutting off Boost converter",
|
|
158
|
-
default=10_000,
|
|
159
|
-
ge=0,
|
|
160
|
-
le=10_000,
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
LUT_input_efficiency: LUT2D = Field(
|
|
164
|
-
description="# input-array[12][12] depending on "
|
|
165
|
-
"array[inp_voltage][log(inp_current)], "
|
|
166
|
-
"influence of cap-voltage is not implemented",
|
|
167
|
-
default=12 * [12 * [1.00]],
|
|
168
|
-
)
|
|
169
|
-
LUT_input_V_min_log2_uV: int = Field(
|
|
170
|
-
description="Example: n=7, 2^n = 128 uV -> array[0] is for inputs < 128 uV",
|
|
171
|
-
default=0,
|
|
172
|
-
ge=0,
|
|
173
|
-
le=20,
|
|
174
|
-
)
|
|
175
|
-
LUT_input_I_min_log2_nA: int = Field(
|
|
176
|
-
description="Example: n=8, 2^n = 256 nA -> array[0] is for inputs < 256 nA",
|
|
177
|
-
default=0,
|
|
178
|
-
ge=0,
|
|
179
|
-
le=20,
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
# Buck Converter
|
|
183
|
-
V_output_mV: float = Field(
|
|
184
|
-
description="Fixed Voltage of Buck-Converter (as long as "
|
|
185
|
-
"Input is > Output + Drop-Voltage)",
|
|
186
|
-
default=2400,
|
|
187
|
-
ge=0,
|
|
188
|
-
le=5_000,
|
|
189
|
-
)
|
|
190
|
-
V_buck_drop_mV: float = Field(
|
|
191
|
-
description="Simulate LDO min voltage differential or output-diode",
|
|
192
|
-
default=0,
|
|
193
|
-
ge=0,
|
|
194
|
-
le=5_000,
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
LUT_output_efficiency: LUT1D = Field(
|
|
198
|
-
description="Output-Array[12] depending on output_current. In & Output is linear",
|
|
199
|
-
default=12 * [1.00],
|
|
200
|
-
)
|
|
201
|
-
LUT_output_I_min_log2_nA: int = Field(
|
|
202
|
-
description="Example: n=8, 2^n = 256 nA -> array[0] is for inputs < 256 nA, "
|
|
203
|
-
"see notes on LUT_input for explanation",
|
|
204
|
-
default=0,
|
|
205
|
-
ge=0,
|
|
206
|
-
le=20,
|
|
207
|
-
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|