Shepherd-Core - Config-Models#

Note

TODO: WORK IN PROGRESS

The models offer

  • one unified interface for all tools

  • auto-completion with neutral / sensible values

  • complex and custom datatypes (i.e. PositiveInt, lists-checks on length)

  • checking of inputs (validation) and type-casting

  • generate their own schema (for web-forms)

  • recursive inheritance (for content-configs)

  • pre-validation

  • store to & load from yaml or json with typecheck through wrapper

  • included documentation

Experiment#

This category includes configuration-models for setting up an experiment. Part of the sub-systems are in the next section Observer Capabilities.

pydantic model shepherd_core.data_models.experiment.Experiment#

Configuration for Experiments on the Shepherd-Testbed emulating Energy Environments for Target Nodes

Fields:
  • id (int)

  • name (str)

  • description (str | None)

  • comment (str | None)

  • created (datetime.datetime)

  • owner_id (int | None)

  • email_results (pydantic.networks.EmailStr | None)

  • sys_logging (shepherd_core.data_models.experiment.observer_features.SystemLogging)

  • time_start (datetime.datetime | None)

  • duration (datetime.timedelta | None)

  • abort_on_error (bool)

  • target_configs (List[shepherd_core.data_models.experiment.target_config.TargetConfig])

field id: int [Optional]#

Unique ID

Constraints:
  • ge = 0

  • lt = 340282366920938463463374607431768211456

field name: str [Required]#
Constraints:
  • max_length = 32

  • pattern = ^[^<>:;,?”*|/\]+$

field description: str | None = None#

Required for public instances

field comment: str | None = None#
field created: datetime [Optional]#
field owner_id: int | None = 5472#
field email_results: EmailStr | None = None#
field sys_logging: SystemLogging = SystemLogging({})#
field time_start: datetime | None = None#
field duration: timedelta | None = None#
field abort_on_error: bool = False#
field target_configs: List[TargetConfig] [Required]#
Constraints:
  • min_length = 1

  • max_length = 128

static validate_targets(configs: List[TargetConfig]) None#
static validate_observers(configs: List[TargetConfig]) None#
get_target_ids() list#
get_target_config(target_id: int) TargetConfig#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.experiment.TargetConfig#

Configuration for Target Nodes (DuT)

Fields:
  • target_IDs (List[int])

  • custom_IDs (List[int] | None)

  • energy_env (shepherd_core.data_models.content.energy_environment.EnergyEnvironment)

  • virtual_source (shepherd_core.data_models.content.virtual_source.VirtualSourceConfig)

  • target_delays (List[int] | None)

  • firmware1 (shepherd_core.data_models.content.firmware.Firmware)

  • firmware2 (shepherd_core.data_models.content.firmware.Firmware | None)

  • power_tracing (shepherd_core.data_models.experiment.observer_features.PowerTracing | None)

  • gpio_tracing (shepherd_core.data_models.experiment.observer_features.GpioTracing | None)

  • gpio_actuation (shepherd_core.data_models.experiment.observer_features.GpioActuation | None)

field target_IDs: List[int] [Required]#
Constraints:
  • min_length = 1

  • max_length = 128

field custom_IDs: List[int] | None = None#
field energy_env: EnergyEnvironment [Required]#
field virtual_source: VirtualSourceConfig = VirtualSourceConfig({'id': 1000, 'name': 'neutral', 'description': 'Direct feed-through of energy environment with no converter (allows on-off-patters)', 'created': datetime.datetime(2022, 12, 12, 12, 12, 12), 'owner': 'Ingmar', 'group': 'NES Lab', 'visible2group': True, 'visible2all': True})#
field target_delays: List[int] | None = None#
field firmware1: Firmware [Required]#
field firmware2: Firmware | None = None#
field power_tracing: PowerTracing | None = None#
field gpio_tracing: GpioTracing | None = None#
field gpio_actuation: GpioActuation | None = None#
get_custom_id(target_id: int) int | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

Observer Capabilities#

These are some of the sub-systems for configuring experiments and also tasks.

Link to Source

pydantic model shepherd_core.data_models.experiment.PowerTracing#

Configuration for recording the Power-Consumption of the Target Nodes TODO: postprocessing not implemented ATM

