shepherd-core 2024.11.3__py3-none-any.whl → 2025.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,8 +127,9 @@ class Firmware(ContentModel, title="Firmware of Target"):
127
127
  arch = fw_tools.read_arch(file)
128
128
  if "msp430" in arch and not fw_tools.is_elf_msp430(file):
129
129
  raise ValueError("File is not a ELF for msp430")
130
- if "nrf52" in arch and not fw_tools.is_elf_nrf52(file):
130
+ if ("nrf52" in arch or "arm" in arch) and not fw_tools.is_elf_nrf52(file):
131
131
  raise ValueError("File is not a ELF for nRF52")
132
+ logger.debug("ELF-File '%s' has arch: %s", file.name, arch)
132
133
  if "mcu" not in kwargs:
133
134
  kwargs["mcu"] = arch_to_mcu[arch]
134
135
 
@@ -59,8 +59,7 @@ def prepare_task(config: Union[ShpModel, Path, str], observer: Optional[str] = N
59
59
  if shp_wrap.datatype == TestbedTasks.__name__:
60
60
  if observer is None:
61
61
  logger.debug(
62
- "Task-Set contained TestbedTasks & no observer was provided "
63
- "-> will return TB-Tasks"
62
+ "Task-Set contained TestbedTasks & no observer was provided -> will return TB-Tasks"
64
63
  )
65
64
  return shp_wrap
66
65
  tbt = TestbedTasks(**shp_wrap.parameters)
@@ -31,7 +31,7 @@ class ProgrammingTask(ShpModel):
31
31
  mcu_type: SafeStr
32
32
  # ⤷ must be either "nrf52" or "msp430" ATM, TODO: clean xp to tasks
33
33
  voltage: Annotated[float, Field(ge=1, lt=5)] = 3
34
- datarate: Annotated[int, Field(gt=0, le=1_000_000)] = 500_000
34
+ datarate: Annotated[int, Field(gt=0, le=1_000_000)] = 200_000
35
35
  protocol: ProgrammerProtocol
36
36
 
37
37
  simulate: bool = False
@@ -66,16 +66,14 @@ def is_hex_nrf52(file: Path) -> bool:
66
66
  """Try to detect specifics for that MCU.
67
67
 
68
68
  Observations:
69
- - addresses begin at 0x0
69
+ - addresses begin mostly at 0x0 (no must)
70
70
  - only one segment (.get_segments), todo
71
71
  """
72
72
  if is_hex(file):
73
73
  ih = IntelHex(file.as_posix())
74
- if ih.minaddr() != 0x0000:
75
- return False
76
-
77
- # conservative test for now - should be well below 1 MB + 256 kB
78
- return ih.get_memory_size() < 1310720
74
+ # conservative test for now - should be between 0 and 1 MB + 256 kB,
75
+ # but lately showed much higher values > 4 MB
76
+ return ih.get_memory_size() > 0
79
77
  return False
80
78
 
81
79
 
@@ -145,15 +143,15 @@ def determine_arch(file: Path) -> str:
145
143
  """Figure out arch (msp430 or nrf52)."""
146
144
  file_t = determine_type(file)
147
145
  if file_t == FirmwareDType.path_elf:
148
- if is_elf_nrf52(file):
149
- return "nrf52"
150
146
  if is_elf_msp430(file):
151
147
  return "msp430"
148
+ if is_elf_nrf52(file):
149
+ return "nrf52"
152
150
  raise ValueError("Arch of ELF '%s' could not be determined", file.name)
153
151
  if file_t == FirmwareDType.path_hex:
154
- if is_hex_nrf52(file):
155
- return "nrf52"
156
152
  if is_hex_msp430(file):
157
153
  return "msp430"
154
+ if is_hex_nrf52(file):
155
+ return "nrf52"
158
156
  raise ValueError("Arch of HEX '%s' could not be determined", file.name)
159
157
  raise ValueError("Arch of file '%s' could not be determined", file.name)
@@ -93,7 +93,7 @@ class SystemInventory(ShpModel):
93
93
  reply = subprocess.run( # noqa: S603
94
94
  ptp_cmd, timeout=30, capture_output=True, check=False
95
95
  )
96
- ptp_out = f"{ reply.stdout }, { reply.stderr }"
96
+ ptp_out = f"{reply.stdout}, {reply.stderr}"
97
97
  # alternative: check_output - seems to be lighter
98
98
 
99
99
  model_dict = {
shepherd_core/reader.py CHANGED
@@ -172,7 +172,10 @@ class Reader:
172
172
  """Update internal states, helpful after resampling or other changes in data-group."""
173
173
  self.h5file.flush()
174
174
  sample_count = self.ds_time.shape[0]
175
- duration_raw = self.ds_time[sample_count - 1] - self.ds_time[0] if sample_count > 0 else 0
175
+ duration_raw = (
176
+ (int(self.ds_time[sample_count - 1]) - int(self.ds_time[0])) if sample_count > 0 else 0
177
+ )
178
+ # above's typecasting prevents overflow in u64-format
176
179
  if (sample_count > 0) and (duration_raw > 0):
177
180
  # this assumes iso-chronous sampling
178
181
  duration_s = self._cal.time.raw_to_si(duration_raw)
@@ -285,6 +288,9 @@ class Reader:
285
288
  dsv = self.ds_voltage[0:2000]
286
289
  diffs_np = np.unique(dsv[1:] - dsv[0:-1], return_counts=False)
287
290
  diffs_ls = [_e for _e in list(np.array(diffs_np)) if _e > 0]
291
+ # static voltages have 0 steps, so
292
+ if len(diffs_ls) == 0:
293
+ return None # or is 0 better? that may provoke div0
288
294
  voltage_step = min(diffs_ls)
289
295
  if voltage_step is not None:
290
296
  voltage_step = 1e-3 * voltage_step
@@ -36,7 +36,7 @@ class WebClient(AbcClient):
36
36
  super().__init__()
37
37
  if not hasattr(self, "_token"):
38
38
  # add default values
39
- self._token: str = "basic_public_access"
39
+ self._token: str = "basic_public_access" # noqa: S105
40
40
  self._server: str = testbed_server_default
41
41
  self._user: Optional[User] = None
42
42
  self._key: Optional[str] = None
shepherd_core/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Separated string avoids circular imports."""
2
2
 
3
- version: str = "2024.11.3"
3
+ version: str = "2025.02.2"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: shepherd_core
3
- Version: 2024.11.3
3
+ Version: 2025.2.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>
@@ -2,8 +2,8 @@ shepherd_core/__init__.py,sha256=fCld2mcl0y0h6kRyPal3DP-sWXnKl_0aYWYBdg4QuUk,127
2
2
  shepherd_core/calibration_hw_def.py,sha256=_nMzgNzSnYyqcLnVCGd4tfA2e0avUXbccjmNpFhiDgo,2830
3
3
  shepherd_core/commons.py,sha256=vymKXWcy_1bz7ChzzEATUkJ4p3czCzjIdsSehVjJOY8,218
4
4
  shepherd_core/logger.py,sha256=4Q4hTI-nccOZ1_A68fo4UEctfu3pJx3IeHfa9VuDDEo,1804
5
- shepherd_core/reader.py,sha256=OBjvvo-R_68RPAlgTWfYkNeIW-wEeHVcSzScxLhYhvg,28021
6
- shepherd_core/version.py,sha256=efgburSXJlcrRhiL0_hKDFmBgNSmAdHw7BRzTIN918M,76
5
+ shepherd_core/reader.py,sha256=BxVWE-4BfDUjVh03l0SZHT5PwVN0xPEy4aP8Kr858kI,28270
6
+ shepherd_core/version.py,sha256=nTwMv1ayLMflxtnNktXAuPy5XKPBgwQv7w-EtHuCMtI,76
7
7
  shepherd_core/writer.py,sha256=GMR-7vkOgpTNPoknBWsRsC7-b7iGMtT60-KtSKunNe8,14636
8
8
  shepherd_core/data_models/__init__.py,sha256=bnHSP_HBOYm4WuoiHs_vyiRsWlvkyDjsarMNfKedN-Q,1836
9
9
  shepherd_core/data_models/readme.md,sha256=1bdfEypY_0NMhXLxOPRnLAsFca0HuHdq7_01yEWxvUs,2470
@@ -19,7 +19,7 @@ shepherd_core/data_models/content/__init__.py,sha256=69aiNG0h5t1OF7HsLg_ke5eaQKs
19
19
  shepherd_core/data_models/content/_external_fixtures.yaml,sha256=0CH7YSWT_hzL-jcg4JjgN9ryQOzbS8S66_pd6GbMnHw,12259
20
20
  shepherd_core/data_models/content/energy_environment.py,sha256=WuXMkKqnibGzM2WeW1_m2DAsc0fDqE9CkBYYPSw-7eA,1540
21
21
  shepherd_core/data_models/content/energy_environment_fixture.yaml,sha256=UBXTdGT7MK98zx5w_RBCu-f9uNCKxRgiFBQFbmDUxPc,1301
22
- shepherd_core/data_models/content/firmware.py,sha256=MyEiaP6bkOm7i_oihDXTxHC7ajc5aqiIDLn7mhap6YY,5722
22
+ shepherd_core/data_models/content/firmware.py,sha256=rH74sJPAjUUheVv0y2Y93BeT63CeKqdSEo8HZgHGlMo,5813
23
23
  shepherd_core/data_models/content/firmware_datatype.py,sha256=XPU9LOoT3h5qFOlE8WU0vAkw-vymNxzor9kVFyEqsWg,255
24
24
  shepherd_core/data_models/content/virtual_harvester.py,sha256=cf-DrSacZsct9e8eGoR4PX7S7RXlbxQfJHVsLR9njlM,10749
25
25
  shepherd_core/data_models/content/virtual_harvester_fixture.yaml,sha256=LZe5ue1xYhXZwB3a32sva-L4uKhkQA5AtG9JzW4B2hQ,4564
@@ -29,12 +29,12 @@ shepherd_core/data_models/experiment/__init__.py,sha256=lorsx0M-JWPIrt_UZfexsLwa
29
29
  shepherd_core/data_models/experiment/experiment.py,sha256=wnn6T3czuh4rz6OSYtMltCTbRpPX55TLVAtQcKO7Uhg,4044
30
30
  shepherd_core/data_models/experiment/observer_features.py,sha256=qxnb7anuQz9ZW5IUlPdUXYPIl5U7O9uXkJqZtMnAb0Y,5156
31
31
  shepherd_core/data_models/experiment/target_config.py,sha256=XIsjbbo7yn_A4q3GMxWbiNzEGA0Kk5gH7-XfQQ7Kg0E,3674
32
- shepherd_core/data_models/task/__init__.py,sha256=qZPoLdqnU2ffqP08wUdXzf0MC5hEdv5X2_XOIui0MM8,3314
32
+ shepherd_core/data_models/task/__init__.py,sha256=vOsSeB5IBYYwzOLKom8-XuZyjF86m_svtCsw-agiV7o,3295
33
33
  shepherd_core/data_models/task/emulation.py,sha256=tLb5auHOgdoG-e4hFljAYT49z7lMEaiimOy4UVZONi4,6440
34
34
  shepherd_core/data_models/task/firmware_mod.py,sha256=Rw_TA1ykQ7abUd_U0snqZlpZyrS8Nx6f4BEax1Xnji0,2818
35
35
  shepherd_core/data_models/task/harvest.py,sha256=HHnqWwRsJupaZJxuohs7NrK6VaDyoRzGOaG2h9y3s1Y,3360
36
36
  shepherd_core/data_models/task/observer_tasks.py,sha256=XlH_-EGRrdodTn0c2pjGvpcauc0a9NOnLhysKw8iRwk,3511
37
- shepherd_core/data_models/task/programming.py,sha256=Mg9_AZHIdG01FheEJAifIRPSB3iZ0UJITf8zeg2jyws,2323
37
+ shepherd_core/data_models/task/programming.py,sha256=hjzsxqqB0WXb0qY5gKk4iZ-Is3-OZNFnGehAxzA_0TI,2323
38
38
  shepherd_core/data_models/task/testbed_tasks.py,sha256=zvIitq0Ek1Ae7baWiBkSQN8nRugyw0N2P4SeVoj_QaY,2090
39
39
  shepherd_core/data_models/testbed/__init__.py,sha256=t9nwml5pbu7ZWghimOyZ8ujMIgnRgFkl23pNb5d_KdU,581
40
40
  shepherd_core/data_models/testbed/cape.py,sha256=D23ZKXpZRPIIOMn6LCoJrwHiRbSaYg-y7B6fAt1ap64,1246
@@ -56,15 +56,15 @@ shepherd_core/fw_tools/__init__.py,sha256=D9GGj9TzLWZfPjG_iV2BsF-Q1TGTYTgEzWTUI5
56
56
  shepherd_core/fw_tools/converter.py,sha256=3igRT33tghrBCao5njuPmePS-Y_lSa6EUHvwCakMo2s,3539
57
57
  shepherd_core/fw_tools/converter_elf.py,sha256=GQDVqIqMW4twNMvZIV3sowFMezhs2TN-IYREjRP7Xt4,1089
58
58
  shepherd_core/fw_tools/patcher.py,sha256=D6MHaCvKRRVQYSZozODAp_l7UnqxVsvnulPzpkfXWW8,4108
59
- shepherd_core/fw_tools/validation.py,sha256=hBLCKIUumPTA6iuXMVbMYph2jamaxeSTxRqsvl3C4-I,4699
59
+ shepherd_core/fw_tools/validation.py,sha256=dOweyWwVMq0b4Liha39mGUOiblD7Nz5kSFVrlxUx41o,4707
60
60
  shepherd_core/inventory/__init__.py,sha256=nRO11HG4eJ_FaXebSkE0dd1H6qvjrX5n3OQHOzKXVvk,3841
61
61
  shepherd_core/inventory/python.py,sha256=OWNnyEt0IDPW9XGW-WloU0FExwgZzYNA05VpRj4cZGc,1250
62
- shepherd_core/inventory/system.py,sha256=jRzko9QNPLaBiG7urVaeqqvb3GtCEYRwc0DAghRkLVo,3159
62
+ shepherd_core/inventory/system.py,sha256=Q_mtM2zhUsTvzELgpEVxSxL9aFS1RSGcCX6RFpyZ-r8,3155
63
63
  shepherd_core/inventory/target.py,sha256=Lq11j25tWieXheOxIDaQb-lc-2omxYVex5P6uGiLUyk,507
64
64
  shepherd_core/testbed_client/__init__.py,sha256=QtbsBUzHwOoM6rk0qa21ywuz63YV7af1fwUtWW8Vg_4,234
65
65
  shepherd_core/testbed_client/cache_path.py,sha256=tS0er9on5fw8wddMCt1jkc2uyYOdSTvX_UmfmYJf6tY,445
66
66
  shepherd_core/testbed_client/client_abc_fix.py,sha256=BsSkpvJHURRejlS-YPF1f6QRPC_X0fYEsJpinzsx6Jc,4079
67
- shepherd_core/testbed_client/client_web.py,sha256=iMh5T91152uugbFsqr2vvxLser0KIo5g426dp_6QWUE,5774
67
+ shepherd_core/testbed_client/client_web.py,sha256=rOg0Gf-s3S8U0z2ssh9_bNnq4aRQINfuuVHionPf38M,5788
68
68
  shepherd_core/testbed_client/fixtures.py,sha256=4Uk583R4r6I5IB78HxOn-9UNH3sbFha7OPEdcSXvMCU,9939
69
69
  shepherd_core/testbed_client/user_model.py,sha256=5M3vWkAGBwdGDUYAanAjrZwpzMBlh3XLOVvNYWiLmms,2107
70
70
  shepherd_core/vsource/__init__.py,sha256=vTvFWuJn4eurPNzEiMd15c1Rd6o3DTWzCfbhOomflZU,771
@@ -74,8 +74,8 @@ shepherd_core/vsource/virtual_harvester_model.py,sha256=GyA0uGl3r42t5c4roYtEaj22
74
74
  shepherd_core/vsource/virtual_harvester_simulation.py,sha256=MFT583s73BJZYyhcqgnDUGTPr9s_lN_lKafzJG6kueE,2457
75
75
  shepherd_core/vsource/virtual_source_model.py,sha256=9tiOzgrEgdEH5Uuhd8hjmmIkquNDuaNjLlblvInIlzg,3036
76
76
  shepherd_core/vsource/virtual_source_simulation.py,sha256=ZOnFd2uPawY2G1salCiLGx9o1OBG99_-EHBtDjx4ZUo,5140
77
- shepherd_core-2024.11.3.dist-info/METADATA,sha256=OBSLkOgbXMb_mhTym-Dk2p_GoPkGQyzMbYlaRhRhicU,7807
78
- shepherd_core-2024.11.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
79
- shepherd_core-2024.11.3.dist-info/top_level.txt,sha256=wy-t7HRBrKARZxa-Y8_j8d49oVHnulh-95K9ikxVhew,14
80
- shepherd_core-2024.11.3.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
81
- shepherd_core-2024.11.3.dist-info/RECORD,,
77
+ shepherd_core-2025.2.2.dist-info/METADATA,sha256=r7kp-hqRWNI4HjNtagcpvXtUmZLcmrpj4iRTZo34g2Q,7806
78
+ shepherd_core-2025.2.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
79
+ shepherd_core-2025.2.2.dist-info/top_level.txt,sha256=wy-t7HRBrKARZxa-Y8_j8d49oVHnulh-95K9ikxVhew,14
80
+ shepherd_core-2025.2.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
81
+ shepherd_core-2025.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5