Comments (6)
Hi,
h5tb.getTableInfo is for Tables like https://support.hdfgroup.org/HDF5/doc/HL/RM_H5TB.html. The python above created a dataset which probably doesn't have all the table sophistry.
Do you want the dimensions of your dataset before reading it? Maybe try
const dims = group.getDatasetDimensions('labels');
http://hdf-ni.github.io/hdf5.node/ref/groups.html
from hdf5.node.
Hi,
getDatasetDimensions
correctly outputs [3]
, but readDataset
outputs a similar error:
var data = h5lt.readDataset(group.id, 'labels');
^
SyntaxError: unsupported data type
at Object.<anonymous> (hdfGenerator.js:23:17)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
from hdf5.node.
Ah, ok; I'll add support for reading:-) Thank you, I have a python env to make the test
from hdf5.node.
And also writing...
from hdf5.node.
Hi, do you have other types you want vlen'ed?
Also the overall dimensions and rank you need covered? I want to support them all
from hdf5.node.
Perfect, thanks! It would be great if any kind of tables can also be used with VLEN. Demo generation script:
import numpy as np
import h5py
label_dtype = np.dtype(
[('type1', np.float),
('type2', np.float),
('type3', np.uint8),
('type4', np.uint16),
('type5', np.uint16)])
with h5py.File('testdata.hdf5', 'a') as hdf:
if 'real' in hdf:
del hdf['real']
hdf_group = hdf.create_group('real')
hdf_labels = hdf_group.create_dataset('labels', (3,), h5py.special_dtype(vlen = label_dtype))
for i in range(3):
labels = np.empty(i + 1, label_dtype)
for j in range(i + 1):
labels[j]['type1'] = j
labels[j]['type2'] = j + 1
labels[j]['type3'] = j + 2
labels[j]['type4'] = j + 3
labels[j]['type5'] = j + 4
hdf_labels[i] = labels
h5dump output:
HDF5 "testdata.hdf5" {
GROUP "/" {
GROUP "real" {
DATASET "labels" {
DATATYPE H5T_VLEN { H5T_COMPOUND {
H5T_IEEE_F64LE "type1";
H5T_IEEE_F64LE "type2";
H5T_STD_U8LE "type3";
H5T_STD_U16LE "type4";
H5T_STD_U16LE "type5";
}}
DATASPACE SIMPLE { ( 3 ) / ( 3 ) }
DATA {
(0): ({
0,
1,
2,
3,
4
}),
(1): ({
0,
1,
2,
3,
4
}, {
1,
2,
3,
4,
5
}),
(2): ({
0,
1,
2,
3,
4
}, {
1,
2,
3,
4,
5
}, {
2,
3,
4,
5,
6
})
}
}
}
}
}
But I think I will use another approach for now. Maybe I will get back to this really nice module in the future. So no hurry for me, but this will probably also be very useful for other users who want to use the module with hdf files generated with h5py :)
Regarding the rank, it would be helpful if any kind of rank can be used (if I understand correctly the maximum rank you currently support is 4?), but then this would probably be a different issue.
from hdf5.node.
Related Issues (20)
- Support for Single Writer Multiple Reader (SWMR)? HOT 7
- Getting dataset attribute (getDatasetAttribute) on a 32 bit floating point in NODE/javascript returns a totally different value HOT 6
- hdf5_home_win does not get set HOT 2
- Read dataset with 2d array stored fails on reading chunks HOT 10
- issues reading 4 dimensional dataset HOT 2
- SyntaxError: unsupported data type on compound datasets HOT 5
- Node 12? HOT 32
- Delete attribute HOT 6
- Tutorial: "Writing & Reading subsets" is not working. HOT 3
- Segfault reading HOT 4
- issue with appending to tables on windows 10
- Error: The specified procedure could not be found. (process.dlopen) HOT 1
- `hdf5.File is not a constructor` when bundled with webpack HOT 2
- cannot install HOT 3
- Win10+Node v14.15.5 Compilation errors HOT 6
- Getting data from Buffer
- Compile Error HOT 12
- install with yarn? HOT 2
- windows-build-tools / vs2017? HOT 37
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 hdf5.node.