Fields:
  • intermediate_voltage (bool)

  • delay (datetime.timedelta)

  • duration (datetime.timedelta | None)

  • calculate_power (bool)

  • samplerate (int)

  • discard_current (bool)

  • discard_voltage (bool)

field intermediate_voltage: bool = False#
field delay: timedelta = 0#
field duration: timedelta | None = None#
field calculate_power: bool = False#
field samplerate: int = 100000#
Constraints:
  • ge = 10

  • le = 100000

field discard_current: bool = False#
field discard_voltage: bool = False#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.experiment.GpioTracing#

Configuration for recording the GPIO-Output of the Target Nodes TODO: postprocessing not implemented ATM

Fields:
  • mask (int)

  • gpios (List[shepherd_core.data_models.testbed.gpio.GPIO] | None)

  • delay (datetime.timedelta)

  • duration (datetime.timedelta | None)

  • uart_decode (bool)

  • uart_pin (shepherd_core.data_models.testbed.gpio.GPIO)

  • uart_baudrate (int)

field mask: int = 1023#
Constraints:
  • ge = 0

  • lt = 1024

field gpios: List[GPIO] | None = None#
field delay: timedelta = 0#
field duration: timedelta | None = None#
field uart_decode: bool = False#
field uart_pin: GPIO = GPIO({'id': 1008, 'name': 'GPIO8', 'description': 'alias UART_TX', 'direction': 'IO', 'dir_switch': 'DIR2', 'reg_pru': 'r31_08', 'pin_pru': 'P8_27', 'reg_sys': 15, 'pin_sys': 'P9_24'})#
field uart_baudrate: int = 115200#
Constraints:
  • ge = 2400

  • le = 921600

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

deactiveated due to Error (TODO)
.. autopydantic_model:: shepherd_core.data_models.experiment.GpioActuation
.. autopydantic_model:: shepherd_core.data_models.experiment.GpioLevel
pydantic model shepherd_core.data_models.experiment.SystemLogging#

Configuration for recording Debug-Output of the Observers System-Services

Fields:
  • dmesg (bool)

  • ptp (bool)

  • shepherd (bool)

field dmesg: bool = True#
field ptp: bool = True#
field shepherd: bool = True#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

Content-Types#

Reusable user-defined meta-data for fw, h5 and vsrc-definitions.

Link to Source

pydantic model shepherd_core.data_models.content.EnergyEnvironment#

Recording of meta-data representation of a testbed-component

Fields:
  • data_path (pathlib.Path)

  • data_type (shepherd_core.data_models.content.energy_environment.EnergyDType)

  • data_local (bool)

  • duration (float)

  • energy_Ws (float)

  • valid (bool)

  • light_source (str | None)

  • weather_conditions (str | None)

  • indoor (bool | None)

  • location (str | None)

field data_path: Path [Required]#
field data_type: EnergyDType [Required]#
field data_local: bool = True#
field duration: float [Required]#
Constraints:
  • gt = 0

field energy_Ws: float [Required]#
Constraints:
  • gt = 0

field valid: bool = False#
field light_source: str | None = None#
field weather_conditions: str | None = None#
field indoor: bool | None = None#
field location: str | None = None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.content.Firmware#

meta-data representation of a data-component

Fields:
  • mcu (shepherd_core.data_models.testbed.mcu.MCU)

  • data (str | pathlib.Path)

  • data_type (shepherd_core.data_models.content.firmware_datatype.FirmwareDType)

  • data_hash (str | None)

  • data_local (bool)

field mcu: MCU [Required]#
field data: str | Path [Required]#
field data_type: FirmwareDType [Required]#
field data_hash: str | None = None#
field data_local: bool = True#
classmethod from_firmware(file: Path, *, embed: bool = True, **kwargs: Unpack) Self#

Embeds firmware and tries to fill parameters ELF -> mcu und data_type are deducted HEX -> must supply mcu manually

compare_hash(path: Path | None = None) bool#
extract_firmware(file: Path) Path#

Stores embedded data in file - file-suffix is derived from data-type and adapted - if provided path is a directory, the firmware-name is used

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.content.VirtualHarvesterConfig#

A Harvester is needed when the file-based energy environment of the virtual source is not already supplied as ivsample

