rabacus.hdf5 package

Submodules

rabacus.hdf5.h5py_wrap module

Simple convenience functions to access the h5py library.

rabacus.hdf5.h5py_wrap.ra(fname, path, name)[source]

Read Attribute. Return a single attribute called <name> associated with a group or dataset located at <path> in file <fname>. e.g. ra( fname, ‘/PartType0/Coordinates’, ‘h-scale-exponent’ ).

rabacus.hdf5.h5py_wrap.raa(fname, path)[source]

Read All Attributes. Return a dictionary of all attributes associated with a group or dataset located at <path> in file <fname>. e.g. ra( fname, ‘/PartType0/Coordinates’ ).

rabacus.hdf5.h5py_wrap.rd(fname, path, dtype=None)[source]

Read Data. Return a dataset located at <path> in file <fname> as a numpy array. e.g. rd( fname, ‘/PartType0/Coordinates’ ).

rabacus.hdf5.h5py_wrap.wd(fname, path, name, buf, attrs=None, overwrite=False)[source]

Write Data. Write a dataset stored in <buf> to hdf5 file <fname> at location <path>/<name>. Optionally a dictionary of attributes can be provided which will be written with the dataset. e.g. wd( fname, ‘/PartType0’, ‘Coordinates’, pos [,attrs] ).

rabacus.hdf5.h5py_wrap.wa(fname, path, name, buf)[source]

Write Attribute. Write a single attribute stored in <buf> called <name> associated with a group or dataset located at <path> in file <fname>. e.g. wa( fname, ‘/PartType0/Coordinates’, ‘h-scale-exponent’, -1.0 ).

rabacus.hdf5.h5py_wrap.cg(fname, path)[source]

Create Group. Creates a group at <path> in file <fname>. e.g. cg( fname, ‘/PartType0’ ).

Module contents