EOGrady21 / vprr

Video Plankton Recorder Data Processing
https://eogrady21.github.io/vprr/
Other
2 stars 1 forks source link

vpr_roi_concentration #15

Closed EOGrady21 closed 4 years ago

EOGrady21 commented 4 years ago

When running Travis CI build checks, vpr_roi_concentration continues to throws errors.

Whenever the function is run, both in create_sample_data and in the function documentation example, as well as the testthat filetest_bin_calculate. The result is this error

taxa_conc_n <- vpr_roi_concentration(ctd_roi_merge, taxas_list,
+ station_of_interest, binSize, imageVolume)
[1] "Removed bins at 7.5"  "Removed bins at 12.5" "Removed bins at 17.5"
[4] "Removed bins at 22.5" "Removed bins at 27.5" "Removed bins at 32.5"
[7] "Removed bins at 37.5" "Removed bins at 42.5" "Removed bins at 47.5"
[1] "Removed bins at 10.5"

This error cannot be reproduced locally, everything seems to run fine on my machine. The only possibility in my mind is that somehow the data being run in the remote is different somehow?

Currently solving the issue by removing the line from create_sample_data and using\dontrun{} on the example for vpr_roi_concentration however this is not a long term solution.

EOGrady21 commented 4 years ago

Bug solved!!

Source was traced back to bin_calculate code. Due to small sample size of example data, casts were being split into very small sections (smaller than binSize) which was throwing errors in calculations.

Cast splitting with example data

Inserted a workaround within bin_calculate that skips a cast section if the total differen in depth of the cast section is less than the size of bins.