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

Bugfix for join_locations #140

Merged
merged 65 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
64db845
Trying out map for tests
fontikar Jan 12, 2023
7704303
Added version number to austraits_list_post
fontikar Jan 12, 2023
5e2e6a2
Added Wright_2019 in old rel test dataset so tests are consistent
fontikar Jan 12, 2023
426fc4d
Updated code to subset 4.0.0 from zenodo
fontikar Jan 12, 2023
b677567
Version testing for extract, and summarise_austriats
fontikar Jan 12, 2023
c2008c5
Combined extract_ tests and added version testing
fontikar Jan 12, 2023
5e47cfb
Version tests for join_
fontikar Jan 13, 2023
c0781b5
Version tests for widetable and renamed test files
fontikar Jan 13, 2023
50154e1
#60 fixed imports for pivot_wider, organised tests, currently not wor…
fontikar Jan 13, 2023
247db43
Minor naming adjustments in test
fontikar Jan 13, 2023
2b79ab5
Merge branch 'multi_tests' into develop: All possible tests is run th…
fontikar Jan 13, 2023
82a0f0f
Change some dependencies to imports
dfalster Jan 25, 2023
6e0cb08
Remove helper functions to vignettes
dfalster Jan 25, 2023
8f79aa6
Update deprecated functions
dfalster Jan 25, 2023
30d95cc
Restructure tests to run faster
dfalster Jan 25, 2023
9615ed0
Change GH actions triggers
dfalster Jan 25, 2023
87bdb95
ensure consistent ordering of rows
dfalster Jan 25, 2023
846ba84
Merge branch 'master' into develop
fontikar Oct 16, 2023
3564de0
bumped version number
fontikar Oct 16, 2023
4a534bf
Update to work with latest zenodo API (#81)
dfalster Oct 16, 2023
17de18c
Pulled files we want to develop from change-v5
fontikar Oct 19, 2023
f9c1666
Changes for v5 austraits.build (#78)
fontikar Nov 21, 2023
10791de
Bumped version number and updated news
fontikar Nov 21, 2023
32e5262
Added references to packages
fontikar Nov 21, 2023
a64a360
Updated version for GH steps
fontikar Nov 21, 2023
23a2f7a
Updated v number for GHA
fontikar Nov 21, 2023
147030b
Expanding testing suite to all 3 major versions of AusTraits (#86)
fontikar Nov 22, 2023
2bd66f1
Added codecov yml
fontikar Nov 22, 2023
cc8e8cf
Merge branch 'develop' of https://github.com/traitecoevo/austraits in…
fontikar Nov 22, 2023
d1c6f61
Setting limit for patch cov
fontikar Nov 22, 2023
91c94c4
Merge branch 'master' into develop
fontikar Nov 26, 2023
a541663
bumped version number for dev
fontikar Nov 26, 2023
277a7e5
API related packages to Suggests (#89)
fontikar Nov 27, 2023
9360930
Merge branch 'master' into develop
fontikar Sep 3, 2024
9d32105
Bumped version number
fontikar Sep 3, 2024
6928738
create new function `check_compatibility` (#95)
ehwenk Sep 4, 2024
4df279b
A generalised solution to deprecate `switch` functions (#100)
fontikar Sep 9, 2024
1c10ad1
Mass removal of version switches (#102)
fontikar Sep 12, 2024
20ced9a
Update documentation (#103)
ehwenk Sep 13, 2024
16d932d
Add `database_create_combined_table` & revise `join_` functions (#104)
ehwenk Sep 26, 2024
fdaf6bb
Create generalised `extract_data` function (#117)
ehwenk Nov 12, 2024
70e7671
Renaming files and parameters (#119)
ehwenk Nov 13, 2024
09f96f2
Extract from single table only (#121)
ehwenk Nov 13, 2024
f16e41e
Updating print function and messaging style (#122)
fontikar Nov 14, 2024
9e11eb3
function fixes (#124)
ehwenk Nov 14, 2024
1ca432f
Minor fixes to print.traits.build (#127)
fontikar Nov 15, 2024
7192f3d
Remove function `summarise_trait_means` (#125)
ehwenk Nov 15, 2024
a0d902c
Update bind_databases.R (#129)
ehwenk Nov 16, 2024
0c9f8a7
Updated documentation and website for austraits 3.0.0 (#130)
fontikar Nov 17, 2024
80d561d
Bumped version number and final fixes in documentation to pass R CMD …
fontikar Nov 17, 2024
c734d8f
Added cheatsheet and thumbnails in README
fontikar Nov 18, 2024
82c2a5d
Added cheatsheet and thumbnails in README
fontikar Nov 18, 2024
be0b883
Updated gitignore
fontikar Nov 18, 2024
f379fff
Minor testing patch in prep for austraits 3.0.0 (#133)
fontikar Nov 18, 2024
32b5177
additional tests (#132)
ehwenk Nov 18, 2024
b8feb6d
Fill some gaps in testing (#134)
dfalster Nov 18, 2024
1f5f4de
Function to test database structure (#135)
ehwenk Nov 19, 2024
a1f0c15
Bumped version number
fontikar Nov 19, 2024
f0858dc
Add missing cheatsheet (#136)
fontikar Nov 19, 2024
9100963
Reverted version number
fontikar Nov 19, 2024
d6c2a6c
Merge branch 'master' into develop
dfalster Nov 19, 2024
6b2b475
Merge branch 'master' into develop
fontikar Nov 20, 2024
076fbe6
Bumped version number
fontikar Nov 20, 2024
0dae262
bug fix - join_location_properties, separate_trait_values (#138)
ehwenk Nov 22, 2024
d5c5f06
Bump version (3.0.1)
dfalster Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: austraits
Title: Helpful functions to access the AusTraits database and wrangle data from other traits.build databases
Version: 3.0.0
Version: 3.0.1
Authors@R:
c(person(given = "Daniel",
family = "Falster",
Expand Down
2 changes: 1 addition & 1 deletion R/join_.R
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ join_location_properties <- function(database,

compacted_locations_column <-
locations %>%
tidyr::nest(data = -dplyr::all_of(c("dataset_id", "location_id"))) %>%
tidyr::nest(data = -dplyr::all_of(c("dataset_id", "location_id", "location_name"))) %>%
dplyr::mutate(location_properties = purrr::map_chr(data, jsonlite::toJSON)) %>%
dplyr::select(-dplyr::any_of("data")) %>%
dplyr::ungroup()
Expand Down
2 changes: 1 addition & 1 deletion R/separate_trait_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ separate_trait_values <- function(trait_data, definitions) {
dplyr::bind_rows(out_1, out_2) %>%
dplyr::select(-n_vals) %>%
dplyr::mutate(replicates = clean_NA(replicates),
value_type = factor(clean_NA(value_type), levels = names(definitions$definitions$value_type$values))
value_type = clean_NA(value_type)
) %>%
dplyr::arrange(observation_id, trait_name, value_type)
}
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-flatten_database.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ test_that("`flatten_database` defaults to `single_column_pretty` for contributor
expect_equal(combined_table_3a$data_contributors, combined_table_3b$data_contributors)
})

test_that("`flatten_database` is working with format = single_column_json", {
expect_no_error(combined_table_json <- flatten_database(database_2, format = "single_column_json"))
expect_contains(names(combined_table_json), "location_name")
expect_length(combined_table_json, 66)
expect_true(stringr::str_detect(combined_table_json$location_properties[1], "^\\[\\{"))
expect_true(stringr::str_detect(combined_table_json$data_contributors[1], "^\\[\\{"))
})

test_that("`flatten_database` is working with format = many_columns", {
expect_no_error(combined_table_many <- flatten_database(database_2, format = "many_columns"))
expect_contains(names(combined_table_many), "location_name")
expect_contains(names(combined_table_many), "temporal_context: sampling season")
})

# test that join_location_coordinates works as intended

database_no_coord <- austraits_5.0.0_lite %>% extract_dataset("Kooyman_2011")
Expand Down
Loading