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

Fix time data types in contexts getting reformatted #88

Merged
merged 51 commits into from
Oct 12, 2023

Conversation

yangsophieee
Copy link
Collaborator

Addresses #49

  • Time data types are getting reformatted with read_csv, because it detects the column data type when reading in, such that e.g. "9:00:00" becomes "09:00:00". This is not too much of an issue if it's consistent with the output of metadata_add_contexts and process.R. However, metadata_add_contexts was rewriting "09:00:00" as total number of seconds: "32400.0"
  • I've fixed it so that context values are character type so that as.yaml in write_metadata does not convert times to number of seconds
  • See this comment about the rewriting from "9:00:00" to "09:00:00" (I've added a note to the user when time data types get reformatted)
  • Also added a fix for some of issue [traits.build workflow] Add "time" category of traits, in addition to "categorical" and "numeric"? #87, where substitutions for time variables (e.g. flowering_time, fruiting_time) fail dataset_test

ehwenk and others added 30 commits September 16, 2023 19:28
* Gets added to metadata files, where the default is set to false (otherwise this will mask the need for contexts to pivot)
* Not yet tested in process.R- waiting to merge in other branches first
- repeat_measurements_id is now a column of NA's in austraits$traits
- however, don't have it working to be triggered at either the dataset or trait level
- in schema
- at this point need to change line ` i <- !is.na(data$value) & !is.na(data$repeat_measurements_id)` (or elsewhere) to have it recognise when `repeat_measurements_id: TRUE` (or `y`) is added to either metadata$dataset or specific traits in metadata
- Set `repeat_measurements_id` to TRUE in the metadata
@yangsophieee
Copy link
Collaborator Author

@dfalster This is ready for review :) Thank you!

@yangsophieee yangsophieee merged commit 96b6abc into develop Oct 12, 2023
3 checks passed
@yangsophieee yangsophieee deleted the time_data_types branch October 12, 2023 07:02
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.

3 participants