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

Qiskit / retworkx / 528
97%

Build:
DEFAULT BRANCH: master
Ran 15 Jun 2020 07:58PM UTC
Jobs 1
Files 3
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Jun 2020 07:55PM UTC coverage: 83.483% (+0.8%) from 82.664%
528

push

travis-ci-com

web-flow
Add add_nodes_from and add_edges_from methods (#82)

* Add add_nodes_from and add_edges_from methods

This commit adds 2 methods to PyDAG and PyGraph, add_nodes_from() and
add_edges_from(). These methods take in lists of objects to add to the
graph to minimize the back and forth calling when adding many objects to
the graph at once. add_nodes_from() takes in a list of objects which
will be the data for the node, and add_nodes_from() takes in a list of
tuples with 2 node indexes for where the edge should be added and the
3rd tuple element is the data for the edge.

* Add edges from no data methods

In networkx there the add_edges_from() methods support either 2 or 3
tuples to optionally include a data payload, but not require it.
Implementing this in rust is a bit trickier since the function inputs
need to be of a known size at compile time so having a Vec of arbitrary
length tuples isn't really an option. In a pure rust program we'd
probably use an Option<PyObject> for the third tuple element, but that
doesn't translate to python. To avoid the overhead of having to loop
over lists in python that are using 2 tuples to add a None this commit
adds a second method add_edges_from_no_data that takes in a 2 tuple and
sets the data payload to None when the edge is added.

* Fix rustfmt

* Apply suggestions from code review

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>

* Fix docstrings and rework/simplify cycle checking logic

This commit fixes some typos in the docs for the new functions and
cleans them up slightly. Additionally, the logic and code around the
cycle checking for PyDAG has been reworked. The logic is simplified
slightly and the variable names are changed to make it clearer what is
happening in there. It also adds some comments to try and explain the
logic there a bit better.

* Update src/lib.rs

Co-authored-by: Lauren Capelluto <laurencapelluto@gmail.com>

Co-authored-by: Lauren Capell... (continued)

70 of 70 new or added lines in 2 files covered. (100.0%)

1026 of 1229 relevant lines covered (83.48%)

1680.7 hits per line

Jobs
ID Job ID Ran Files Coverage
3 528.3 15 Jun 2020 07:58PM UTC 0
83.48
Travis Job 528.3
Source Files on build 528
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #528
  • 45e2d5e8 on github
  • Prev Build on master (#506)
  • Next Build on master (#545)
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