Skip to content

Remove fix of missing how data (fix #102) - #103

Merged
bart1 merged 6 commits into
mainfrom
102-cz-fails-for-alreading-existing-group
Aug 14, 2025
Merged

Remove fix of missing how data (fix #102)#103
bart1 merged 6 commits into
mainfrom
102-cz-fails-for-alreading-existing-group

Conversation

@bart1

@bart1 bart1 commented Aug 11, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@bart1 bart1 linked an issue Aug 11, 2025 that may be closed by this pull request
@bart1
bart1 requested a review from peterdesmet August 11, 2025 09:26
@bart1

bart1 commented Aug 11, 2025

Copy link
Copy Markdown
Collaborator Author

I added a few small changes to the test to this pull request as they mainly ensure they fail less often spuriously, and the failures are more clear

@bart1
bart1 marked this pull request as ready for review August 11, 2025 11:55
@peterdesmet
peterdesmet requested a review from PietrH August 11, 2025 12:50
@PietrH

PietrH commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

@bart1 I can get to this by the end of the week.

@bart1

bart1 commented Aug 11, 2025

Copy link
Copy Markdown
Collaborator Author

Prima ik denk dat dit ook de checks voor andere moet fixen dan dan moet die terug gemerged worden in #97

@bart1

bart1 commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator Author

As there is no historic data available the is no need to implement a conditional check if it needs to be added

@PietrH PietrH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Made some minor suggestions for using testthat expectations and for some clarification. Super small stuff, nice changes!

You can accept or ignore, and then merge. No need to resubmit for review for me :+1

Comment thread tests/testthat/test-get_pvol.R Outdated
dt_int <- lubridate::interval(time_utc, time_utc + lubridate::minutes(9))
suppressMessages(pvols <- getRad::get_pvol(c("KABR", "czska"), dt_int))
expect_true(is.list(pvols))
expect_gt(length(pvols), 2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could pvols ever have a length over 2? If not, expect_length()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Its a list of pvols in a 9 minute interval. In the US 2 pvols might be returned so that is why we use the greater then

Comment thread tests/testthat/test-get_pvol.R Outdated
Comment thread tests/testthat/test-get_pvol.R
Comment thread tests/testthat/test-get_pvol.R
expect_true(all(purrr::map_lgl(pvols, ~ inherits(.x, "pvol"))))
})

test_that("Caching of keys works", {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: I'm not the biggest fan of the system.time() based testing, there might be slowdowns on the test runner. I see why you skip this test on CRAN.

Is checking for the presence for the key in the cache not enough?

We could also use withr to set a local option to overwrite the default cache, and that way we'll be super certain both of cache location and that it starts as empty.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think test that is anyway run in a separate environment. I already check the files are not present now (see expect_false). I do the time based check to ensure the cache is actually used. I think this design should be pretty robust looking for a relative speed increase

Comment thread tests/testthat/test-get_pvol_us.R Outdated
small improvements

Co-authored-by: Pieter Huybrechts <48065851+PietrH@users.noreply.github.com>
@bart1
bart1 requested a review from PietrH August 14, 2025 08:33
@bart1

bart1 commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator Author

@PietrH once merges I will move this into the Sweden branch and also merge that one. I commited your suggestions.

@bart1
bart1 merged commit ddc0376 into main Aug 14, 2025
8 checks passed
@bart1
bart1 deleted the 102-cz-fails-for-alreading-existing-group branch August 14, 2025 08:52
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.

CZ fails for alreading existing group

2 participants