Skip to content

SampleSet.insert not accepting DelayedSample objects as item

In bob/pipelines/sample.py, in the SampleSet class, the insert(self, index, item) does not accept DelayedSample objects.

(Because of the test: if not isinstance(item, Sample):.)

To solve:

  • either make DelayedSample and Sample inherit from a SampleBase class,
  • change the tests in SampleSet.insert to accept the base class an thus all Sample-like classes;

or:

  • change the tests in SampleSet.insert to accept both Sample and DelayedSample.

(Could be the same with __setitem__.)