Skip to content
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

Document in strings.rst usage of special_dtype(vlen=str) #2423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doronbehar
Copy link

@doronbehar doronbehar commented May 6, 2024

I have been using the example I documented here for a while now. Felt it was missing. I had to learn this from the question here.

@aragilar
Copy link
Member

aragilar commented May 6, 2024

Rather than h5py.special_dtype(vlen=str) (which is oldish and somewhat implicit about what it means, though I don't think we'll drop support for it), you should use h5py.string_dtype(encoding='utf-8', length=None) (or, since those are the default values h5py.string_dtype()).

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.58%. Comparing base (c8972f1) to head (e64e5ce).
Report is 5 commits behind head on master.

❗ Current head e64e5ce differs from pull request most recent head 300175e. Consider uploading reports for the commit 300175e to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2423   +/-   ##
=======================================
  Coverage   89.58%   89.58%           
=======================================
  Files          17       17           
  Lines        2391     2391           
=======================================
  Hits         2142     2142           
  Misses        249      249           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@doronbehar
Copy link
Author

Hmm I wonder how I missed that back then... The docs indeed mention [string_dtype](https://docs.h5py.org/en/stable/special.html#h5py.string_dtype), but they don't tell you to use that for datasets, and only gives examples for attributes. I pushed something.

@takluyver
Copy link
Member

Thanks! I think this could benefit from an example. But it's a fairly confusing topic, because of all the different possible string types, and I think it needs careful presentation to avoid muddying the waters. So I hope you won't mind if I open a new PR reworking this example to show the different possibilities.

@takluyver
Copy link
Member

I've tried to do that in #2424.

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.

None yet

3 participants