Coder Social home page Coder Social logo

Comments (6)

shoyer avatar shoyer commented on May 29, 2024 1
  • remove _NCProperties when appending invalid netcdf data to an existing file

This solution sounds good to me!

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on May 29, 2024

It looks like this behavior is there for a very long time.

There are at least two solutions to this problem:

  • do not allow appending invalid netcdf data to a NetCDF4 conforming file (having _NCProperties), allow only newly created files with invalid netcdf data (they will miss the _NCProperties
  • remove _NCProperties when appending invalid netcdf data to an existing file

As writing of invalid netcdf data can only happen if invoked with invalid_netcdf=True the users should know what they are doing so I would go for the second approach removing an existing _NCProperties.

@shoyer It would be great if you could share your thoughts on that issue.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on May 29, 2024

Please have a look at a possible fix in #166.

We do not write _NCProperties when creating a file from scratch with invalid netcdf features. So it is fitting to assume that we should remove _NCProperties when writing invalid netcdf features to an existing (valid) file.

As users might still use .nc extension when writing invalid netcdf features a UserWarning is displayed:

UserWarning: You are writing invalid netcdf features to file test.nc. The file will thus be not conforming to NetCDF-4 standard and might not be readable by other netcdf tools. Consider using a different extension.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on May 29, 2024

I've opened a discussion over at unidata: How does netcdf-c recognize netCDF4 format.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on May 29, 2024

Thanks Stephan, much appreciated.

from h5netcdf.

kmuehlbauer avatar kmuehlbauer commented on May 29, 2024

fixed in #166

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.