Closed mtreinish closed 2 weeks ago
@mtreinish Is this needed for 0.15.0? I can take this on, but it may take me a couple of weeks and I didn't want to hold up 0.15.0 release.
Yeah, I was thinking of trying to squeeze this into 0.15.0 if possible. But also I was viewing this and the other issues I was opening around moving a function into rustworkx-core as good first issues for people trying to get their feet wet with the language since their a good way to start learning about generics and traits.
I'd be happy to have it as my first Rust issue
What is the expected enhancement?
The
collect_runs()
function is only exposed via a Python interface currently:https://github.com/Qiskit/rustworkx/blob/0ec113b077fc27943947496cbef4f88daed558bf/src/dag_algo/mod.rs#L607-L670
We should port it to rustworkx-core, so that rust users can leverage the function.
One tweak that probably makes sense for the rustworkx-core version is that instead of returning a Vec of Vecs of node weights we should have it return of an iterator of Vecs node ids. This would be more flexible and performant for rust space users and for the python side of rustworkx we can just collect the iterator to a Vec (for backwards compatibility).