Error while generating DataFrame

It throws up an error when I try to generate a DataFrame from simobs.
The error reads:

InexactError: Int64(26.00019500146251)
in top-level scope at [untitled:48](#)
in DataFrame at [Pumas\y4yQI\src\models\simulated_observations.jl:35](#)
in #DataFrame#104 at [Pumas\y4yQI\src\models\simulated_observations.jl:83](#)
in push! at [DataFrames\S3ZFo\src\dataframe\dataframe.jl:1433](#)
in push! at [base\array.jl:868](#)
in convert at [base\number.jl:7](#)
in Int64 at [base\float.jl:709](#) 
  pk_13 = @model begin

      @param begin
        tvcl ∈ RealDomain(lower=0)
        tvvc ∈ RealDomain(lower=0)
        tvcld ∈ RealDomain(lower=0)
        tvvt ∈ RealDomain(lower=0)
        Ω ∈ PDiagDomain(4)
        σ_prop ∈ RealDomain(lower=0)
      end

      @random begin
        η ~ MvNormal(Ω)
      end

      @pre begin
        Cl = tvcl*exp(η[1])
        Vc = tvvc*exp(η[2])
        Cld = tvcld*exp(η[3])
        Vt = tvvt*exp(η[4])
      end

      @dynamics begin
        Central' = -(Cl/Vc)*Central -(Cld/Vc)*Central +(Cld/Vt)*Peripheral
        Peripheral' = (Cld/Vc)*Central -(Cld/Vt)*Peripheral
      end

      @derived begin
        cp = @. Central/Vc
        dv ~ @. Normal(cp, sqrt(cp^2*σ_prop))
      end
    end

    par = (tvcl = 0.344708, # L/min/kg
            tvvc = 2.8946, # L/kg
            tvcld = 0.178392, # L/min/kg
            tvvt = 2.18368, # L/kg
            Ω = Diagonal([0.0001, 0.0001, 0.0001, 0.0001]),
            σ_prop = 0.01)

    ev1 = DosageRegimen(400, time=0, cmt=1)
    ev2 = DosageRegimen(800, time=0, cmt=1, rate=30.769)
    com = DosageRegimen(ev1,ev2)
    sub = Subject(id=1, evs=com)
    sim = simobs(pk_13, sub, par, obstimes=[2, 5, 10, 15, 20, 25, 30, 33, 35, 37, 40, 45, 50, 60, 70, 90, 110, 120, 150])
    plot(sim)
    plot(sim, yaxis=:log)
    ddf = DataFrame(sim)

hi Parssh,

Can you try ddf = DataFrame(sim, include_events=false)

vijay

Thanks @vijay. Got it.

Your original version was supposed to work, so it’s a bug in Pumas. The issue is that obstimes are passed as integers but the event ends at a non-integer value.

Thanks @andreasnoack. That’s informative.