Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move collect_runs() to rustworkx-core #1210

Merged
merged 18 commits into from
Jun 20, 2024
Merged

Conversation

eliarbel
Copy link
Contributor

@eliarbel eliarbel commented Jun 7, 2024

This PR moves collect_runs() functionality to rustworkx-core into rustworkx-core/src/dag_algo.rs. This will be used by collect_runs() in src/dag_algo/mod.rs.

Closes #1199

Tasks:

  • Read the CONTRIBUTING document
  • Implement in core, including error handling
  • Add tests in core
  • Convert core implementation to return iterator over runs
  • Use core implementation in rustworkx
  • Update documentation
  • Format code

@eliarbel eliarbel marked this pull request as ready for review June 17, 2024 09:42
@eliarbel
Copy link
Contributor Author

@mtreinish this is ready for review now, however CI clippy complains on parts in the code not included in this PR (with error: usage of a legacy numeric constant). Any idea?

@mtreinish
Copy link
Member

My guess is that the release of rust 1.79 last week is causing new clippy rules to be run and that's causing the failure. Although I thought we should have everything pinned to the MSRV in CI to avoid this kind of situation.

@eliarbel
Copy link
Contributor Author

My guess is that the release of rust 1.79 last week is causing new clippy rules to be run and that's causing the failure. Although I thought we should have everything pinned to the MSRV in CI to avoid this kind of situation.

Yes, I was on 1.77. Updating to 1.79 I see those warnings locally as well. I'll wait for it to be resolved.

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the compiler errors in the rust tests this is looking good. Just a few small inline comments.

rustworkx-core/src/dag_algo.rs Outdated Show resolved Hide resolved
src/dag_algo/mod.rs Outdated Show resolved Hide resolved
rustworkx-core/src/dag_algo.rs Outdated Show resolved Hide resolved
src/dag_algo/mod.rs Outdated Show resolved Hide resolved
src/dag_algo/mod.rs Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9579580062

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 82 of 84 (97.62%) changed or added relevant lines in 2 files are covered.
  • 16 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 95.86%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rustworkx-core/src/dag_algo.rs 68 70 97.14%
Files with Coverage Reduction New Missed Lines %
src/connectivity/mod.rs 16 96.75%
Totals Coverage Status
Change from base Build 9565715860: 0.03%
Covered Lines: 17460
Relevant Lines: 18214

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks for doing this.

.graph
.neighbors_directed(node, petgraph::Direction::Outgoing)

let mut result: Vec<Vec<PyObject>> = Vec::with_capacity(core_runs.size_hint().1.unwrap_or(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in some overallocation, but I don't think it's a big deal, it's also only temporary as we convert this to a pylist almost immediately so this is fine.

@coveralls
Copy link

coveralls commented Jun 20, 2024

Pull Request Test Coverage Report for Build 9603800299

Details

  • 82 of 84 (97.62%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.86%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rustworkx-core/src/dag_algo.rs 68 70 97.14%
Totals Coverage Status
Change from base Build 9589302565: 0.0%
Covered Lines: 17460
Relevant Lines: 18214

💛 - Coveralls

@mtreinish mtreinish merged commit c2eed52 into Qiskit:main Jun 20, 2024
28 checks passed
@eliarbel eliarbel deleted the collect_runs_core branch June 25, 2024 07:10
mtreinish pushed a commit that referenced this pull request Jun 25, 2024
A follow up PR to #1210, adding a missing release note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move collect_runs() functionality to rustworkx-core
3 participants