Skip to content

Better error handling when root_folder is empty or lacks valid devices #162

Description

@sametSeckiiin

Hi,

I noticed that when initializing the Experiment class with a root_folder that is either empty or doesn't contain any valid device data, the library throws a ValueError that is a bit confusing for a first-time user:

ValueError: Experiment time range could not be determined: no devices with valid start_time and end_time were found.

This happens because _load_devices() expects to find data immediately to calculate the experiment's duration. However, this prevents creating an "empty" experiment object to which devices could potentially be added later programmatically.

It would be great if the library could either:

1-Provide a more descriptive error message (e.g., "The provided root_folder is empty or contains no valid device subfolders").

2Allow the initialization of an empty Experiment object (perhaps with an allow_empty=True flag) so we can add data later.

I'm happy to help with a PR if this is something you'd like to improve!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions