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

Ak/check derived task ids/189 #191

Merged
merged 7 commits into from
Jan 15, 2025

Conversation

annakrystalli
Copy link
Member

Instead of reviewing I've just gone ahead and made a PR with my suggestions.

This PR build on #190 but introduces the following changes:

  • Instead of converting all but the value column to character, it expects an all character tbl and converts just the value column to numeric. This is how the original test was setup and the conversion of value to numeric was already happening in check_values_ascending() on the subset of relevant rows for the check.
  • I've updated the function documentation to reflect the above input change.
  • To avoid unnecessary computations, I've taken the output types to check from the tbl itself instead of the config. That way we do not spend time creating expanded grids for optional output types in the config that do not exist in the data.
  • I also went ahead and split the check by output type for maximum memory efficiency.
  • I reverted the input to the check in validate_model_data() to be the tbl_chr version of the data. This exists in the function environment as a number of checks depend on the all character version of the model output data.
  • I corrected the tests to reflect this input expectation. I also removed unnecessary hubValidations namespace specifications
  • I added a test that checks derived task IDs are indeed ignored.

I've tested locally and all tests pass but will be good to run the tests in your PR once merged in before merging into main

@annakrystalli annakrystalli requested a review from zkamvar January 13, 2025 13:13
Copy link
Member

@zkamvar zkamvar left a comment

Choose a reason for hiding this comment

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

Thank you for the improvements, Anna! It all looks good with two things that can be tweaked:

  1. the value column still needs to be converted to numeric
  2. replacing a map over a single-element list with calling the function directly (see comment)

Additionally, should the function signature for check_tbl_value_col_ascending() be tbl_chr instead of tbl so that it's clear it expects a character-only tbl?

R/check_tbl_value_col_ascending.R Show resolved Hide resolved
R/match_tbl_to_model_task.R Show resolved Hide resolved
R/check_tbl_value_col_ascending.R Show resolved Hide resolved
@annakrystalli
Copy link
Member Author

annakrystalli commented Jan 15, 2025

Additionally, should the function signature for check_tbl_value_col_ascending() be tbl_chr instead of tbl so that it's clear it expects a character-only tbl?

This is a good idea but should be applied throughout on all functions that require tbl_chr. For now we have it in the documentation of check_tbl_value_col_ascending() that this is the required input to tbl so best to just open a new issue to change tbl to tbl_chr on all affected check functions.

@zkamvar zkamvar merged commit ecbb912 into znk/check-derived-task-ids/189 Jan 15, 2025
@zkamvar zkamvar deleted the ak/check-derived-task-ids/189 branch January 15, 2025 15:58
zkamvar added a commit that referenced this pull request Jan 15, 2025
As explained in
#191 (comment),

> match_tbl_to_model_task() outputs a list element per model task,
> not output type.

In hindsight, this makes sense, but the original variable name of
`output_type_tbls` made me think that each list element was an output
type (see
#191 (comment)).

Changing the `output_type_tbls` variable name to `model_task_tbls`
reduces the cognitive load because now I understand that each element
represents a model task (which is NULL if the output type does not exist
for the model task), and in this function, there is only ever one output
type.
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.

2 participants