Giter VIP home page Giter VIP logo

Comments (24)

rimmartin avatar rimmartin commented on July 3, 2024

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.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

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.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

In other words this can be made seamless for prior users without breaking code they already have

from hdf5.node.

rimmartin avatar rimmartin commented on July 3, 2024

I'll work at changing to the options args for rank rows type this evening. You morning seems earlier than mine:-)

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

Legacy must also be available when someone defines chunkSize or compression in options but use the old buffer options.

from hdf5.node.

rimmartin avatar rimmartin commented on July 3, 2024

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.

NINI1988 avatar NINI1988 commented on July 3, 2024

Yes, that's fine.

from hdf5.node.

rimmartin avatar rimmartin commented on July 3, 2024

All you're doing is really strengthening this project! Thank you

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

Thank you.

But you are one who created this great module and housekeeping the code.
Thanks too.

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

What should be documented for typescript developers?

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

Ah good

May I use your full name in credits?

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

Yes and thanks.

from hdf5.node.

rimmartin avatar rimmartin commented on July 3, 2024

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.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

NINI1988 avatar NINI1988 commented on July 3, 2024

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.

rimmartin avatar rimmartin commented on July 3, 2024

maxDims as an array? Might be what users gravitate towards. Will look into it

from hdf5.node.

NINI1988 avatar NINI1988 commented on July 3, 2024

That's the same as you mentioned in #42 higher rank datasets.

from hdf5.node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.