Skip to content

Info maps need "simulation_day" key for padding #2919

@morrowcj

Description

@morrowcj

After PR 2876 was merged, any output variables that might get reported via ReportGenerator are required to have a "simulation_day" key (indicating when the output was recorded) present in their info_map in order to be compatible with padding. Many output variables still do not meet this requirement.

Current Behavior

Because of the missing key, many report filters no longer work, producing errors like:

Image

and

Image

Expected Behavior

The following report filter (output/output_filters/report_all-variables.json) should create an output file with each output variable padded to all simulation days, without producing errors

{
  "multiple": [
    {
      "name": "All_Output",
      "filters": [
        ".*"
      ],
      "expand_data": true,
      "fill_value": ""
    }
  ]
}

Possible Solution

Add a reference to RufasTime.simulation_day to every output's info map, at the time it is recorded. Rather than manually editing each and every info map, it may be best to update OutputManager.add_variable and OutputManager.add_variable_bulk (and any other methods that add variables to the output pool) to update the variable info_map with this information automatically.

Context

Discussed in #2910

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingurgentThis is important!

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions