deepdraw.data.sample#

Classes

DelayedSample(load[, parent])

Representation of sample that can be loaded via a callable.

Sample(data[, parent])

Representation of sample that is sufficient for the blocks in this module.

SampleSet(samples[, parent])

A set of samples with extra attributes https://docs.python.org/3/library/collections.abc.html#collections- abstract-base-classes.

class deepdraw.data.sample.DelayedSample(load, parent=None, **kwargs)[source]#

Bases: object

Representation of sample that can be loaded via a callable.

The optional **kwargs argument allows you to attach more attributes to this sample instance.

Parameters:
  • load (object) – A python function that can be called parameterlessly, to load the sample in question from whatever medium

  • parent (DelayedSample, Sample, None) – If passed, consider this as a parent of this sample, to copy information

  • kwargs (dict) – Further attributes of this sample, to be stored and eventually transmitted to transformed versions of the sample

property data#

Loads the data from the disk file.

class deepdraw.data.sample.Sample(data, parent=None, **kwargs)[source]#

Bases: object

Representation of sample that is sufficient for the blocks in this module.

Each sample must have the following attributes:

  • attribute data: Contains the data for this sample

Parameters:
  • data (object) – Object representing the data to initialize this sample with.

  • parent (object) – A parent object from which to inherit all other attributes (except data)

class deepdraw.data.sample.SampleSet(samples, parent=None, **kwargs)[source]#

Bases: MutableSequence

A set of samples with extra attributes https://docs.python.org/3/library/collections.abc.html#collections- abstract-base-classes.

insert(index, item)[source]#

S.insert(index, value) – insert value before index