@@ -937,6 +937,7 @@ def date(
937
937
time_units = None ,
938
938
priors = None ,
939
939
* ,
940
+ Ne = None ,
940
941
return_posteriors = None ,
941
942
progress = False ,
942
943
** kwargs ,
@@ -966,12 +967,12 @@ def date(
966
967
967
968
:param TreeSequence tree_sequence: The input :class:`tskit.TreeSequence`, treated as
968
969
one whose non-sample nodes are undated.
969
- :param float population_size: The estimated (diploid) effective population
970
- size used to construct the (default) conditional coalescent prior. This may
971
- be a single value, or a two-column array of epoch breakpoints and effective
972
- population sizes within epochs. These are used when ``priors`` is ``None``.
973
- Conversely, if ``priors`` is not ``None``, no ``population_size`` value
974
- should be given.
970
+ :param PopulationSizeHistory population_size: The estimated (diploid) effective
971
+ population size used to construct the (default) conditional coalescent
972
+ prior. This may be a single value (for a population with constant size), or
973
+ a :class:`PopulationSizeHistory` object (for a population with time-varying
974
+ size). This is used when ``priors`` is ``None``. Conversely, if ``priors``
975
+ is not ``None``, no ``population_size`` value should be given.
975
976
:param float mutation_rate: The estimated mutation rate per unit of genome per
976
977
unit time. If provided, the dating algorithm will use a mutation rate clock to
977
978
help estimate node dates. Default: ``None``
@@ -1009,13 +1010,25 @@ def date(
1009
1010
Ignoring outside root provides greater stability when dating tree sequences
1010
1011
inferred from real data. Default: False
1011
1012
:param bool progress: Whether to display a progress bar. Default: False
1013
+ :param float Ne: the estimated (diploid) effective population size used to
1014
+ construct the (default) conditional coalescent prior. This is used when
1015
+ ``priors`` is ``None``. Conversely, if ``priors`` is not ``None``, no
1016
+ ``population_size`` value should be given. (Deprecated, use the
1017
+ ``population_size`` argument instead).
1012
1018
:return: A copy of the input tree sequence but with altered node times, or (if
1013
1019
``return_posteriors`` is True) a tuple of that tree sequence plus a dictionary
1014
1020
of posterior probabilities from the "inside_outside" estimation ``method``.
1015
1021
:rtype: tskit.TreeSequence or (tskit.TreeSequence, dict)
1016
1022
"""
1017
1023
if time_units is None :
1018
1024
time_units = "generations"
1025
+ if Ne is not None :
1026
+ if population_size is not None :
1027
+ raise ValueError (
1028
+ "Only one of Ne (deprecated) or population_size may be specified"
1029
+ )
1030
+ else :
1031
+ population_size = Ne
1019
1032
tree_sequence , dates , posteriors , timepoints , eps , nds = get_dates (
1020
1033
tree_sequence ,
1021
1034
population_size = population_size ,
0 commit comments