def test_get_independent_ops(self): assert dags.get_independent_ops(self.dag0_processed) == {3, 4, 6, 19} assert dags.get_independent_ops(self.dag1_processed) == {3, 4, 6} assert dags.get_independent_ops(self.dag2_processed) == {4, 5, 8, 10, 11, 28} assert dags.get_independent_ops(self.dag3_processed) == {7, 11, 12, 13, 14, 15} assert dags.get_independent_ops(self.dag4_processed) == {5, 6} assert dags.get_independent_ops(self.dag5_processed) == {6, 5, 1} assert dags.get_independent_ops(self.cycle1_processed) == set([]) assert dags.get_independent_ops(self.cycle2_processed) == {3, 4, 8, 10, 11}
def get_independent_ops(self, dag=None): """Get a list of all node in the graph with no dependencies.""" return dags.get_independent_ops(self.dag or dag)