Skip to content

Misc fix #43

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 8 commits into from
Apr 16, 2021
Merged

Misc fix #43

merged 8 commits into from
Apr 16, 2021

Conversation

jourdain
Copy link
Contributor

@jourdain jourdain commented Apr 14, 2021

Need to rebase from the async but fix css typo in demos and add support for encoded binary arrays.

closes #42

Copy link

@xhluca xhluca left a comment

Choose a reason for hiding this comment

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

Just some thoughts; overall looks good but yeah let's wait for the async PR to be merged!

return None

# Extract mesh
points = b64_encode_numpy(vtk_to_numpy(polydata.GetPoints().GetData()))
Copy link

Choose a reason for hiding this comment

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

will this always be float32 or int64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be either float32 or float64.

Copy link

Choose a reason for hiding this comment

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

perfect

# We have a numpy array that is compatible with JavaScript typed
# arrays
buffer = base64.b64encode(memoryview(obj.ravel(order="C"))).decode("utf-8")
return {"bvals": buffer, "dtype": str(dtype), "shape": obj.shape}
Copy link

Choose a reason for hiding this comment

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

My understanding is that the original code was meant for 1D numpy array. I don't think that creates any problem for obj.shape (since a python tuple should be easy to convert to JS), but i'm curious whether there will be needs to do any modification on the JS side for that to work...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the vtk side we expect 1D, we don't care about the shape... Just kept it for @nicolaskruchten . ;-)

Copy link

Choose a reason for hiding this comment

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

sure!

@xhluca
Copy link

xhluca commented Apr 15, 2021

@jourdain The PR is merged; I think what you added looks good on the python side, do you have anything else in mind on the JS side?

@jourdain
Copy link
Contributor Author

If we use [email protected] we are good...

@jourdain
Copy link
Contributor Author

@xhlulu I let you merge it and eventually create a version 1.0.0 is everything is working as expected. Normally the F1 demo should be faster with that one.

@xhluca
Copy link

xhluca commented Apr 16, 2021

@jourdain Do you get this error locally?

image

@jourdain
Copy link
Contributor Author

I guess I'll have to try that specific example...

@xhluca
Copy link

xhluca commented Apr 16, 2021

Yeah it's a regression:

mesh-problem

@jourdain
Copy link
Contributor Author

It looks like the cell connectivity get messed up. Along with some point coordinates not being correct...

@jourdain
Copy link
Contributor Author

@xhlulu that should be good now... Good catch!

@xhluca
Copy link

xhluca commented Apr 16, 2021

@jourdain awesome. Updating the change log and will create a release afterwards.

Copy link

@xhluca xhluca left a comment

Choose a reason for hiding this comment

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

💃

@xhluca xhluca merged commit 8c8b363 into master Apr 16, 2021
@xhluca xhluca deleted the misc-fix branch April 16, 2021 20:37
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.

Add binary transport
2 participants