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

Reading attributes from datasets returns weird results #52

Closed
bsrdjan opened this issue Jan 26, 2018 · 14 comments
Closed

Reading attributes from datasets returns weird results #52

bsrdjan opened this issue Jan 26, 2018 · 14 comments

Comments

@bsrdjan
Copy link

bsrdjan commented Jan 26, 2018

The same issue like for groups attributes (#28), I am facing for dataset attributes, get values which look corrupted. I can provide the sample and more info if needed?

@rimmartin
Copy link
Collaborator

Yea anything that gives me an idea of what is going on would help; I will work on this project on the weekend(work days are loaded)

@rimmartin
Copy link
Collaborator

It's an array of variable sized strings?

@bsrdjan
Copy link
Author

bsrdjan commented Jan 26, 2018

Thank you so much @rimmartin for your work on this module and fast response.

Please find sample data attached and the output of reading attribute with group.getDatasetAttributes:

scada/active_power
{ initial_time: '�c@\u0003\u0001',
  time_step: '�`@\u0003\u0001',
  unit: '�w@\u0003\u0001' }

scada/generator_speed
{ initial_time: '��@\u0003\u0001',
  time_step: '',
  unit: 'P�@\u0003\u0001' }

sample.zip

@rimmartin
Copy link
Collaborator

Ok, we'll see over the weekend

@rimmartin
Copy link
Collaborator

It's reading from your sample.h5 now. Thanks for it. I haven't published to npm yet; you can use "hdf5": "HDF-NI/hdf5.node", in your project's package.json to pull it from github. If you need it published I'll do it in the next couple of days.

@bsrdjan
Copy link
Author

bsrdjan commented Jan 29, 2018

Thanks @rimmartin, experimental release is just fine.

Installation works on Linux and fails on OSX, probably because of the compiler flag required for "mac":

../src/h5_file.cc:201:22: error: extra tokens at end of #ifdef directive [-Werror,-Wextra-tokens]
#ifdef  H5_VERSION_GE(1,10,0)
                     ^
                     //
1 error generated.

@rimmartin
Copy link
Collaborator

rimmartin commented Jan 29, 2018

Ah that is something new I was adding for Single-Write-Multi-Read enabling for 1.10.x versions; I'll test on a mac tonight as well if it skips that code for 1.8.x version of node

@rimmartin
Copy link
Collaborator

I commented the #ifdef H5_VERSION_GE(1,10,0) segement temporarily so it should build on darwin

@bsrdjan
Copy link
Author

bsrdjan commented Jan 30, 2018

Thank you @rimmartin . I tested and got following output on Mac now:

  CXX(target) Release/obj.target/hdf5/src/h5_group.o
  SOLINK_MODULE(target) Release/h5im.node
  SOLINK_MODULE(target) Release/h5pt.node
  SOLINK_MODULE(target) Release/h5ds.node
../src/methods.cc:581:40: error: unused variable 'idx' [-Werror,-Wunused-variable]
      hsize_t                          idx = args[0]->Int32Value();
                                       ^
../src/methods.cc:583:36: error: unused variable 'argc' [-Werror,-Wunused-variable]
      const unsigned               argc = 2;
                                   ^
2 errors generated.
make: *** [Release/obj.target/hdf5/src/methods.o] Error 1
make: *** Waiting for unfinished jobs....
../src/h5_file.cc:201:11: error: unused variable 'file' [-Werror,-Wunused-variable]
    File* file = ObjectWrap::Unwrap<File>(args.This());
          ^
1 error generated.

@rimmartin
Copy link
Collaborator

ah warnings are set to error; let me comment that out or move it within the commneted segment...

@rimmartin
Copy link
Collaborator

pushed another try

@rimmartin
Copy link
Collaborator

oh there are more ok wait ...

@rimmartin
Copy link
Collaborator

ok got all three

@bsrdjan
Copy link
Author

bsrdjan commented Jan 30, 2018

Thanks, it works for me now, both the installation and dataset attributes reading.

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