-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Use pybind11 for tri module #24522
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
Merged
Merged
Use pybind11 for tri module #24522
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5e29a2a
Use pybind11 for tri module
ianthomas23 a4ffb29
Preinstall pybind11 on no-build-isolation builds
ianthomas23 1e93684
Triangulation.set_mask fix and tests
ianthomas23 286e48f
Review comments
ianthomas23 fbcf714
Use MSVC 2017 on appveyor
ianthomas23 5360353
Preinstall pybind11 in CodeQL action
ianthomas23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ branches: | |
|
||
clone_depth: 50 | ||
|
||
image: Visual Studio 2017 | ||
|
||
environment: | ||
|
||
global: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Because of lacking knowledge: will this cause problems for anyone possibly creating the Triangulation explicitly? Am I correct assuming that passing None is no longer feasible at this level?
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.
In principle yes, but we do not expose this class out publicly (there is a Python-side
Triangulation
class intri._triangulation
that we re-export intri/__init__.py
).I think it is OK both that we change this API without warning and that we have tests that touch private API.
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.
I'm not entirely happy with this internal conversion of
None
to empty tuple for optional integer arrays but I cannot think of an alternative that isn't worse. In the long run we will usestd::optional
but that is C++17. I wouldn't want to use any C++17 until SciPy does, but that may not be far away (https://docs.scipy.org/doc/scipy/dev/toolchain.html#c-language-standards).In the meantime we can use
std::optional
by shipping our ownoptional.h
but I wouldn't want to do that as if there is a problem with some obscure compiler we will be on our own. Or we could write our own bespokenp.array | None
pybind11 converter class but that is much more esoteric C++ than we currently have. So the least bad option is to stick with theNone
to tuple until we are OK with using C++17.Note to self: need to add explicit internal API tests for
set_mask
as this also accepts an optional array.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.
fwiw scipy seems to aim to bump to c++17 in the next (1.10) release, see scipy/scipy#16589.