Comments (24)
I'm not familiar with what this is:-)
Would it be best to be a part of this code or separate in https://github.com/DefinitelyTyped/DefinitelyTyped?
I'm guessing this adds an interface for typescript calls?
from hdf5.node.
I guess its better to be part of this module, because of version mismatches.
I'm currently writing the type definition and could make another pull request in the next few days.
It's only an extra definition file of the javascript interface. So it doesn't change existing code.
from hdf5.node.
Right. And this adds the potential of typescript users liking this project?
Is there anything you need changed to make it nice?
from hdf5.node.
Yes, absolutly.
There is one thing.
The properties of the buffer like rank, row, and type would be better to be placed in the options argument. Then these properties would be set to required in typescript, so no one can miss to set these properties. Then the buffer is a "native" object without modified properties. But this could be a breaking change for existing projects? Or maybe enable both ways to define these properties?
from hdf5.node.
Oh I've been wanting to move to that style with the options! Then properties are clear of any reserved names. And it would fit javascrpt/JSON coding styles.
Been thinking to make the legacy of reserved rank row, and type properties only work if no options are defined.
from hdf5.node.
In other words this can be made seamless for prior users without breaking code they already have
from hdf5.node.
I'll work at changing to the options args for rank rows type this evening. You morning seems earlier than mine:-)
from hdf5.node.
Legacy must also be available when someone defines chunkSize or compression in options but use the old buffer options.
from hdf5.node.
Yep. Are you fine with getting options back as done in https://github.com/HDF-NI/hdf5.node/blob/master/test/test_h5lt.js#L136 ?
const readBuffer=h5lt.readDataset(group.id, 'Quadruple Rank', function(options) {
JSON.stringify(options).should.equal('{"rank":4,"endian":0}')
});
from hdf5.node.
Yes, that's fine.
from hdf5.node.
All you're doing is really strengthening this project! Thank you
from hdf5.node.
Thank you.
But you are one who created this great module and housekeeping the code.
Thanks too.
from hdf5.node.
Maybe when we now changing the options, dims should be an array like: dims[2, 4, 5, 6] and maxDims[-1, 4,5,6];
This could make the code a little bit cleaner.
Then maybe remove the legacy properties and make a new version 0.4.0, so no user get the new spec without action.
And add a hint to the readme about the new function call.
from hdf5.node.
Yes, a release at 0.3.4 so that bug fixes are available to anyone with legacy style, tag it so a branch can be made if necessary; then make it all with the new spec.
Also I'm seeing a lot of compile warnings now with nodejs v10.1.x which I want to investigate.
Docs will get an update including the tutorials. I got some of the way thru moving to options last night but first found some other bugs.
from hdf5.node.
Should have it testable later today with {rank: 2, rows: 10, columns: 10 ....} style
sutoiku most likely is working on nodejs 10.1.x changes in the v8
from hdf5.node.
What should be documented for typescript developers?
from hdf5.node.
Maybe add an example
import { H5Type, Access, Interlace, H5OType, HLType, H5SType } from 'hdf5/lib/globals';
import { hdf5, h5lt, Hdf5Buffer } from 'hdf5';
const file: hdf5.File = new hdf5.File('test2.h5', Access.ACC_TRUNC);
const buffer: Hdf5Buffer = Buffer.alloc(8 * 10 * 8);
buffer.rank = 2;
buffer.rows = 8;
buffer.columns = 10;
buffer.type = H5Type.H5T_NATIVE_DOUBLE;
for (let j: number = 0; j < buffer.columns; j++) {
for (let i: number = 0; i < buffer.rows; i++) {
if (j < (buffer.columns / 2)) {
buffer.writeDoubleLE(1.0, 8 * (i * buffer.columns + j));
}
else {
buffer.writeDoubleLE(2.0, 8 * (i * buffer.columns + j));
}
}
}
h5lt.makeDataset(file.id, 'Waldo', buffer, { maxRows: H5SType.H5S_UNLIMITED, chunkSize: 10, compression: 7 });
file.close();
and add a hint that not all functions are currently described in typescript.
from hdf5.node.
Ah good
May I use your full name in credits?
from hdf5.node.
Yes and thanks.
from hdf5.node.
btw the current waldo test and tutorial has been changed to use the options way instead of the reserved properties
You want docs on the optional maxRows: H5SType.H5S_UNLIMITED capability right? Will add.
I was asking do typescript developers know what to do? How to make developers become aware of your new dts files? I'll learn a bit to help maintain
from hdf5.node.
Great.
Should we add directly the maxDims: [-1, 100] option?
I develop in vs code, and the d.ts files are automatically recognize, so the original Javascript functions get a description and parameters get description.
from hdf5.node.
The d.ts files are like an overlay about your existing Javascript functions. So the Javascript and dts files must match, otherwise there will be Javascript errors like: undefined is not a function.
from hdf5.node.
maxDims as an array? Might be what users gravitate towards. Will look into it
from hdf5.node.
That's the same as you mentioned in #42 higher rank datasets.
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
- Error with handling variable length data (H5T_VLEN) HOT 6
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.