Fields:
  • algorithm (shepherd_core.data_models.content.virtual_harvester.AlgorithmDType)

  • samples_n (int)

  • voltage_mV (float)

  • voltage_min_mV (float)

  • voltage_max_mV (float)

  • current_limit_uA (float)

  • voltage_step_mV (float | None)

  • setpoint_n (float)

  • interval_ms (float)

  • duration_ms (float)

  • rising (bool)

  • wait_cycles (int)

field algorithm: AlgorithmDType [Required]#
field samples_n: int = 8#
Constraints:
  • ge = 8

  • le = 2000

field voltage_mV: float = 2500#
Constraints:
  • ge = 0

  • le = 5000

field voltage_min_mV: float = 0#
Constraints:
  • ge = 0

  • le = 5000

field voltage_max_mV: float = 5000#
Constraints:
  • ge = 0

  • le = 5000

field current_limit_uA: float = 50000#
Constraints:
  • ge = 1

  • le = 50000

field voltage_step_mV: float | None = None#
field setpoint_n: float = 0.7#
Constraints:
  • ge = 0

  • le = 1.0

field interval_ms: float = 100#
Constraints:
  • ge = 0.01

  • le = 1000000

field duration_ms: float = 0.1#
Constraints:
  • ge = 0.01

  • le = 1000000

field rising: bool = True#
field wait_cycles: int = 1#
Constraints:
  • ge = 0

  • le = 100

calc_hrv_mode(*, for_emu: bool) int#
calc_algorithm_num(*, for_emu: bool) int#
calc_timings_ms(*, for_emu: bool) Tuple[float, float]#

factor-in model-internal timing-constraints

get_datatype() EnergyDType#
calc_window_size(dtype_in: EnergyDType | None = EnergyDType.ivsample, *, for_emu: bool) int#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.content.VirtualSourceConfig#

The virtual Source uses the energy environment (file) for supplying the Target Node during the experiment. If not already done, the energy will be harvested and then converted. The converter-stage is software defined and offers:

buck-boost-combinations, a simple diode + resistor and an intermediate buffer capacitor. TODO: I,V,R should be in regular unit (V, A, Ohm)

Fields:
  • enable_boost (bool)

  • enable_buck (bool)

  • interval_startup_delay_drain_ms (float)

  • harvester (shepherd_core.data_models.content.virtual_harvester.VirtualHarvesterConfig)

  • V_input_max_mV (float)

  • I_input_max_mA (float)

  • V_input_drop_mV (float)

  • R_input_mOhm (float)

  • C_intermediate_uF (float)

  • V_intermediate_init_mV (float)

  • I_intermediate_leak_nA (float)

  • V_intermediate_enable_threshold_mV (float)

  • V_intermediate_disable_threshold_mV (float)

  • interval_check_thresholds_ms (float)

  • V_pwr_good_enable_threshold_mV (float)

  • V_pwr_good_disable_threshold_mV (float)

  • immediate_pwr_good_signal (bool)

  • C_output_uF (float)

  • V_output_log_gpio_threshold_mV (float)

  • V_input_boost_threshold_mV (float)

  • V_intermediate_max_mV (float)

  • LUT_input_efficiency (List[List[float]])

  • LUT_input_V_min_log2_uV (int)

  • LUT_input_I_min_log2_nA (int)

  • V_output_mV (float)

  • V_buck_drop_mV (float)

  • LUT_output_efficiency (List[float])

  • LUT_output_I_min_log2_nA (int)

field enable_boost: bool = False#
field enable_buck: bool = False#
field interval_startup_delay_drain_ms: float = 0#
Constraints:
  • ge = 0

  • le = 10000

field harvester: VirtualHarvesterConfig = VirtualHarvesterConfig({'id': 1046, 'name': 'mppt_opt', 'description': 'Power-Optimum with very fast PO-Variant (harvesting) or special max-pwr-picker (emulator / ivcurve)', 'created': datetime.datetime(2022, 12, 12, 12, 12, 12), 'owner': 'Ingmar', 'group': 'NES Lab', 'visible2group': True, 'visible2all': True, 'algorithm': 'mppt_opt', 'voltage_step_mV': 1.0, 'interval_ms': 0.01})#
field V_input_max_mV: float = 10000#
Constraints:
  • ge = 0

  • le = 10000

