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

Possible to parameterize UDF with dataset selection coordinates? #9

Open
CreRecombinase opened this issue Oct 31, 2020 · 1 comment

Comments

@CreRecombinase
Copy link

I think this is a super cool library. I was wondering if it would be possible, instead of writing a function with no arguments, whether this library could be extended so that the user defined function only has to generate data corresponding to the selection of the read operation. Even if coordinate + offset was the only supported selection functionality I still think this would be super useful. Now that I think about it more, I suppose it might be possible to emulate some of this functionality with virtual datasets?

@lucasvr
Copy link
Owner

lucasvr commented Nov 1, 2020

Hi, Nicholas. Thanks for the compliment!

HDF5-UDF is implemented on top of the HDF5 I/O filter API. That API is a bit limited in the sense that it does not provide important information to the filter callback: the file, dataspace and hyperslab handles are not known to the filter, for instance. I have a working patchset that modifies the filter API to pass some of that information to the callbacks, but it has not been merged into HDF5 yet. I will look into submitting the patch once again to the project in the coming days.

One possible workaround for now would be to use environment variables, but you'd have to modify the reader so that the selection area is exported through setenv() and to include calls to getenv() on the UDF side.

Virtual datasets should be able to do that as long as all you need to do is to "glue" different datasets (as in a mosaic).

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

No branches or pull requests

2 participants