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

feat: Support fit_power_law(implementation = "plfit.p") to compute the P-value #1386

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Jun 1, 2024

Closes #1158.

Copy link
Contributor

aviator-app bot commented Jun 1, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


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.

@krlmlr krlmlr marked this pull request as draft June 1, 2024 17:21
@krlmlr krlmlr removed the mergequeue label Jun 1, 2024
@aviator-app aviator-app bot added the blocked label Jun 1, 2024
Copy link
Contributor

aviator-app bot commented Jun 1, 2024

This pull request failed to merge: this PR is in draft state. Once the issues are resolved, remove the blocked label and re-queue the pull request. Note that the pull request will be automatically re-queued if it has the mergequeue label.

Additional debug info: PR was marked as draft after queueing

@szhorvat szhorvat added this to the 2.0.4 milestone Jun 20, 2024
@maelle
Copy link
Contributor

maelle commented Jul 2, 2024

I see I was tasked with refining the interface as needed, but I'd need some more pointers/context.

@Antonov548 Antonov548 marked this pull request as ready for review July 10, 2024 10:12
@Antonov548
Copy link
Contributor

@krlmlr I have added R_igraph_power_law_fit_new() and seems R_igraph_power_law_fit() not used anymore.

I have created R_igraph_power_law_fit_new() which doesn't use R_igraph_power_law_fit() to create result list with correct amount of fields.

I assume there is no tests for this function right now? I think we might need to add it using snapshot?

Copy link
Contributor Author

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

src/rinterface_extra.c Outdated Show resolved Hide resolved
IGRAPH_R_CHECK_BOOL(pvalue);
c_compute_pvalue = LOGICAL(pvalue)[0];

IGRAPH_R_CHECK(igraph_power_law_fit(&c_data, &c_res, c_xmin, c_force_continuous));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also call the generated function and use lengthgets() to add an element to the returned list. This is better because we then would still rely on autogeneration for the better part of the code here.

Copy link
Contributor

@Antonov548 Antonov548 Jul 22, 2024

Choose a reason for hiding this comment

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

we can't use generated function. To compute p-value we need return value from igraph_power_law_fit C function, but we lose this data if use generated function. I think using generated function give to much overhead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @Antonov548!

@krlmlr do you have further thoughts on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, makes sense to me.

@krlmlr
Copy link
Contributor Author

krlmlr commented Aug 22, 2024

Thanks!

@aviator-app aviator-app bot added the blocked label Aug 22, 2024
Copy link
Contributor

aviator-app bot commented Aug 22, 2024

This pull request failed to merge: PR cannot be automatically rebased, please rebase manually to continue. Once the issues are resolved, remove the blocked label and re-queue the pull request. Note that the pull request will be automatically re-queued if it has the mergequeue label.

Additional debug info: Failed to rebase this PR onto the latest changes from the base branch. You will probably need to rebase this PR manually and resolve conflicts).

@maelle
Copy link
Contributor

maelle commented Aug 22, 2024

@Antonov548 I resolved the conflict in src/cpp11.cpp by rebasing locally and running cpp11::cpp_register() in R but I wouldn't mind your checking I didn't do anything wrong. 🙏 If it's all good, please re-add the mergequeue label. Thank you!

@Antonov548
Copy link
Contributor

@Antonov548 I resolved the conflict in src/cpp11.cpp by rebasing locally and running cpp11::cpp_register() in R but I wouldn't mind your checking I didn't do anything wrong. 🙏 If it's all good, please re-add the mergequeue label. Thank you!

Thanks. Seems everything is fine.

@maelle
Copy link
Contributor

maelle commented Aug 22, 2024

thank you @Antonov548!

@aviator-app aviator-app bot merged commit 7578190 into main Aug 22, 2024
11 checks passed
@aviator-app aviator-app bot deleted the f-1158-plfit-p branch August 22, 2024 12:17
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.

p-value missing for fit_power_law()
4 participants