field I_input_max_mA: float = 4200#
Constraints:
  • ge = 0

  • le = 4290.0

field V_input_drop_mV: float = 0#
Constraints:
  • ge = 0

  • le = 4290000.0

field R_input_mOhm: float = 0#
Constraints:
  • ge = 0

  • le = 4290000.0

field C_intermediate_uF: float = 0#
Constraints:
  • ge = 0

  • le = 100000

field V_intermediate_init_mV: float = 3000#
Constraints:
  • ge = 0

  • le = 10000

field I_intermediate_leak_nA: float = 0#
Constraints:
  • ge = 0

  • le = 4290000000.0

field V_intermediate_enable_threshold_mV: float = 1#
Constraints:
  • ge = 0

  • le = 10000

field V_intermediate_disable_threshold_mV: float = 0#
Constraints:
  • ge = 0

  • le = 10000

field interval_check_thresholds_ms: float = 0#
Constraints:
  • ge = 0

  • le = 4290.0

field V_pwr_good_enable_threshold_mV: float = 2800#
Constraints:
  • ge = 0

  • le = 10000

field V_pwr_good_disable_threshold_mV: float = 2200#
Constraints:
  • ge = 0

  • le = 10000

field immediate_pwr_good_signal: bool = True#
field C_output_uF: float = 1.0#
Constraints:
  • ge = 0

  • le = 4290000.0

field V_output_log_gpio_threshold_mV: float = 1400#
Constraints:
  • ge = 0

  • le = 4290000.0

field V_input_boost_threshold_mV: float = 0#
Constraints:
  • ge = 0

  • le = 10000

field V_intermediate_max_mV: float = 10000#
Constraints:
  • ge = 0

  • le = 10000

field LUT_input_efficiency: List[List[float]] = [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]]#
Constraints:
  • min_length = 12

  • max_length = 12

field LUT_input_V_min_log2_uV: int = 0#
Constraints:
  • ge = 0

  • le = 20

field LUT_input_I_min_log2_nA: int = 0#
Constraints:
  • ge = 0

  • le = 20

field V_output_mV: float = 2400#
Constraints:
  • ge = 0

  • le = 5000

field V_buck_drop_mV: float = 0#
Constraints:
  • ge = 0

  • le = 5000

field LUT_output_efficiency: List[float] = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]#
Constraints:
  • min_length = 12

  • max_length = 12

field LUT_output_I_min_log2_nA: int = 0#
Constraints:
  • ge = 0

  • le = 20

calc_internal_states() dict#

Compensate for (hard to detect) current-surge of real capacitors when converter gets turned on -> this can be const value, because the converter always turns on with “V_storage_enable_threshold_uV” TODO: currently neglecting delay after disabling converter, boost only has simpler formula, second enabling when V_Cap >= V_out

Math behind this calculation: Energy-Change Storage Cap -> E_new = E_old - E_output with Energy of a Cap -> E_x = C_x * V_x^2 / 2 combine formulas ->

C_store * V_store_new^2 / 2 = C_store * V_store_old^2 / 2 - C_out * V_out^2 / 2

convert formula to V_new -> V_store_new^2 = V_store_old^2 - (C_out / C_store) * V_out^2 convert into dV -> dV = V_store_new - V_store_old in case of V_cap = V_out -> dV = V_store_old * (sqrt(1 - C_out / C_store) - 1) -> dV values will be reversed (negated), because dV is always negative (Voltage drop)

calc_converter_mode(*, log_intermediate_node: bool) int#

Assembles bitmask from discrete values log_intermediate_node: record / log virtual intermediate (cap-)voltage and

-current (out) instead of output-voltage and -current

calc_cap_constant_us_per_nF_n28() int#

Calc constant to convert capacitor-current to Voltage-delta dV[uV] = constant[us/nF] * current[nA] = constant[us*V/nAs] * current[nA]

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

Tasks#

These are digestible configs for shepherd-herd or -sheep.

Link to Source

pydantic model shepherd_core.data_models.task.HarvestTask#

Configuration for the Observer in Harvest-Mode Record IV data from a harvest-source

