Skip to content

Error with TimeStepTable of one #144

Closed

Description

@VEZY

The error is ERROR: type Array has no field T. I think it is because we treat it as a one-timestep thing in run!(see "run.jl" line 176) because of this line:

nsteps = get_nsteps(meteo_adjusted)

Here is a reproducible example:

meteo = Weather([Atmosphere(T=20.0, Wind=1.0, P=101.3, Rh=0.65)])
ml =
    ModelList(
        Monteith(), Medlyn(0.3, 7.0),
        Fvcb(VcMaxRef=155.0, JMaxRef=266.0, RdRef=1.6, TPURef=7.0),
        status=(
            Rₛ=320.0, sky_fraction=0.20,
            aPPFD=700.0, d=0.10
        )
    )
run!(ml, meteo)

Activity

  1. added a commit that references this issue on Sep 23, 2025
    8658c77
  2. linked a pull request that will close this issueFix #144 and add to tests #156on Sep 23, 2025
  3. Samuel-amap commented on Sep 23, 2025

    @Samuel-amap
    Collaborator

    it looks like a corner-case that wasn't covered in the (fiddly and possibly questionable) changes to limit some type instability and dispatching in the run!function. The code meant to handle those situations can be found in adjust_weather_timesteps_to_given_length (in run.jl)

    It is also possible to produce the same error with a single-row dataframe (see example code below).

        df = CSV.read(joinpath(pkgdir(PlantSimEngine), "examples/meteo_day.csv"), DataFrame, header=18)
        meteo_single_row_df = DataFrame(df[1,:])

    Adding those two cases to the meteo bank used in test-simulation.jl.

  4. added a commit that references this issue on Sep 24, 2025
  5. added a commit that references this issue on Mar 18, 2026
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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions