-
Notifications
You must be signed in to change notification settings - Fork 8
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
ENH: add to_wkb / from_wkb #68
Conversation
The upstream change is merged in s2georaphy, so this should be ready now |
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.
Thanks @jorisvandenbossche! Two minor comments below.
} | ||
|
||
private: | ||
std::shared_ptr<s2geog::WKBReader> m_reader; |
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.
Use unique_ptr
instead of shared_ptr
? (Also in ToWKB
) Unless I'm missing something?
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.
It might be that pybind11 requires this class to be copyable? (if you pass it as argument to vectorize)
And that then gives the typical "use of deleted function" compilation errors if using unique_ptr instead of shared_ptr
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.
It might be that pybind11 requires this class to be copyable? (if you pass it as argument to vectorize)
Ah yes I see. Another option may be to add a FromWKB
copy constructor (since this is what is passed to py::vectorize
) although using a shared pointer is certainly fine.
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 would personally leave it as is with a shared pointer then, to not make the small class more complicated (I don't think instantiation of the vectorized function is performance sensitive?)
Co-authored-by: Benoit Bovy <benbovy@gmail.com>
Depends on paleolimbot/s2geography#42
Closes #38