Fields:
  • output_path (pathlib.Path)

  • force_overwrite (bool)

  • output_compression (shepherd_core.data_models.task.emulation.Compression | None)

  • time_start (datetime.datetime | None)

  • duration (datetime.timedelta | None)

  • abort_on_error (bool)

  • use_cal_default (bool)

  • virtual_harvester (shepherd_core.data_models.content.virtual_harvester.VirtualHarvesterConfig)

  • power_tracing (shepherd_core.data_models.experiment.observer_features.PowerTracing)

  • sys_logging (shepherd_core.data_models.experiment.observer_features.SystemLogging | None)

  • verbose (int)

field output_path: Path [Required]#
field force_overwrite: bool = False#
field output_compression: Compression | None = Compression.lzf#
field time_start: datetime | None = None#
field duration: timedelta | None = None#
field abort_on_error: bool = False#
field use_cal_default: bool = False#
field virtual_harvester: VirtualHarvesterConfig = VirtualHarvesterConfig({'id': 1046, 'name': 'mppt_opt', 'description': 'Power-Optimum with very fast PO-Variant (harvesting) or special max-pwr-picker (emulator / ivcurve)', 'created': datetime.datetime(2022, 12, 12, 12, 12, 12), 'owner': 'Ingmar', 'group': 'NES Lab', 'visible2group': True, 'visible2all': True, 'algorithm': 'mppt_opt', 'voltage_step_mV': 1.0, 'interval_ms': 0.01})#
field power_tracing: PowerTracing = PowerTracing({})#
field sys_logging: SystemLogging | None = SystemLogging({})#
field verbose: int = 2#
Constraints:
  • ge = 0

  • le = 4

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.task.EmulationTask#

Configuration for the Observer in Emulation-Mode

Fields:
  • input_path (pathlib.Path)

  • output_path (pathlib.Path | None)

  • force_overwrite (bool)

  • output_compression (shepherd_core.data_models.task.emulation.Compression | None)

  • time_start (datetime.datetime | None)

  • duration (datetime.timedelta | None)

  • abort_on_error (bool)

  • use_cal_default (bool)

  • enable_io (bool)

  • io_port (shepherd_core.data_models.testbed.cape.TargetPort)

  • pwr_port (shepherd_core.data_models.testbed.cape.TargetPort)

  • voltage_aux (float | str)

  • virtual_source (shepherd_core.data_models.content.virtual_source.VirtualSourceConfig)

  • power_tracing (shepherd_core.data_models.experiment.observer_features.PowerTracing | None)

  • gpio_tracing (shepherd_core.data_models.experiment.observer_features.GpioTracing | None)

  • gpio_actuation (shepherd_core.data_models.experiment.observer_features.GpioActuation | None)

  • sys_logging (shepherd_core.data_models.experiment.observer_features.SystemLogging | None)

  • verbose (int)

field input_path: Path [Required]#
field output_path: Path | None = None#
field force_overwrite: bool = False#
field output_compression: Compression | None = Compression.lzf#
field time_start: datetime | None = None#
field duration: timedelta | None = None#
field abort_on_error: bool = False#
field use_cal_default: bool = False#
field enable_io: bool = False#
field io_port: TargetPort = TargetPort.A#
field pwr_port: TargetPort = TargetPort.A#
field voltage_aux: float | str = 0#
field virtual_source: VirtualSourceConfig = VirtualSourceConfig({'id': 1000, 'name': 'neutral', 'description': 'Direct feed-through of energy environment with no converter (allows on-off-patters)', 'created': datetime.datetime(2022, 12, 12, 12, 12, 12), 'owner': 'Ingmar', 'group': 'NES Lab', 'visible2group': True, 'visible2all': True})#
field power_tracing: PowerTracing | None = PowerTracing({})#
field gpio_tracing: GpioTracing | None = GpioTracing({})#
field gpio_actuation: GpioActuation | None = None#
field sys_logging: SystemLogging | None = SystemLogging({})#
field verbose: int = 2#
Constraints:
  • ge = 0

  • le = 4

classmethod from_xp(xp: Experiment, tb: Testbed, tgt_id: int, root_path: Path) Self#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.task.FirmwareModTask#

