Error Constant Interpolation Struct Array

Hi,

I am trying to run simulations. I am getting this error (the following code was running earlier in the previous version) which I am not sure of, the error is as below:

ERROR: TaskFailedException

    nested task error: type ConstantInterpolationStructArray has no field ts
    Stacktrace:
      [1] getproperty
        @ .\Base.jl:37 [inlined]
      [2] _covariate_adjust_events!!(::Nothing, covariates::Pumas.ConstantInterpolationStructArray{…})
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\simulate_methods\analytical.jl:178
      [3] _analytical_problem_events_and_times(events::Nothing, covariates::Pumas.ConstantInterpolationStructArray{…}, t0::Float64)
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\simulate_methods\analytical.jl:186
      [4] _build_analytical_problem(prob::Pumas.LinearODE, u0::StaticArraysCore.SVector{…}, tspan::Tuple{…}, events::Nothing, covariates::Pumas.ConstantInterpolationStructArray{…}, col::Pumas.NTWrapper{…})
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\simulate_methods\analytical.jl:199
      [5] _problem(prob::Pumas.LinearODE, u0::StaticArraysCore.SVector{…}, tspan::Tuple{…}, events::Nothing, covariates::Pumas.ConstantInterpolationStructArray{…}, col::Pumas.NTWrapper{…}; diffeq_options::@NamedTuple{…}, steadystate_options::@NamedTuple{})
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\simulate_methods\analytical.jl:57
      [6] _problem(model::PumasModel{…}, events::Nothing, covariates::Pumas.ConstantInterpolationStructArray{…}, obstimes::Vector{…}, col::Pumas.ConstantInterpolationStructArray{…}, ::Val{…}; diffeq_options::@NamedTuple{…}, steadystate_options::@NamedTuple{})
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1152
      [7] _simobs(::PumasModel{…}, ::Subject{…}, ::@NamedTuple{…}, ::Nothing; obstimes::Nothing, ensemblealg::EnsembleSerial, diffeq_options::@NamedTuple{…}, steadystate_options::@NamedTuple{}, rng::Xoshiro, simulate_error::Val{…}, isfor::Val{…})
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1475
      [8] _simobs_worker!(::Vector{…}, ::PumasModel{…}, ::Vector{…}, ::StaticArraysCore.SVector{…}, ::Nothing, ::Xoshiro, ::Vector{…}, ::EnsembleSerial; diffeq_options::@NamedTuple{…}, steadystate_options::@NamedTuple{}, isfor::Val{…}, simulate_error::Val{…}, obstimes::Nothing, return_model::Val{…}, iterstart::Int64, iterstop::Int64, outstart::Int64)
        @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:2179
      [9] _simobs_worker!
        @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:2140 [inlined]
     [10] macro expansion
        @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:2251 [inlined]
     [11] (::Pumas.var"#542#threadsfor_fun#358"{Pumas.var"#542#threadsfor_fun#357#359"{…}})(tid::Int64; onethread::Bool)
        @ Pumas .\threadingconstructs.jl:215
     [12] #542#threadsfor_fun
        @ .\threadingconstructs.jl:182 [inlined]
     [13] (::Base.Threads.var"#1#2"{Pumas.var"#542#threadsfor_fun#358"{Pumas.var"#542#threadsfor_fun#357#359"{…}}, Int64})()
        @ Base.Threads .\threadingconstructs.jl:154
Stacktrace:
  [1] threading_run(fun::Pumas.var"#542#threadsfor_fun#358"{Pumas.var"#542#threadsfor_fun#357#359"{…}}, static::Bool)
    @ Base.Threads .\threadingconstructs.jl:172
  [2] macro expansion
    @ .\threadingconstructs.jl:220 [inlined]
  [3] #_simobs_worker!#356
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:2248 [inlined]
  [4] _simobs_worker!
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:2220 [inlined]
  [5] #_simobs!#351
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1991 [inlined]
  [6] _simobs!
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1974 [inlined]
  [7] _simobs(::PumasModel{…}, ::Vector{…}, ::StaticArraysCore.SVector{…}, ::Nothing; rng::TaskLocalRNG, diffeq_options::@NamedTuple{}, steadystate_options::@NamedTuple{}, isfor::Val{…}, simulate_error::Val{…}, obstimes::Nothing, ensemblealg::EnsembleThreads)
    @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1952
  [8] _simobs
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1878 [inlined]
  [9] #simobs#344
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1763 [inlined]
 [10] simobs
    @ C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1747 [inlined]
 [11] simobs(model::PumasModel{…}, population::Vector{…}, param::@NamedTuple{…})
    @ Pumas C:\build\run\_work\PumasSystemImages\PumasSystemImages\julia_depot\packages\Pumas\aZRyj\src\models\model_api.jl:1747
 [12] top-level scope
    @ c:\Users\parsshava.mehta\UFL Dropbox\Parsshava Mehta\Julia Hub\Emergency\Amira\run1.jl:161
Some type information was truncated. Use `show(err)` to see complete types.

Attaching a snippet of the read_pumas and also the dataset. The simulation works without covariates but when I add covariates it fails and shows this error.

pd_data_6yrchild = read_pumas(pd_data_oral_baseline_6yrchild_df,
                                  id = :ID, 
                                  time = :TIME,
                                  observations = [:pH],
                                  covariates = [:TAD, :Conc],
                                  event_data = false)

   Row │ TIME     ID     Conc         TAD2   pH       TAD     
       │ Float64  Int64  Float64      Int64  Missing  Float64 
───────┼──────────────────────────────────────────────────────
     1 │     0.0      1     0.0           0  missing      0.0
     2 │     0.2      1   744.97          0  missing      0.2
     3 │     0.4      1  1043.37          0  missing      0.4
     4 │     0.6      1   969.14          0  missing      0.6
   ⋮   │    ⋮       ⋮         ⋮         ⋮       ⋮        ⋮
 96098 │   191.6    100     2.143e-7    168  missing     23.6
 96099 │   191.8    100     1.745e-7    168  missing     23.8
 96100 │   192.0    100     1.421e-7    192  missing      0.0

Can you please help me decode this. Thanks a lot.

Best,

Parssh

This is a bug in version 2.6.0 that was fixed in the latest patch release (2.6.1) which can be downloaded from PumasAI.

1 Like