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

vimc-6490: Save intermediate files out in qs format #21

Merged
merged 9 commits into from Jun 29, 2022
Merged

Conversation

r-ash
Copy link
Contributor

@r-ash r-ash commented Jun 1, 2022

So that read & writes are quicker

Also means we can remove some of the logic which checks row formatting when we read the file back in.

1 question about this - is the csv format useful? Will researchers ever get this file locally and look at it in excel? Or will they always load it into R to explore it? If the latter qs seems like a good choice, if the first maybe keeping the file as csv makes sense

@codecov
Copy link

codecov bot commented Jun 1, 2022

Codecov Report

Merging #21 (d5887de) into master (724c4c9) will decrease coverage by 0.24%.
The diff coverage is 88.63%.

❗ Current head d5887de differs from pull request most recent head 71117a8. Consider uploading reports for the commit 71117a8 to get more accurate results

@@             Coverage Diff             @@
##            master      #21      +/-   ##
===========================================
- Coverage   100.00%   99.75%   -0.25%     
===========================================
  Files           19       19              
  Lines         2047     2063      +16     
===========================================
+ Hits          2047     2058      +11     
- Misses           0        5       +5     
Impacted Files Coverage Δ
R/stochastic_upload.R 95.23% <83.87%> (-4.77%) ⬇️
R/dalys.R 100.00% <100.00%> (ø)
R/stochastic_process.R 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 724c4c9...71117a8. Read the comment docs.

Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

LGTM. I vote for no csv

new_csv_file <- tempfile(fileext = ".csv")
write.csv(x = result$cal, file = new_csv_file,
row.names = FALSE)
new_csv_file <- tempfile(fileext = ".qs")
Copy link
Member

Choose a reason for hiding this comment

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

new_qs_file ?

@r-ash
Copy link
Contributor Author

r-ash commented Jun 23, 2022

Made a further update to support running stochastic upload with both qs files and csv files (for supporting re-uploading old outputs should we need to tear down annex at some point)

if (type == "csv") {
read_stochastic_csv(file, is_cohort)
} else if (type == "qs") {
read <-read_stochastic_qs(file, is_cohort)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the read <- intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah no, good spot

@r-ash r-ash merged commit 6e8a755 into master Jun 29, 2022
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.

None yet

3 participants