Skip to content

Remove trait filters made redundant by traits.build#311 - #886

Merged
ehwenk merged 1 commit into
developfrom
remove-long-trait-filters
Oct 23, 2026
Merged

ehwenk merged 1 commit into
developfrom
remove-long-trait-filters

Conversation

@ehwenk

@ehwenk ehwenk commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

With traitecoevo/traits.build#311, dataset_test() no longer fails a long-format dataset whose trait column holds traits with no traits entry; the build has always left those rows out. Six datasets filtered their trait column in custom_R_code only to avoid that failure. This removes those filters.

Dataset Change
Bell_1995, Bignell_1997 custom_R_code was only the filter; now .na
Johnson_1980, Saunders_2024 filter removed; the rest of the code stays
Steart_2009 the trait %in% condition removed; the source_id filter stays
NHNSW_2024 filter(!trait_name %in% c("leaf_lamina_division")) removed (that trait isn't mapped)

Verified: each dataset builds identical traits, excluded_data, contexts, locations and methods with and without its filter, and dataset_test() reports the same failures (0 for all but NHNSW_2024, which has 1 either way).

Kept, because they aren't redundant:

  • Judd_1996, Wirthensohn_1998 and Portelli_2023 filter out traits that are mapped: removing them adds 500, 82 and 725 values. Those are content decisions.
  • Maslin_2012's last filter keeps raw longevity rows out, and longevity is mapped.
  • Hallam_1970: removing the filter builds identically, but dataset_test() then fails its context check, because the unmapped rows carry a context value (leaf phase: intermediate) not in contexts. That check looks at every row of the data, including rows the build drops.
  • ANBG_2019's and Portelli_2023's other trait filters feed reshaping steps.

Merge after traitecoevo/traits.build#311: without it, Bell_1995, Bignell_1997, Johnson_1980, Saunders_2024 and Steart_2009 fail dataset_test() on their unmapped traits.

🤖 Generated with Claude Code

Six long-format datasets filtered their trait column in custom_R_code
only to keep dataset_test() from failing on traits with no `traits`
entry. With traitecoevo/traits.build#311 the build and the test both
leave those rows out, so the filters do nothing: each dataset builds
identical traits, excluded_data, contexts, locations and methods, and
dataset_test() reports the same failures, with and without them.
Steart_2009 keeps its source_id filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ehwenk
ehwenk merged commit c0285dc into develop Oct 23, 2026
1 check passed
@ehwenk
ehwenk deleted the remove-long-trait-filters branch October 23, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant