Skip to content

Commit

Permalink
attempt to fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
clems4ever authored and cmichaudav committed Nov 18, 2024
1 parent 6740a4e commit 285d885
Show file tree
Hide file tree
Showing 40 changed files with 64 additions and 61 deletions.
2 changes: 1 addition & 1 deletion benches/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::fmt::{Display, Formatter, Result};

use criterion::{criterion_group, criterion_main, Criterion};
use criterion::{Criterion, criterion_group, criterion_main};
use hypergraph::{HyperedgeIndex, Hypergraph, VertexIndex};
use itertools::Itertools;

Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/add_hyperedge.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/clear_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rayon::prelude::*;

use crate::{
bi_hash_map::BiHashMap, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexTrait,
HyperedgeTrait, Hypergraph, VertexTrait, bi_hash_map::BiHashMap, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/contract_hyperedge_vertices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use itertools::Itertools;
use rayon::prelude::*;

use crate::{
core::utils::are_slices_equal, errors::HypergraphError, HyperedgeIndex, HyperedgeTrait,
Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
core::utils::are_slices_equal, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/get_hyperedge.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/get_hyperedge_vertices.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/get_hyperedge_weight.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/get_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/get_hyperedges_connecting.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use rayon::prelude::*;

use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph,
VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/get_hyperedges_intersections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use itertools::Itertools;
use rayon::prelude::*;

use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/get_internal_hyperedge.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/get_internal_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/join_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rayon::prelude::*;

use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/remove_hyperedge.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/reverse_hyperedge.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
4 changes: 2 additions & 2 deletions src/core/hyperedges/update_hyperedge_vertices.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use rayon::prelude::*;

use crate::{
core::utils::are_slices_equal, errors::HypergraphError, HyperedgeIndex, HyperedgeKey,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
core::utils::are_slices_equal, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/hyperedges/update_hyperedge_weight.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait,
HyperedgeIndex, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/iterator.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait};
use crate::{HyperedgeKey, HyperedgeTrait, Hypergraph, VertexTrait, errors::HypergraphError};

impl<V, HE> IntoIterator for Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use itertools::Itertools;
use rayon::prelude::*;

use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError,
};

/// Enumeration of the different types of connection.
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/add_vertex.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
core::types::{AIndexSet, ARandomState},
errors::HypergraphError,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
4 changes: 2 additions & 2 deletions src/core/vertices/get_adjacent_vertices_from.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use rayon::prelude::*;

use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
4 changes: 2 additions & 2 deletions src/core/vertices/get_adjacent_vertices_to.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use rayon::prelude::*;

use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_dijkstra_connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
use rayon::prelude::*;

use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError,
};

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down
6 changes: 3 additions & 3 deletions src/core/vertices/get_full_adjacent_vertices_from.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use indexmap::IndexMap;
use itertools::{fold, Itertools};
use itertools::{Itertools, fold};

use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph,
VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

#[allow(clippy::type_complexity)]
Expand Down
6 changes: 3 additions & 3 deletions src/core/vertices/get_full_adjacent_vertices_to.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use indexmap::IndexMap;
use itertools::{fold, Itertools};
use itertools::{Itertools, fold};

use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph,
VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

#[allow(clippy::type_complexity)]
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_full_vertex_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_internal_vertex.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_internal_vertices.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_vertex.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
4 changes: 2 additions & 2 deletions src/core/vertices/get_vertex_degree_in.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
4 changes: 2 additions & 2 deletions src/core/vertices/get_vertex_degree_out.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
core::shared::Connection, errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex,
VertexTrait,
HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, core::shared::Connection,
errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_vertex_hyperedges.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use itertools::Itertools;

use crate::{
errors::HypergraphError, HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeIndex, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_vertex_weight.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/get_vertices.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rayon::prelude::*;

use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/remove_vertex.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rayon::prelude::*;

use crate::{
errors::HypergraphError, HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait,
HyperedgeKey, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError,
};

impl<V, HE> Hypergraph<V, HE>
Expand Down
2 changes: 1 addition & 1 deletion src/core/vertices/update_vertex_weight.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{errors::HypergraphError, HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait};
use crate::{HyperedgeTrait, Hypergraph, VertexIndex, VertexTrait, errors::HypergraphError};

impl<V, HE> Hypergraph<V, HE>
where
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_contraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mod common;

use common::{Hyperedge, Vertex};
use hypergraph::{errors::HypergraphError, HyperedgeIndex, Hypergraph, VertexIndex};
use hypergraph::{HyperedgeIndex, Hypergraph, VertexIndex, errors::HypergraphError};

#[test]
fn integration_contration() {
Expand Down
19 changes: 11 additions & 8 deletions tests/integration_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ fn integration_iterator() {
vec![
(hyperedge_one, vec![vertex_one, vertex_two, vertex_three]),
(hyperedge_two, vec![vertex_four, vertex_five]),
(
hyperedge_three,
vec![vertex_three, vertex_three, vertex_three]
),
(
hyperedge_four,
vec![vertex_five, vertex_four, vertex_three, vertex_one]
)
(hyperedge_three, vec![
vertex_three,
vertex_three,
vertex_three
]),
(hyperedge_four, vec![
vertex_five,
vertex_four,
vertex_three,
vertex_one
])
],
"should provide `into_iter()` yelding a vector of tuples of the form (hyperedge, vector of vertices)"
);
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mod common;

use common::{Hyperedge, Vertex};
use hypergraph::{errors::HypergraphError, Hypergraph};
use hypergraph::{Hypergraph, errors::HypergraphError};

#[test]
fn integration_contration() {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mod common;

use common::{Hyperedge, Vertex};
use hypergraph::{errors::HypergraphError, HyperedgeIndex, Hypergraph, VertexIndex};
use hypergraph::{HyperedgeIndex, Hypergraph, VertexIndex, errors::HypergraphError};

#[test]
fn integration_main() {
Expand Down

0 comments on commit 285d885

Please sign in to comment.