Config for Task that adds the custom ID to the firmware & stores it into a file

Fields:
  • data (str | pathlib.Path)

  • data_type (shepherd_core.data_models.content.firmware_datatype.FirmwareDType)

  • custom_id (int | None)

  • firmware_file (pathlib.Path)

  • verbose (int)

field data: str | Path [Required]#
field data_type: FirmwareDType [Required]#
field custom_id: int | None = None#
field firmware_file: Path [Required]#
field verbose: int = 2#
Constraints:
  • ge = 0

  • le = 4

classmethod from_xp(xp: Experiment, tb: Testbed, tgt_id: int, mcu_port: int, fw_path: Path) Self#
classmethod from_firmware(fw: Firmware, **kwargs: Unpack) Self#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.task.ProgrammingTask#

Config for Task programming the target selected

Fields:
  • firmware_file (pathlib.Path)

  • target_port (shepherd_core.data_models.testbed.cape.TargetPort)

  • mcu_port (int)

  • mcu_type (str)

  • voltage (float)

  • datarate (int)

  • protocol (shepherd_core.data_models.testbed.mcu.ProgrammerProtocol)

  • simulate (bool)

  • verbose (int)

field firmware_file: Path [Required]#
field target_port: TargetPort = TargetPort.A#
field mcu_port: int = 1#
Constraints:
  • ge = 1

  • le = 2

field mcu_type: str [Required]#
Constraints:
  • pattern = ^[ -~]+$

field voltage: float = 3#
Constraints:
  • ge = 1

  • lt = 5

field datarate: int = 500000#
Constraints:
  • gt = 0

  • le = 1000000

field protocol: ProgrammerProtocol [Required]#
field simulate: bool = False#
field verbose: int = 2#
Constraints:
  • ge = 0

  • le = 4

classmethod from_xp(xp: Experiment, tb: Testbed, tgt_id: int, mcu_port: int, fw_path: Path) Self | None#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.task.ObserverTasks#

Collection of tasks for selected observer included in experiment

Fields:
  • observer (str)

  • owner_id (int)

  • time_prep (datetime.datetime)

  • root_path (pathlib.Path)

  • abort_on_error (bool)

  • fw1_mod (shepherd_core.data_models.task.firmware_mod.FirmwareModTask | None)

  • fw2_mod (shepherd_core.data_models.task.firmware_mod.FirmwareModTask | None)

  • fw1_prog (shepherd_core.data_models.task.programming.ProgrammingTask | None)

  • fw2_prog (shepherd_core.data_models.task.programming.ProgrammingTask | None)

  • emulation (shepherd_core.data_models.task.emulation.EmulationTask | None)

field observer: str [Required]#
Constraints:
  • max_length = 32

  • pattern = ^[^<>:;,?”*|/\]+$

field owner_id: int [Required]#
Constraints:
  • ge = 0

  • lt = 340282366920938463463374607431768211456

field time_prep: datetime [Required]#
field root_path: Path [Required]#
field abort_on_error: bool [Required]#
field fw1_mod: FirmwareModTask | None = None#
field fw2_mod: FirmwareModTask | None = None#
field fw1_prog: ProgrammingTask | None = None#
field fw2_prog: ProgrammingTask | None = None#
field emulation: EmulationTask | None = None#
classmethod from_xp(xp: Experiment, tb: Testbed, tgt_id: int) Self#
get_tasks() List[ShpModel]#
get_output_paths() dict#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

pydantic model shepherd_core.data_models.task.TestbedTasks#

Collection of tasks for all observers included in experiment

Fields:
  • name (str)

  • observer_tasks (List[shepherd_core.data_models.task.observer_tasks.ObserverTasks])

  • email (pydantic.networks.EmailStr | None)

field name: str [Required]#
Constraints:
  • max_length = 32

  • pattern = ^[^<>:;,?”*|/\]+$

field observer_tasks: List[ObserverTasks] [Required]#
Constraints:
  • min_length = 1

  • max_length = 128

field email: EmailStr | None = None#
classmethod from_xp(xp: Experiment, tb: Testbed | None = None) Self#
get_observer_tasks(observer: str) ObserverTasks | None#
get_output_paths() dict#
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.