Example #1
0
        def _step(self):
            from sprokit.pipeline import datum

            if self.counter >= self.end:
                self.mark_process_as_complete()
                dat = datum.complete()
            else:
                dat = datum.new(self.counter)
                self.counter += 1

            self.push_datum_to_port(self.port_output, dat)

            self._base_step()
Example #2
0
        def _step(self):
            from sprokit.pipeline import datum

            if self.counter >= self.end:
                self.mark_process_as_complete()
                dat = datum.complete()
            else:
                dat = datum.new(self.counter)
                self.counter += 1

            self.push_datum_to_port(self.port_output, dat)

            self._base_step()
Example #3
0
def test_new():
    from sprokit.pipeline import datum

    d = datum.new('test_datum')

    if not d.type() == datum.DatumType.data:
        test_error("Datum type mismatch")

    if len(d.get_error()):
        test_error("A data datum has an error string")

    p = d.get_datum()

    if p is None:
        test_error("A data datum has None as its data")