Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #599 +/- ##
=======================================
Coverage 99.81% 99.81%
=======================================
Files 5 5
Lines 1600 1619 +19
=======================================
+ Hits 1597 1616 +19
Misses 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Does this need to convert into generations first? I reckon it does the wrong thing when Will effectively produce times in graph3 multiplied by |
|
Doesn't this also do the wrong thing when I think in this case it would be better to just |
777e5c3 to
5f3db35
Compare
|
I think I got both of your questions answered. Unfortunately, the current tests were invariant to the current vs the previous implementation, implying that they are poor tests. I'll add a double-convert test like you mentioned... |
|
The test still looks very fragile to me. There's nothing here checking that the times or the units have actually changed. For instance, one can just delete most of the code in change_time_units() and the tests still pass. diff --git a/demes/demes.py b/demes/demes.py
index d965a7d..1db085a 100644
--- a/demes/demes.py
+++ b/demes/demes.py
@@ -2017,19 +2017,6 @@ class Graph:
raise ValueError(f"generation time must be 1, got {generation_time}")
return graph
- for deme in graph.demes:
- deme.start_time *= generation_time
- for epoch in deme.epochs:
- epoch.start_time *= generation_time
- epoch.end_time *= generation_time
- for migration in graph.migrations:
- migration.start_time *= generation_time
- migration.end_time *= generation_time
- for pulse in graph.pulses:
- pulse.time *= generation_time
- graph.time_units = time_units
- graph.generation_time = generation_time
-
return graph
def rename_demes(self, names: Mapping[str, str]) -> Graph: |
Closes #574