diff --git a/Cargo.toml b/Cargo.toml index 14a2148a3..39f534ef8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,7 @@ path = "src/lib.rs" [dependencies] bimap = "0.6.2" bitvec = "1.0.1" -portgraph = { git = "https://github.com/CQCL/portgraph", rev = "b6e266c45f82fc378ad0ff3365a1f02b88d91693", features = [ - "petgraph", -], optional = true } +portgraph = { version = "0.13", features = ["petgraph"], optional = true } serde = { version = "1.0.152", features = ["derive"], optional = true } smallvec = "1.10.0" itertools = "0.10.5" @@ -71,8 +69,7 @@ auto_enums = "0.8.6" [dev-dependencies.portgraph] features = ["proptest", "serde"] -git = "https://github.com/CQCL/portgraph" -rev = "b6e266c45f82fc378ad0ff3365a1f02b88d91693" +version = "*" [profile.dev.package] insta.opt-level = 3 diff --git a/src/concrete.rs b/src/concrete.rs index f1c8c7d86..27bf6e6cf 100644 --- a/src/concrete.rs +++ b/src/concrete.rs @@ -1,6 +1,6 @@ //! Example implementations for various data types. pub mod matrix; -// #[cfg(feature = "portgraph")] -// pub mod portgraph; +#[cfg(feature = "portgraph")] +pub mod portgraph; pub mod string; diff --git a/src/utils.rs b/src/utils.rs index 7bcbb9aa6..cc181890f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -2,12 +2,12 @@ #[cfg(feature = "portgraph")] pub(crate) mod portgraph; -// #[cfg(all(feature = "portgraph", feature = "proptest"))] -// pub mod test; +#[cfg(all(feature = "portgraph", feature = "proptest"))] +pub mod test; use itertools::Itertools; -// #[cfg(all(feature = "portgraph", feature = "proptest"))] -// pub use test::gen_portgraph_connected; +#[cfg(all(feature = "portgraph", feature = "proptest"))] +pub use test::gen_portgraph_connected; /// Sort a vector and return a vector of pairs of the original value and its position. #[allow(dead_code)] diff --git a/src/utils/test.rs b/src/utils/test.rs index af9c009c2..1834c62d1 100644 --- a/src/utils/test.rs +++ b/src/utils/test.rs @@ -31,30 +31,8 @@ impl> From> for } } -// pub(crate) fn graph() -> PortGraph { -// let mut g = PortGraph::new(); -// let v0 = g.add_node(2, 2); -// let v1 = g.add_node(2, 3); -// let vlol = g.add_node(3, 4); -// let v2 = g.add_node(2, 1); -// let v3 = g.add_node(2, 2); -// let v0_out0 = g.port_index(v0, PortOffset::new_outgoing(0)).unwrap(); -// let v1_out1 = g.port_index(v1, PortOffset::new_outgoing(1)).unwrap(); -// let v2_in0 = g.port_index(v2, PortOffset::new_incoming(0)).unwrap(); -// let v2_in1 = g.port_index(v2, PortOffset::new_incoming(1)).unwrap(); -// let v2_out0 = g.port_index(v2, PortOffset::new_outgoing(0)).unwrap(); -// let v3_in1 = g.port_index(v3, PortOffset::new_incoming(1)).unwrap(); -// g.link_ports(v0_out0, v2_in1).unwrap(); -// g.link_ports(v1_out1, v2_in0).unwrap(); -// g.link_ports(v2_out0, v3_in1).unwrap(); -// g.remove_node(vlol); -// g -// } - -#[cfg(feature = "proptest")] pub use self::proptests::*; -#[cfg(feature = "proptest")] mod proptests { use super::*; use portgraph::proptest::{gen_multiportgraph, gen_portgraph};