Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dataset tests #143

Merged
merged 12 commits into from
Nov 30, 2023
Merged

Add dataset tests #143

merged 12 commits into from
Nov 30, 2023

Conversation

yangsophieee
Copy link
Collaborator

@yangsophieee yangsophieee commented Nov 24, 2023

Fixes #141

  • Check units are found in the unit conversions file (I know this is addressed by the new dataset_check functions but I thought this would be good as a dataset test, not sure what you think @ehwenk)?
  • Also added checks for duplicate trait var_in and duplicate context var_in and context_property

@yangsophieee yangsophieee requested a review from ehwenk November 24, 2023 03:16
R/testdata.R Show resolved Hide resolved
R/process.R Outdated Show resolved Hide resolved
R/setup.R Outdated Show resolved Hide resolved
R/testdata.R Outdated Show resolved Hide resolved
@ehwenk
Copy link
Collaborator

ehwenk commented Nov 29, 2023

  • Check units are found in the unit conversions file (I know this is address by the new dataset_check functions but I thought this would be good as a dataset test, not sure what you think @ehwenk)?

@yangsophieee I think it is fine as a dataset_check function. I do know that there has been the occasional study where it took us a long time (after datasets were merged into develop) to properly work out units for the occasional trait. Adding this as a test, effectively means Missing unit conversion will never actually be a reason for being in excluded data because tests won't allow that. But let's leave it for now and if it becomes a problem we can comment it out.

@yangsophieee yangsophieee marked this pull request as ready for review November 30, 2023 03:48
@yangsophieee yangsophieee requested a review from ehwenk November 30, 2023 03:49
Copy link
Collaborator

@ehwenk ehwenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the requested changes. Can you put the note about the possible problem with the units test in the commit message, so we see it quickly in the future?

@yangsophieee yangsophieee merged commit c903660 into develop Nov 30, 2023
3 checks passed
@yangsophieee yangsophieee deleted the add_dataset_tests branch November 30, 2023 07:07
ehwenk added a commit that referenced this pull request Dec 17, 2024
* a few bug fixes, identified in part by @hrlai - further mismatches to function names,  functions that are now in `austraits` were still listed in `_pkgdown.yml`
* another issue uncovered by @hrlai indicated we really needed to run dataset_test on the traits.build example datasets: * added dataset_test for example datasets - includes allowing "output" folders and Readme files in data folders

closes issue #183
closes issue #185
closes issue #143
ehwenk added a commit that referenced this pull request Dec 19, 2024
-    traits.build paper published in Sep 2024 in Ecological Informatics (DOI: 10.1016/j.ecoinf.2024.102773)
-    Minor updates to ontology, which is now version 1.0.0
-    Added standard error and standard deviation as value types
    Moved functions to austraits package and made austraits package a dependancy
    Renamed some of the functions that are now moved to austraits package
        bind_databases <-- build_combine
        convert_df_to_list <-- util_df_to_list
        convert_list_to_df1 <-- util_list_to_df1
        convert_list_to_df2 <-- util_list_to_df2
    Renamed functions still also assigned their old name, with a deprecation warning indicating the new name
    plot_trait_distribution_beeswarm, trait_pivot_longer and trait_pivot_wider had been in both austraits and traits.build packages and have now been removed from traits.build
    Import new austraits function flatten_database (had been suggested to be database_create_combined_table)
    Refactoring of test functions used by dataset_test
    Added tests using the dataset_test function, so it is checked explicitly by traits.build (run on Example datasets)
    Minor bug fixes

Issues addressed since last traits.build release:

Issue #150 & Issue #154 (error if no contexts)
Issue #179 (incorrect test written that flagged an error if input/output units identical)
Issue #171 (SE required as a value type)
Issue #131 (remove duplicate functions)
Issue #183 (deprecated function still being used)
Issue #185 (context table columns mis-ordered, dataset test failing)
Issue #143 (add dataset_test tests)
---------

Co-authored-by: Daniel Falster <[email protected]>
Co-authored-by: Fonti Kar <[email protected]>
Co-authored-by: Sophie Yang <[email protected]>
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.

Add test for checking units in metadata are correct/in the unit_conversions file
3 participants