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

Add qhull_warnings() function #42

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add qhull_warnings() function #42

wants to merge 1 commit into from

Conversation

Bisaloo
Copy link
Collaborator

@Bisaloo Bisaloo commented Aug 5, 2021

Fix #38.

To do:

  • Add documentation for qhull_warnings()
  • Add tests

@Bisaloo Bisaloo changed the title Add needed tests: no errors with sites with no sp. Add qhull_warnings() function Aug 5, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2021

Codecov Report

Merging #42 (c5c5b0c) into main (638a469) will decrease coverage by 4.49%.
The diff coverage is 38.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
- Coverage   97.26%   92.76%   -4.50%     
==========================================
  Files          12       13       +1     
  Lines         219      235      +16     
==========================================
+ Hits          213      218       +5     
- Misses          6       17      +11     
Impacted Files Coverage Δ
R/utils.R 0.00% <0.00%> (ø)
R/zzz.R 0.00% <ø> (ø)
R/fd_fric.R 81.81% <53.84%> (-18.19%) ⬇️

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 638a469...c5c5b0c. Read the comment docs.

@Rekyt
Copy link
Member

Rekyt commented Aug 17, 2021

Here is a list of conditions where we expect to have a qhull warning:

  1. When there are not enough points (n. point < n. dimensions)
  2. When there are too many dimensions (n. dimensions > 16)
  3. When they are duplicate points (qhull is expected to throw an error in this case see https://github.com/cran/geometry/blob/master/tests/testthat/test-convhulln.R#L83-L85)
  4. When the volume has a specific configuration making the convex hull not computable (we need a dataset to reproduce this!)

Within fd_fric() and fd_chull() we're accounting for 2. and 3.

@Bisaloo
Copy link
Collaborator Author

Bisaloo commented Aug 19, 2021

@Bisaloo
Copy link
Collaborator Author

Bisaloo commented Aug 19, 2021

What about putting this issue on hold until someone comes to us with a problematic dataset?

@Rekyt
Copy link
Member

Rekyt commented Aug 19, 2021

What about putting this issue on hold until someone comes to us with a problematic dataset?

Probably the best to do unless we get a clear example. We can revisit anytime we encounter an issue with a dataset.

@Bisaloo
Copy link
Collaborator Author

Bisaloo commented Jul 15, 2022

I'm trying to revisit this issue and I'm not convinced this is the right approach since we would have to duplicate code in fd_fric(), fd_fric_intersect(), fdiv().

Ideally, this should be in fd_chull(). At the same, it seems somewhat inevitable that some part stays in fd_fric() unless we want to print "There are warnings()" all the time.

I need to take more time to investigate how base R manages to deal with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Managing error from qhull transferred to geometry::convhulln() in fd_chull()
3 participants