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

accept size parameter for polygonToCellsExperimental #947

Merged

Conversation

isaacbrodsky
Copy link
Collaborator

No description provided.

@coveralls
Copy link

coveralls commented Nov 28, 2024

Coverage Status

coverage: 98.784% (+0.001%) from 98.783%
when pulling 5aa4ad2 on isaacbrodsky:experimental-polyfill-accept-size
into 7268098 on uber:master.

@ajfriend
Copy link
Contributor

Some basic questions since I've forgotten some of our code organization practice:

  • Should we add polygonToCellsExperimental to h3api.h.in instead of polyfill.h?
  • Does H3_EXPORT serve a purpose outside of h3api.h.in, or does it only make sense in that file?

@isaacbrodsky
Copy link
Collaborator Author

* Should we add `polygonToCellsExperimental` to `h3api.h.in` instead of `polyfill.h`?

It depends on the level of support for this function. If this is an experimental function but we intend for bindings to mostly use the iterator approach, I don't think it needs to be there. If this is a supported API that has backwards compatibility guarantees it should be in h3api.h.

* Does `H3_EXPORT` serve a purpose outside of `h3api.h.in`, or does it only make sense in that file?

H3_EXPORT ensures that the symbol is visible outside of the library, and allows for it to be easily renamed.

@ajfriend
Copy link
Contributor

ajfriend commented Dec 2, 2024

I think the level of support is explained by the experimental.

But I also thought that symbols were external (e.g., supported API, "just the bindings", experimental functions) if and only if they were defined in h3api.h.in and use H3_EXPORT. And, as a result, anything defined in the other header files should be considered internal to the library.

Every symbol in the previous release followed this property. The (unreleased) polygonToCellsExperimental is the first set of functions outside of that convention.

Unless I'm misunderstanding something, I'm suggesting moving these to h3api.h.in.

@isaacbrodsky isaacbrodsky marked this pull request as ready for review December 4, 2024 16:04
Copy link
Collaborator

@nrabinowitz nrabinowitz left a comment

Choose a reason for hiding this comment

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

This looks fine to me, with the caveat that if we're going to do this, we should plan to change the API again in the near future to return an iterator, so that callers could stream output iteratively into different memory blocks. If we're ok with that change later, this seems fine to ship early.

@isaacbrodsky
Copy link
Collaborator Author

This looks fine to me, with the caveat that if we're going to do this, we should plan to change the API again in the near future to return an iterator, so that callers could stream output iteratively into different memory blocks. If we're ok with that change later, this seems fine to ship early.

Agreed, I would like to expose an iterator to the bindings. Bindings can begin experimenting with the iterators, and for other uses inthe mean time, this will be a temporary experimental API to unblock the new version.

@ajfriend
Copy link
Contributor

ajfriend commented Dec 4, 2024

@nrabinowitz, do you mean change the API for polygonToCellsExperimental? Since it is "experimental", I think that's fine. But maybe it is worth flagging in the docstring that folks should expect that to happen?

@isaacbrodsky
Copy link
Collaborator Author

@nrabinowitz, do you mean change the API for polygonToCellsExperimental? Since it is "experimental", I think that's fine. But maybe it is worth flagging in the docstring that folks should expect that to happen?

I added a comment in h3api.h.in to that effect

@isaacbrodsky isaacbrodsky merged commit 573ff1e into uber:master Dec 5, 2024
38 checks passed
@isaacbrodsky isaacbrodsky deleted the experimental-polyfill-accept-size branch December 5, 2024 00:19
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.

5 participants