Giter Club home page Giter Club logo

qnd's Introduction

Quick and Dirty (QnD): Python Binary Storage Interface

This very simple end-user-friendly API for storing numpy ndarrays in binary files is written as a frontend capable of supporting multiple backend file formats. Current backends include an h5py wrapper for HDF5 files and pure python implementations of the PDB and netCDF3 file formats. The qnd API concentrates on declaring, writing, querying, and reading numpy ndarrays (excepting dtype 'O' arrays of arbitrary python objects). Additionally, qnd maps python dicts (with str-valued keys) to HDF5 groups or PDB directories, and defines its own mapping from python lists to groups/directories with automatically generated member names of the form _0, _1, _2, etc. The support for both dict and list objects means that qnd easily handles any data structures that can be mapped to the JSON data interchange format, which is pretty nearly anything.

Another qnd innovation is a simplified interface for storing the history of changing arrays. In HDF5 or PDB or netCDF3, these are presented as arrays with an unlimited dimension, but are in fact stored in discontiguous chunks or blocks in all three cases. The qnd API, by contrast, introduces a recording mode in which writing to a variable creates its next chunk rather than overwriting its previous value. A complementary goto mode allows you to retrieve chunks in the corresponding way.

Not all backends support all of the API features; for example, the netCDF3 backend cannot handle groups or lists beyond the root group of the entire file and the lists qnd associates with record variables.

Although the qnd interface provides a very general framework for binary storage, informed by the excellent netCDF data model, in detail qnd is highly pythonic. As much as possible, qnd file, group, or list handles behave like python dicts or lists, with the same operators, iterators, and important method names as the workhorse python and numpy objects they represent.

The QND documentation is available at https://qnd.readthedocs.io/en/latest/

Authors

QnD was created by David H. Munro.

License

QnD is distributed under the terms of the BSD-3 License.

All new contributions must be made under this license.

See LICENSE and NOTICE for details.

SPDX-License-Identifier: BSD-3-Clause

Lawrence Livermore tracking ID: LLNL-CODE-807802

qnd's People

Contributors

dstrozzi avatar dhmunro avatar ryanadtran avatar

Stargazers

Aaron Brown avatar Paul G avatar Tanim Islam avatar Rex Li avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

qnd's Issues

creating attribute of root object

Not sure I use correct syntax ...

from qnd.h5f import openh5
f= openh5('q','w')
x= f.attrs()

error:

   1291     def __init__(self, parent, vname=None):
   1292         if not isinstance(parent, ProxyTypes):
-> 1293             parent = proxy(parent)
   1294         object.__setattr__(self, "_qnd_parent", parent)
   1295         object.__setattr__(self, "_qnd_vname", vname)

TypeError: cannot create weak reference to 'H5Group' object

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.