Giter Site home page Giter Site logo

Comments (5)

kmuehlbauer avatar kmuehlbauer commented on June 26, 2024

@adam2392 Thanks for raising this. A pure h5netcdf MCVE would be nice nevertheless.

For NetCDF4 data model

Attributes are always scalar values or 1D arrays, which can be associated with either a variable or the file as a whole. Although there is no enforced limit, the user is expected to keep attributes small.

So this means that this would be a non-standard usage which h5netcdf could only support using invalid_netcdf keyword arg.

Also HDF5 speaks of Attributes as small datasets.

How small is "small" is not defined by the library and is up to the user’s interpretation.

As the request is not conforming to the NetCDF4 standard I'm inclined to keep the current behavior. You might go the suggested way (HDF5-link above) of adding the data as another variable with an attribute pointing to it.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on June 26, 2024

Xref: mne-tools/mne-connectivity#87

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on June 26, 2024

After reading the discussion over at mne-tools/mne-connectivity#87 I think I might be missing a bit of context.

@adam2392 In the mne-connectivity docs the output format is mentioned as NetCDF. What you request would finally create non-standard NetCDF files. Maybe I'm missing something. Could you shed some light?

from h5netcdf.

shoyer avatar shoyer commented on June 26, 2024

It isn't possible to directly put arbitrary NumPy object arrays into HDF5 files, because these can contain arbitrary Python objects that may not be supported by HDF5.

If desired, arbitrary Python objects could be serialized into bytes with pickle. But this would not be appropriate for h5netcdf unless users need to explicitly opt-in each time they open a file with pickle support (e.g., by specifying something like allow_pickle=True), because deserializing pickle data allows arbitrary code execution.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on June 26, 2024

I'm closing this as wont-fix. If there is more discussion needed, please reopen @adam2392.

from h5netcdf.

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.