Skip to content

Add time interval to mutate() #508

Closed

Description

@jeromekelleher

Based on idea from @molpopgen. See also #507.

It is useful to specify a time interval over which mutations are generated. This should include an upper and lower bound. One way we could parameterise this is:

def mutate(ts,..., interval=None...):
     if interval is None:
          interval =  None, None
     start, end = interval
     if start is None:
        start = 0
     if end is None:
         end = sys.float.max  # whatever the notation for DBL_MAX is
     # Now generate mutations between from time start to end

Or we could have

def mutate(ts,..., start=None, end=None,...):
      if start is None:
        start = 0
     if end is None:
         end = sys.float.max  # whatever the notation for DBL_MAX is
     # Now generate mutations between from time start to end

start and end don't feel like quite the right names for the parameter though. interval is also a bad idea as this is used for trees to denote the genomic range they cover. Any better ideas would be very welcome!

Activity

  1. added this to the Release 0.6.1 milestone on Jun 5, 2018
  2. hyanwong commented on Jun 8, 2018

    @hyanwong
    Member

    time_interval or timespan might be better?

  3. molpopgen commented on Jun 8, 2018

    @molpopgen
    Member

    @hyanwong makes a good suggestion. Other possibilities include epoch, era, etc.

  4. jeromekelleher commented on Aug 1, 2018

    @jeromekelleher
    MemberAuthor

    For symmetry with the rest of the API (see #541), these should be called start_time and end_time, and be half open (started included, end excluded).

  5. added 2 commits that reference this issue on Aug 22, 2018
    899f181
    9ab030a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions