PoonLab / twt

Generic framework for the coalescent simulation of pathogen trees within host trees in R
GNU Affero General Public License v3.0
3 stars 2 forks source link

InitialConditions:originTime must be numeric #74

Closed davidchampredon closed 5 years ago

davidchampredon commented 5 years ago

Pulling 793de055f7693e461bd7bf10b0681b8fe721a80c and changing the YAML input file accordingly, that is:

# OLD CODE:
# OriginTimes:
#   'virus':
#     start: 2783
#     susceptibles:
#       - host: 1705

InitialConditions:
  origin: 2783  # note this is reverse time, cumulative
  size:
    host: 1705  # number of susceptible at the origin time of the simulation for Type `host`
  index: 'host'

When calling

settings <- yaml.load_file(PATH_TO_YAML)
MODEL$new(settings)

I have this error msg:

Error in private$load.initial.conds(settings) : 
  InitialConditions:originTime must be numeric; is this key missing?
Called from: private$load.initial.conds(settings)

I suspect that in function private$load.initial.conds the list element is not correctly named, i.e., we have params$origin instead of params$originTime. Not 100% though, so I let @ArtPoon check this.

ArtPoon commented 5 years ago

Yeah I'm in the middle of refactoring stuff, so everything is broken - muahahaha!