-
Notifications
You must be signed in to change notification settings - Fork 22
Python3.12 support #65
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
base: master
Are you sure you want to change the base?
Conversation
bigstream/transform.py
Outdated
| if transform[..., i]: | ||
| dX.append(interp(transform[..., i])) | ||
| else: | ||
| dx.append(interp([0]) |
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.
you have a typo here
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.
fixed, thanks
|
@GFleishman what do you think? |
|
@GFleishman did you try your code with python3.12 ? I currently need to keep a branch alive just for this fix, will be very happy to not need the branch and just just |
|
Hi @orena1 - thanks for the email and I'm sorry to have kept you waiting so long with this request. I'm a scatter brained scientist working on lots of projects in parallel and proper maintenance of code is often delayed behind fresh projects with new data - I'm really grateful for your contribution and support of bigstream in general - and I'm also really grateful for your patience. I don't quite understand the issue being addressed here. I see that you're wanting to address an edge case in But it does not seem consistent with what is currently written. The original line is: dX = np.array([interp(transform[..., i]) for i in range(ndims)]).transpose()The proposed change is: for i in range(ndims):
if transform[..., i]:
dX.append(interp(transform[..., i]))
else:
dX.append(interp([0])The I have to think more closely about it, but IIRC the transpose is essential for putting the displacements, that is The conversion to a numpy array is technically not necessary, since in the subsequent line: coordinates = coordinates.transpose() * spacing + dXwe assume So in summary, can you let me know when this edge case would ever come up? That is, why an empty deformation would ever be passed to this function? And also, can you let me know why the transpose was not included? |
|
Thanks @GFleishman I am not sure why we get empty deformation, I think it happens when a block is just empty all zeros. This is not something new in python 3.12 I actually think that this happens a lot, probably even in your experiments, you just don't see it, did you try to create a new env with python3.12 and run your tests? I wonder if this is hidden? Does it helps? |

There is an change in python 3.12 in which len(view) raise an error:
https://docs.python.org/3/library/stdtypes.html#memoryview
instead of 1
This causes in issue with
msgpackwhen it tires to calculate the size, once we updatemsgpackit does not break the massage transport, but it does fail in bigwarp.My intuition is that in python3.11 when an empry array was submitted to the workers, they actually received and
np.array([0])but now they receive and np.array([]) and this raise an exception formap_coordinatesasmap_coordinates([], coordinates, mode='nearest')raises an exception.This fix works, although I am not sure I fully comprehend what is going on.