Plexora

DatasetCreateError

Raised by create_dataset when a batch registration fails part-way.

Generated from Plexora 0.0.55View source
from plexora import DatasetCreateError
DatasetCreateError(message, *, dataset=None, created=(), failed=None, cause=None)

Subclass of RuntimeError.

Everything that registered successfully before the failing entry stays registered and assigned to the dataset -- see created -- rather than being rolled back. Fix the entry named in failed and call create_dataset again with just the remaining specs (pass exist_ok=True to add to the same dataset).

Constructor parameters

messagestrrequired

What went wrong, naming the file that failed.

datasetDatasetkeyword-onlydefault None

The dataset the successful entries were assigned to, or None if the failure happened before the dataset itself was created.

createdlistkeyword-onlydefault ()

Names of the projects registered before the failure.

faileddictkeyword-onlydefault None

The project spec that failed.

causeExceptionkeyword-onlydefault None

The exception raised while registering failed.

Examples

import plexora

try:
    plexora.create_dataset("Melanoma Cohort", images=[
        "slide.ome.tif", "no_such_file.ome.tif"])
except plexora.DatasetCreateError as exc:
    print(exc.created)  # ["slide"] -- already registered
    print(exc.failed)   # the spec that failed