Skip to content

Commit

Permalink
Implement petgraph traits (#70)
Browse files Browse the repository at this point in the history
* Implement petgraph traits

* Add new feature to the README
  • Loading branch information
aborgna-q authored Jun 14, 2023
1 parent e52e441 commit ea13161
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ bitvec = "1.0.1"
serde = { version = "1.0.152", features = ["derive"], optional = true}
proptest = { version = "1.1.0", optional = true }
rand = { version = "0.8.5", optional = true }
petgraph = { version = "0.6.3", optional = true }

[features]
pyo3 = ["dep:pyo3"]
serde = ["dep:serde", "bitvec/serde"]
proptest = ["dep:proptest", "dep:rand"]
petgraph = ["dep:petgraph"]

[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports"] }
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Please read the [API documentation here][].

- `pyo3`: Enable Python bindings via pyo3.
- `serde`: Enable serialization and deserialization via serde.
- `petgraph`: Enable petgraph interoperability by implementing the
`petgraph::visit` traits for `PortGraph` and `MultiPortGraph`.

## Recent Changes

Expand Down
3 changes: 3 additions & 0 deletions src/view.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Abstractions over portgraph representations.
#[cfg(feature = "petgraph")]
pub mod petgraph;

use crate::{portgraph::PortOperation, Direction, LinkError, NodeIndex, PortIndex, PortOffset};

/// Core capabilities of a graph containing nodes and ports.
Expand Down
Loading

0 comments on commit ea13161

Please sign in to comment.