Coder Social home page Coder Social logo

Comments (4)

shoyer avatar shoyer commented on May 16, 2024

Yes, I was pretty conflicted about the naming conventions to use. It pains me not to follow PEP8, but I also wanted to try to avoid forcing people to learn another approach.

It might make sense to have two different APIs:

  • a cleaner PEP 8 compatible API accessible via import h5netcdf
  • a legacy compatible API which is almost a drop-in replacement for netCDF4-python, importable like import h5netcdf.legacyapi as netCDF4.

But on the other hand, two API is twice the surface area for bugs....

For now, I leaned toward the later, given that in my opinion users should really use another interface like xray to write netCDF files instead of writing all the metadata themselves.

from h5netcdf.

shoyer avatar shoyer commented on May 16, 2024

As for docs, yes I need to write those :).

from h5netcdf.

mangecoeur avatar mangecoeur commented on May 16, 2024

I think two apis would not be such a big issue (with a handful of unit tests of course ;) - the number of function in the api is relatively limited and you can add straight aliases like underscore_fn_name = camelCaseFunctionName. Though personally I would simply break with the existing library, unless you have a strong preference for a drop-in replacement. I feel that this would be an opportunity to reconsider the existing API and see if it could be improved.

I don't think you can depend on higher level libraries to "hide" the API though - if (which is my use case) you need to create a netCDF file with a very specific metadata format you need to set it by hand and that's easiest to do directly with the netCDF library rather than a higher level wrapper.

from h5netcdf.

shoyer avatar shoyer commented on May 16, 2024

Just pushed changes implementing this feature to master. I'm thinking now that the main h5netcdf module will be more closely patterned off of h5py, with only the minimal adaptations necessary to make it make sense for netCDF files. If you have ideas about what the main API should look like, I'm also open to suggestions :).

The main reason I originally decided to keep with the existing API is to facilitate testing. So I'd like to keep around the legacyapi module, if only for that reason. It also makes it easier to test out this package, which is also a good thing.

I suppose you are correct that there will always be some users (e.g., library writers) who will want a lower level interface for writing netCDF files.

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.