• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / rustworkx / 9685802979

26 Jun 2024 07:45PM UTC coverage: 95.388% (-0.06%) from 95.445%
9685802979

push

github

web-flow
Add `layers` function to `rustworkx-core` (#1194)

* Initial: Add `layers` function to `rustworkx-core`
- Modify the `layers` python interface to use the `rustworkx-core` equivalent.

* Docs: Add proper docstring to `layers`

* Fix: Wrong import in docstring

* Fix: Return an `Iterator` instance from `layers` in `rustworkx-core`.

* Test: Add tests to `layers`
- Move `layers` to `dag_algo.rs`.
- Add check for cycles, if a cycle is found throw an error.
- Refactor `LayersIndexError` to `LayersError`.
- Move `LayersError` to `err.rs`.
- Other small tweaks and fixes.

* Format: Fix lint.

* Docs: Fix docs test.

* Docs: Add release note

* Docs: Fix release note

* Fix: Return NodeId instead of usize

* Docs: Add suggestions for release note.

* Fix: Return true Iterator for `layers`
- Use panic exceptions for specific cases.
- Other tweaks and fixes.

* Fix: Node check only in the first layer

* Fix: Remove result handling for layers
- Use `panic!` when a programming error is made.
- Verify cycles by checkng repeating layers, call `panic!` if one is found.
- Adapt python side function to use check for nodes to avoid panic.
- Adapt tests.

* Remove: `LayersError` as it will no longer be needed.
- Small fix in docstring.

* Fix: Revert result handling in `layers`
- Add result handling in the python version of the function.
- Use indices to keep track of cycles.
- Revert deletion of `LayersError`.
- Update tests.
- Other tweaks and fixes.

* Docs: Fix release note and docstring
- Fix docstring test and regular test.
- Add extra check for missing nodes.

* Fix: Explicit warning for invalid first index
- Remove calls to `to_owned()`.

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

108 of 121 new or added lines in 3 files covered. (89.26%)

17972 of 18841 relevant lines covered (95.39%)

1138955.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.11
/rustworkx-core/src/err.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc