Skip to content

Avoid sparse dataframe step in generate_events #3635

@infotroph

Description

@infotroph

Comment by @infotroph in #3621 (comment) :

Seems overly complex to squish all event types together into one (pretty sparse) data frame and then pass them into a function full of type-specific logic (line 183 below) to reconstruct to the set of fields that were already present in the individual dataframes.

My instinct for heterogeneous collections like this would be to convert from df to list within each type (I think e.g. tillage |> pmap(list) would work), then concatenate the individual event objects and do the subsetting/sorting in list form.

It might also work to put all types in one tibble but nest the type-specific columns into a list-column so that you have something like (site_id, date, event_type, event_spec)

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