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: New voronoi_cells() to compute the Voronoi partitioning of a graph #1173

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

szhorvat
Copy link
Member

@krlmlr @maelle Please have a look before I add a test.

Copy link
Contributor

aviator-app bot commented Jan 29, 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.

@szhorvat szhorvat force-pushed the feat/voronoi branch 2 times, most recently from b720bc9 to cc3f523 Compare January 29, 2024 22:19
Copy link
Contributor

@maelle maelle left a comment

Choose a reason for hiding this comment

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

Thanks! I added a few comments.

R/community.R Outdated Show resolved Hide resolved
R/community.R Show resolved Hide resolved
R/community.R Outdated Show resolved Hide resolved
R/aaa-auto.R Show resolved Hide resolved
@szhorvat
Copy link
Member Author

Thanks for the review @maelle !

Copy link
Contributor

@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.

Looks good, thanks!

R/aaa-auto.R Show resolved Hide resolved
R/community.R Show resolved Hide resolved
tools/stimulus/functions-R.yaml Outdated Show resolved Hide resolved
@krlmlr
Copy link
Contributor

krlmlr commented Jan 30, 2024

Why do the checks fail though?

@krlmlr
Copy link
Contributor

krlmlr commented Jan 30, 2024

Undocumented arguments in documentation object 'voronoi'
‘...’

See https://rlang.r-lib.org/reference/args_dots_empty.html?q=args_dots_e#null .

@szhorvat
Copy link
Member Author

Thanks for the comments, @krlmlr. This PR is not urgent for me. I want to take this slow and use the opportunity to learn how to best do this.

@szhorvat szhorvat marked this pull request as ready for review February 1, 2024 20:21
@szhorvat
Copy link
Member Author

szhorvat commented Feb 3, 2024

This PR has revealed a larger bug: in auto-generated code, vectors created with R_SEXP_to_vector_int_copy are not freed. Can you please have a look at this @Antonov548? See the sanitizer failure. Similar memory leak bugs may be present in existing functions.

(But priority should be given to the "phoenix" milestone before this memory leak.)

@szhorvat
Copy link
Member Author

szhorvat commented Feb 4, 2024

@Antonov548 In typec-RC.yaml, I can see that some of non-allocating conversions were changed to allocating ones without adding cleanup code. Please always add the cleanup code as well, or if this is not trivial, do create a reminder issue to do it.

Whenever there is allocation in the INCONV section, there needs to be deallocation in the OUTCONV section. The IN part of at least VERTEX_INDICES, VERTEX_INDEX_PAIRS are affected. Can you add the deallocation and check if anything else is missing it?

It seems to me that there are lots of memory leaks at the moment.

@szhorvat
Copy link
Member Author

szhorvat commented Feb 4, 2024

@krlmlr Now that the memory leak issue is fixed, this PR is ready for merging or another review (but not urgent).

@krlmlr krlmlr requested a review from maelle February 5, 2024 06:24
@krlmlr krlmlr changed the title feat: voronoi() feat: New voronoi() to compute the Voronoi partitioning of a graph Feb 5, 2024
@krlmlr
Copy link
Contributor

krlmlr commented Feb 5, 2024

@maelle: Do these new featores conflict with the lifecycle work?

@szhorvat: Should we use a more descriptive name, perhaps voronoi_part() or voronoi_partitioning() ?

@szhorvat
Copy link
Member Author

szhorvat commented Feb 5, 2024

I think voronoi() is sufficiently descriptive, and consistent with how other functions are named. But it's good to be aware that there are several other R packages which have a function of the same name, which compute a geometric Voronoi tessellation: https://rdrr.io/search?q=voronoi Some of these are methods, sometimes it is even a class name. At this point it becomes a technical decision what to do, so I'll leave it to you.

If we do go with a different name, I'd like to use voronoi_cells().

Merging this is not urgent, it's fine to make this decision after the Tuesday release.

@maelle
Copy link
Contributor

maelle commented Feb 5, 2024

@maelle: Do these new features conflict with the lifecycle work?

@krlmlr no they do not, especially as adding an experimental function does not require registering for which version it was added.

@krlmlr
Copy link
Contributor

krlmlr commented Feb 8, 2024

Thanks. voronoi() -> voronoi_cells() sounds good to me, we'd also need to update the PR's title. Postponing.

@szhorvat szhorvat changed the title feat: New voronoi() to compute the Voronoi partitioning of a graph feat: New voronoi_cells() to compute the Voronoi partitioning of a graph Feb 18, 2024
@szhorvat
Copy link
Member Author

Renamed to voronoi_cells().

@krlmlr
Copy link
Contributor

krlmlr commented Feb 20, 2024

Thanks!

@aviator-app aviator-app bot merged commit 4d4b29b into main Feb 20, 2024
14 checks passed
@aviator-app aviator-app bot deleted the feat/voronoi branch February 20, 2024 15:24
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.

4 participants