Comments (6)
I've implemented some fixes for this in h5serv - please update your h5serv repo and try it out.
My change always returns an absolute DNS-style name. Relative filenames should be ok.
It should also work with absolute filenames in the link that point to the correct location in the server data directory. Again it will return a DNS name.
There are a bunch of edge cases, but I think this should be good for common usage.
from h5pyd.
It works, although it is tripped up if the external file has a different extension than the default server extension. In my example, the file mullite/mullite_300K.h5
has an external link to 300K/transform.nxs
. With .h5
as the default extension, I get:
>>> import h5pyd as h5
>>> a=h5.File('mullite_300K.mullite.exfac', mode='r', endpoint='http://34.193.81.207:5000')
>>> a['/entry/transform/v']
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-3-c6429c132039> in <module>()
----> 1 a['/entry/transform/v']
/Users/rosborn/anaconda/envs/py27/lib/python2.7/site-packages/h5pyd/_hl/group.pyc in __getitem__(self, name)
349 except IOError:
350 # unable to find external link
--> 351 raise KeyError("Unable to open file: " + link_json['h5domain'])
352 return f[link_json['h5path']]
353
KeyError: u'Unable to open file: transform.nxs.300K.mullite.exfac'
So the non-default extension, .nxs
is being included in the filename. If I rename the parent file to mullite/mullite_300K.nxs
and restart the server with .nxs
as the default extension, i.e., so it matches the extension of the linked file, then it works:
>>> a['/entry/transform/v']
<HDF5 dataset "v": shape (801, 901, 901), type "<f4">
>>> a.filename
'mullite_300K.mullite.exfac'
>>> a['/entry/transform/v'].file
<HDF5 file "transform.300K.mullite.exfac" (mode r)>
from h5pyd.
There seems to be another problem. If a group contains an externally linked dataset and I call the group's items()
method, the external link does not get resolved in the returned value, even though it does get resolved when referencing the dataset directly.
>>> a=h5.File('mullite_300K.mullite.exfac', mode='r', endpoint='http://34.193.81.207:5000')
>>> a['/entry/transform'].items()
[(u'Qk', <HDF5 dataset "Qk": shape (901,), type "<f8">),
(u'Ql', <HDF5 dataset "Ql": shape (801,), type "<f8">),
(u'Qh', <HDF5 dataset "Qh": shape (901,), type "<f8">),
(u'v', None)]
>>> a['/entry/transform/v']
<HDF5 dataset "v": shape (801, 901, 901), type "<f4">
from h5pyd.
Ah, looks like I did the transform for the link operation, but not the links one.
I've fixed that now, update your h5serv repo.
from h5pyd.
The items
function now returns all the values, including the external links. Fixing this has uncovered another possible inconsistency with h5py, which I will post as another issue. Thanks for all the work.
from h5pyd.
Good. I'll close this one then.
from h5pyd.
Related Issues (20)
- Fancy indexing index list length is limited by GET query size HOT 3
- Error retrieving data: 429 HOT 3
- `hsload` fails on empty data sets (with a dimension of length 0) HOT 13
- bulk download suggestions HOT 2
- hsget failing when datasets contain fillvalues HOT 2
- Append option for hsload HOT 2
- Passing 'Bearer' token to h5pyd instead of fixed keycloak config HOT 3
- Issue in creating /home directory HOT 14
- How to read HDF5 file in Vaex data frame HOT 7
- Conflict with google-auth-oauthlib-0.6.0 on MacOS HOT 11
- hsload change dataset's datatype class from Compound (H5T_COMPOUND) to Opaque (H5T_OPAQUE) HOT 2
- hsds return "filter "H5Z_FLETCHER_DEFLATE" not recognized" due to hsload datasets with FLETCHER32 filter HOT 3
- h5pyd dataset.chunks not compatible with h5py HOT 2
- hsload fails decoding ASCII encoded attributes HOT 10
- hsload fails with compact datasets HOT 1
- `hsload` fails when an attribute has type `Reference` HOT 4
- hsload fails with datasets using scale offset filter HOT 1
- apply source compression filter in hsload HOT 1
- Show filters applied to any datasets in hsls HOT 1
- h5pyd not evaluating environment variables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h5pyd.