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

refactor check_tbl_col_ascending #190

Merged
merged 13 commits into from
Jan 17, 2025
Merged

Conversation

zkamvar
Copy link
Member

@zkamvar zkamvar commented Jan 10, 2025

In #105, I had implemented a sorting method for the check_tbl_col_ascending() function that involved using an expanded model grid subset to the cdf and quantile output types to sort the submission table. As pointed out by @annakrystalli, there were two problems:

  1. I had neglected to pass derived_task_ids to the function
  2. my implementation was inefficient because I used bind_model_tasks = TRUE

While I was looking at this for refactoring, I found that I had re-invented the function to sort the table by output type ID and the task IDs: match_tbl_to_model_task().

Happily, this speeds up the process quite a bit and allows me to delete code!

This will fix #189

EDIT: huge thanks to @annakrystalli for implementing the correct solution and better tests for derived task IDs

@zkamvar zkamvar changed the title add argument to check_tbl_col_ascending add derived_task_ids argument to check_tbl_col_ascending Jan 10, 2025
Copy link

github-actions bot commented Jan 10, 2025

While I was looking at this for refactoring, I found that I had
re-invented the function to sort the table by output type ID and the
task IDs: `match_tbl_to_model_task()`.

Happily, this speeds up the process quite a bit _and_ allows me to delete code!
@zkamvar zkamvar changed the title add derived_task_ids argument to check_tbl_col_ascending refactor argument to check_tbl_col_ascending Jan 11, 2025
@zkamvar zkamvar changed the title refactor argument to check_tbl_col_ascending refactor check_tbl_col_ascending Jan 11, 2025
@zkamvar zkamvar requested a review from annakrystalli January 11, 2025 00:56
@annakrystalli
Copy link
Member

Thanks for implementing this so quickly!

Instead of a review, as there were quite a few changes I wanted to propose, I went ahed and made a PR instead here: #191

Copy link
Member

@annakrystalli annakrystalli left a comment

Choose a reason for hiding this comment

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

See #191

annakrystalli and others added 3 commits January 13, 2025 15:05
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.
@zkamvar zkamvar requested a review from elray1 January 15, 2025 16:20
@zkamvar zkamvar dismissed annakrystalli’s stale review January 15, 2025 16:22

Dismissing this review because I have merged #191, which was presented in lieu of review, so the requested changes have been merged. The only further change I made was in 3ec3793, which modifies a variable name for clarity.

@annakrystalli annakrystalli self-requested a review January 17, 2025 13:20
Copy link
Member

@annakrystalli annakrystalli left a comment

Choose a reason for hiding this comment

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

The final commit looks good to me! Approved on my end

@zkamvar zkamvar merged commit 098b4e5 into main Jan 17, 2025
8 checks passed
@zkamvar zkamvar deleted the znk/check-derived-task-ids/189 branch January 17, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

refactor check_tbl_vals_cols_ascending(): add derived task IDs and improve performance
2 participants