Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: impl Clone for demes::Graph and demes-forward::Graph #281

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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