cykhash icon indicating copy to clipboard operation
cykhash copied to clipboard

Migration guide for cykhash v2.0.0?

Open HTenkanen opened this issue 4 years ago • 1 comments

Hi @realead!

I use cykhash as a dependency in pyrosm library.

This week, I received an issue saying that the library does not work anymore, and it relates to the breaking changes that came with cykhash v2.0.0. Would you have some kind of information about migrating from v1.0.2 to v2.0.0. I.e. what should I change to get things working again with Int64Set_from_buffer and isin_int64 functions? I use those functions in here: https://github.com/HTenkanen/pyrosm/blob/master/pyrosm/data_filter.pyx#L190-L226

I believe the issue relates to the changed signature. You can check the error message from here: https://github.com/HTenkanen/pyrosm/issues/153

I would much appreciate the help! 🙂

Thanks! Henrikki

HTenkanen avatar Nov 13 '21 16:11 HTenkanen

@HTenkanen

I've checked that projects using cykhash (that aren't many) don't get broken with "breaking" changes - it feels silly to do the deprication-dance for features nobody is using. So for the (allmost all) cases out there - there is no need for migration.

The linked issue is due to different cykash versions used for building and running. My advice would be:

  • pin the exact version of a cython-extension if C-interface is used (i.e. some functionality is cimported).
  • if only python interface (i.e. all used functionality is imported), I guess using >= is enough.

While writing cython-extension in a way that would allow building with one version and running with another (when C-interface is used) is possible, it makes things a lot harder...

E.g. I just completely missed that changing the signature from cpdef Int64Set_from_buffer(int64_t[:] buf, double size_hint=*) to cpdef Int64Set Int64Set_from_buffer(int64_t[:] buf, double size_hint=*) would lead to ussies if cykhash v1.0.2. is replaced by cykhash v2.0.0.

Sorry for that.

realead avatar Nov 14 '21 15:11 realead

I have added a part to documentation about compatibility between cykhash versions (https://github.com/realead/cykhash#compatibility-between-cykhash-versions). I think there is nothing special about step from 1.x to 2.x.

realead avatar Feb 07 '23 06:02 realead