def test_peek_at_datum_on_port(): """ Test peek at datum on a test port with complete datum """ from kwiver.sprokit.pipeline import process from kwiver.sprokit.pipeline import datum, DatumType from kwiver.vital.config import config from kwiver.sprokit.pipeline import edge from kwiver.sprokit.pipeline import stamp cfg = config.empty_config() # Create Dummy Receiver process receiver_proc = process.PythonProcess(cfg) optional = process.PortFlags() receiver_proc.declare_input_port("test_port", "test", optional, "test_port") # Create an Edge and connect input port to the edge test_edge = edge.Edge() receiver_proc.connect_input_port("test_port", test_edge) # Create an Edge Datum and push it to the port s = stamp.new_stamp(1) e_datum = edge.EdgeDatum(datum.complete(), s) test_edge.push_datum(e_datum) receiver_datum_type = receiver_proc.peek_at_datum_on_port( "test_port").type() if receiver_datum_type != DatumType.complete: test_error("Datum mismatch: expected a complete datum, got {0}".format( receiver_datum_type))
def test_api_calls(): from kwiver.sprokit.pipeline import stamp s = stamp.new_stamp(1) si = stamp.incremented_stamp(s) t = stamp.new_stamp(2) if s > si: test_error("A stamp is greater than its increment") if si < s: test_error("A stamp is greater than its increment") si2 = stamp.incremented_stamp(si) ti = stamp.incremented_stamp(t) if not si2 == ti: test_error("Stamps with different rates do not compare as equal")
def test_datum_create(): from kwiver.sprokit.pipeline import datum from kwiver.sprokit.pipeline import edge from kwiver.sprokit.pipeline import stamp d = datum.complete() s = stamp.new_stamp(1) edge.EdgeDatum() edge.EdgeDatum(d, s) edge.EdgeData()
def test_datum_api_calls(): from kwiver.sprokit.pipeline import datum from kwiver.sprokit.pipeline import edge from kwiver.sprokit.pipeline import stamp d = datum.complete() s = stamp.new_stamp(1) ed = edge.EdgeDatum(d, s) ed.datum ed.datum = d ed.stamp ed.stamp = s
def test_api_calls(): from kwiver.vital.config import config from kwiver.sprokit.pipeline import datum from kwiver.sprokit.pipeline import edge from kwiver.vital.modules import modules from kwiver.sprokit.pipeline import process from kwiver.sprokit.pipeline import process_factory from kwiver.sprokit.pipeline import stamp e = edge.Edge() e.makes_dependency() e.has_data() e.full_of_data() e.datum_count() d = datum.complete() s = stamp.new_stamp(1) ed = edge.EdgeDatum(d, s) e.push_datum(ed) e.get_datum() e.push_datum(ed) e.peek_datum() e.pop_datum() modules.load_known_modules() p = process_factory.create_process('orphan', 'process_name') e.set_upstream_process(p) e.set_downstream_process(p) e.mark_downstream_as_complete() e.is_downstream_complete() e.config_dependency e.config_capacity
def test_create(): from kwiver.sprokit.pipeline import stamp stamp.new_stamp(1)