Devices and samples

All experiments in Balthazar are associated with one or more Devices (also referred to as samples).
To run a Flow, at least one Device must be selected.


Creating a Device

A Device represents a physical or virtual object under test. Devices can be created either through the user interface or programmatically via a Python Flow.


1. Access the Device page

Navigate to the Device page and click the Add Device button located at the top of the page.

Add Device


2. Enter Device details

Fill in the required information for your new Device:

  • Device name
    Choose a unique and descriptive name for the Device.

  • Fabrication date
    Select the date on which the Device was fabricated (this must be a date in the past).

  • Parameters
    Define key Device properties such as Thickness, Resistance, or Colour.
    Parameters are searchable and can be compared across different Devices.

Once all fields are filled in, click the Add Device button at the bottom-left of the form to create the Device.

Add Device details


3. Device appears in the list

After creation, the Device appears in the Device list.
The list shows the Device parameters along with the runs performed on it.

Device list


Adding Devices via a Flow

Devices and their parameters can also be created programmatically using a Flow.
This approach is especially useful when creating a large number of Devices at once.

Example: Creating multiple Devices

import balthazar as blt
import datetime

# Create 5 Devices
for i in range(5):
    dev = blt.Device(
        f"MyNewDevice_{i}",  # Device name
        fabrication_date=datetime.datetime(2026, 1, 1, 10, 30, 0),
        description="Added by a Flow",
        image_id=None,  # Optional Device image
        tags=["MyTag", "AnotherTag"],  # Optional tags
        params={"Thickness": 5, "Length": 1}  # Optional parameters
    )

    # Print details of the created Device
    print(dev.name, dev.tags, dev.params)

The newly created Devices can be viewed in the Device Explorer.

Device Explorer


Accessing Devices in a Flow

When running a Flow, one or more Devices must be selected. Information about the selected Devices can be accessed programmatically. It is also possible to retrieve all Devices available in the current space.

import balthazar as blt

# Devices selected in the current Flow
devices_in_flow = blt.devices
for dev in devices_in_flow:
    print(dev.name, dev.tags, dev.params)

# All Devices available in the current space
all_devices = blt.search_devices()
for dev in all_devices:
    print(dev.name, dev.tags, dev.params)