Skip to content

Commit

Permalink
feat: impl Clone for demes::Graph and demes-forward::Graph
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed May 4, 2023
1 parent a02ad39 commit 05f6b9b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions demes-forward/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn apply_size_function(
}
}

#[derive(Debug)]
#[derive(Debug, Clone)]
struct Deme {
deme: demes::Deme,
status: DemeStatus,
Expand All @@ -151,7 +151,7 @@ struct Deme {
proportions: Vec<demes::Proportion>,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
enum DemeStatus {
/// Before the deme first appears.
/// (Moving forwards in time.)
Expand Down Expand Up @@ -306,7 +306,7 @@ fn update_demes(
}

/// Forward-time representation of a [`demes::Graph`].
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ForwardGraph {
graph: demes::Graph,
model_times: ModelTime,
Expand Down
2 changes: 1 addition & 1 deletion demes-forward/src/square_matrix.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct SquareMatrix {
data: Vec<f64>,
nrows: usize,
Expand Down
2 changes: 1 addition & 1 deletion demes-forward/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl Iterator for TimeIterator {
}
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ModelTime {
#[allow(dead_code)]
model_start_time: demes::Time,
Expand Down
2 changes: 1 addition & 1 deletion demes/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2634,7 +2634,7 @@ impl UnresolvedGraph {
/// * [`load`](crate::load)
/// * [`loads`](crate::loads)
/// * [`GraphBuilder`](crate::GraphBuilder)
#[derive(Serialize, Debug)]
#[derive(Serialize, Debug, Clone)]
#[serde(deny_unknown_fields, try_from = "UnresolvedGraph")]
pub struct Graph {
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 05f6b9b

Please sign in to comment.