openpathsampling.netcdfplus.netcdfplus.NetCDFPlus

class openpathsampling.netcdfplus.netcdfplus.NetCDFPlus(filename, mode=None, fallback=None)[source]

Extension of the python netCDF wrapper for easier storage of python objects

__init__(filename, mode=None, fallback=None)[source]

Create a storage for complex objects in a netCDF file

Parameters
  • filename (string) – filename of the netcdf file to be used or created

  • mode (str) – the mode of file creation, one of ‘w’ (write), ‘a’ (append) or ‘r’ (read-only) None, which will append any existing files (equal to append), is the default.

  • fallback (openpathsampling.Storage) – the _fallback_ storage to be loaded from if an object is not present in this storage. By default you will not try to resave objects that could be found in the fallback. Note that the fall back does only work if use_uuid is enabled

Notes

A single file can be opened by multiple storages, but only one can be used for writing

Methods

__init__(filename[, mode, fallback])

Create a storage for complex objects in a netCDF file

cache_image()

Return an dict containing information about all caches

check_version()

close

`close(self)`

createCompoundType

`createCompoundType(self, datatype, datatype_name)`

createDimension

`createDimension(self, dimname, size=None)`

createEnumType

`createEnumType(self, datatype, datatype_name, enum_dict)`

createGroup

`createGroup(self, groupname)`

createVLType

`createVLType(self, datatype, datatype_name)`

createVariable

`createVariable(self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian=’native’, least_significant_digit=None, fill_value=None, chunk_cache=None)`

create_dimension(dim_name[, size])

Initialize a new dimension in the storage.

create_store(name, store[, register_attr])

Create a special variable type obj.name that can hold storable objects

create_type_delegate(var_type)

Create a variable value delegator for var_type

create_variable(var_name, var_type, dimensions)

Create a new variable in the netCDF storage.

create_variable_delegate(var_name)

Create a delegate property that wraps the netcdf.Variable and takes care of type conversions

delncattr

`delncattr(self,name,value)`

filepath

`filepath(self,encoding=None)`

finalize_stores()

Run initializations for all added stores.

find_store(obj)

Return the default store used for an storable object

fromcdl

`fromcdl(cdlfilename, ncfilename=None, mode=’a’,format=’NETCDF4’)`

get_value_parameters(value)

Compute netcdfplus compatible parameters to store a value

get_var_types()

List all allowed variable type to be used in create_variable

get_variables_by_attributes

`get_variables_by_attribute(self, **kwargs)`

getncattr

`getncattr(self,name)`

identify_var_type(instance)

Identify common python and numpy types

idx(obj)

Return the index used to store the given object in this storage

isopen

`close(self)`

list_storable_objects()

Return a list of storable object base classes

list_stores()

Return a list of registered stores

load(uuid)

Load an object from the storage

ncattrs

`ncattrs(self)`

register_store(name, store[, register_attr])

Add a object store to the file

renameAttribute

`renameAttribute(self, oldname, newname)`

renameDimension

`renameDimension(self, oldname, newname)`

renameGroup

`renameGroup(self, oldname, newname)`

renameVariable

`renameVariable(self, oldname, newname)`

repr_json(obj)

Return the JSON representation in the storage if available

save(obj[, idx])

Save a storable object into the correct Storage in the netCDF file

set_always_mask

`set_always_mask(self, True_or_False)`

set_auto_chartostring

`set_auto_chartostring(self, True_or_False)`

set_auto_mask

`set_auto_mask(self, True_or_False)`

set_auto_maskandscale

`set_auto_maskandscale(self, True_or_False)`

set_auto_scale

`set_auto_scale(self, True_or_False)`

set_fill_off

`set_fill_off(self)`

set_fill_on

`set_fill_on(self)`

set_ncstring_attrs

`set_ncstring_attrs(self, True_or_False)`

setncattr

`setncattr(self,name,value)`

setncattr_string

`setncattr_string(self,name,value)`

setncatts

`setncatts(self,attdict)`

sync

`sync(self)`

to_uuid_chunks(x)

tocdl

`tocdl(self, coordvars=False, data=False, outfile=None)`

update_delegates()

Updates the set of delegates in self.vars

update_storable_classes()

var_type_to_nc_type(var_type)

Return the compatible netCDF variable type for var_type

write_meta()

Attributes

cmptypes

data_model

dimensions

disk_format

enumtypes

file_format

file_size

file_size_str

filename

groups

keepweakref

name

string name of Group instance

objects

Return a dictionary of all objects stored.

parent

path

support_simtk_unit

variables

vltypes