Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for opening file from memory #652

Merged
merged 12 commits into from
May 1, 2017
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
version 1.2.8a0 (tag XXXX)
===========================
* add Dataset init memory parameter to allow loading a file from memory

version 1.2.7 (tag v1.2.7rel)
==============================
* fix for issue #624 (error in conversion to masked array when variable slice
Expand Down
1 change: 1 addition & 0 deletions include/constants.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ DEF HAS_RENAME_GRP = 0
DEF HAS_NC_INQ_PATH = 0
DEF HAS_NC_INQ_FORMAT_EXTENDED = 0
DEF HAS_CDF5_FORMAT = 0
DEF HAS_NC_OPEN_MEM = 0
1 change: 1 addition & 0 deletions include/netCDF4.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ cdef extern from "netcdf.h":
int nc_create(char *path, int cmode, int *ncidp)
int nc__create(char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp)
int nc_open(char *path, int mode, int *ncidp)
int nc_open_mem(const char *path, int mode, size_t size, void* memory, int *ncidp)
int nc__open(char *path, int mode, size_t *chunksizehintp, int *ncidp)
int nc_inq_path(int ncid, size_t *pathlen, char *path) nogil
int nc_inq_format_extended(int ncid, int *formatp, int* modep) nogil
Expand Down
2 changes: 1 addition & 1 deletion netCDF4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from ._netCDF4 import __doc__, __pdoc__
from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__,
__has_rename_grp__, __has_nc_inq_path__,
__has_nc_inq_format_extended__)
__has_nc_inq_format_extended__, __has_nc_open_mem__)
__all__ =\
['Dataset','Variable','Dimension','Group','MFDataset','MFTime','CompoundType','VLType','date2num','num2date','date2index','stringtochar','chartostring','stringtoarr','getlibversion','EnumType']
Loading