Coder Social home page Coder Social logo

netcdf's Introduction

netcdf

Docs Build Status Crates.io codecov Crates.io

Medium-level netCDF bindings for Rust, allowing easy reading and writing of array-like structures to a file. netCDF can read and write hdf5 files, which is a commonly used file format in scientific computing.

Status

Supported:

  • Variables
  • Normal Dimensions
  • Attributes
  • Subgroups
  • Open/Append/Create modes
  • Reading from memory
  • Unlimited dimensions
  • String variables
  • User defined types (variable length, enum, compound, opaque)

Not (yet) supported:

  • Nested user defined types
  • Writing using memory-mapped file

All variable data is read into a contiguous buffer, or into an ndarray if the ndarray feature is activated.

Building

This crate depends on libnetcdf, but a static build from source is also supported, which can be enabled using the static feature.

The crate is built on several platforms using github actions, and is currently known to build form from source on all major platforms (linux, macos, windows (gnu+msvc)), and through the package installers conda and apt.

If during compilation there is an error in building the hdf5 crate, consider using the static feature which will include a compatible version of both netcdf and hdf5. This is likely to be an issue upstream.

Building without libnetcdf or building statically

  1. git clone https://github.com/georust/netcdf
  2. git submodule update --init --recursive
  3. cargo build --features static

Documentation

Some examples of usage can be found in the tests/lib.rs file. The documentation can also be generated using cargo doc.

Thread safety

The netcdf crate is thread-safe, although the netcdf-c library is not itself threadsafe. To render a safe interface, a global mutex is used to serialize access to the underlying library. Consider using a non threadsafe version of hdf5 to avoid double locking (performance consideration).

Use of netcdf-sys is not thread-safe. Users of this library must take care that calls do not interfere with simultaneous use of e.g. netcdf. Using the hdf5-sys library could also pose a problem, as this library is used throughout netCDF-c and internal state may be disrupted.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

netcdf's People

Contributors

magnusumet avatar evomassiny avatar mhiley avatar lwandrebeck avatar samoylovfp avatar mulimoen avatar weiznich avatar richli avatar bluss avatar rezzubs avatar cbs228 avatar frewsxcv avatar joshniemela avatar

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.