-
-
Notifications
You must be signed in to change notification settings - Fork 201
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: adapt to cut.prob's new handling of NULL in the C core (sim… #1574
base: main
Are you sure you want to change the base?
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
5b76237
to
b0d4610
Compare
…pler default for the R interface)
mmh this does not work at all currently. |
@szhorvat actually, I think things are fine. What do you think of the tests rigraph/tests/testthat/test-motifs.R Line 1 in 30518c2
They're failing for small differences. Furthermore they do not make any sense to me, why are we testing for the value of the divisions?
|
I'm really tired today ... could you please help me by showing me a specific before/after example that changes output? Passing But as I'm writing this, I think I'm starting to remember what's going on: I think passing It'll be cleanest for each test to use its own random seed. |
Yes, this is certainly what's going on. If you pass The results are approximately the same and everything is fine. Adding a tolerance won't work very well here because the noise in the results is still quite high and will continue to be high unless we use large enough graphs and small enough cut probabilities that the computation time becomes too long for a test. |
The interface is not very nice, unfortunately, but improvements are for a later version and for the C core. If we give cut probabilities So, if you give |
if (is.null(cut.prob)) { | ||
.Call( | ||
R_igraph_motifs_randesu_estimate, graph, as.numeric(size), | ||
cut.prob, as.numeric(sample.size), as.numeric(sample) | ||
) | ||
} else { | ||
.Call( | ||
R_igraph_motifs_randesu_estimate, graph, as.numeric(size), | ||
as.numeric(cut.prob), as.numeric(sample.size), as.numeric(sample) | ||
) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting the call in a conditional, update the value of cut.prob
in a conditional, and keep a single call to the C function.
When you resolve conflicts, be sure that you don't accidentally re-add |
…pler default for the R interface)
Fix #1570
Work needed in the tests.