From 835ca41af80f0f2287f19a0c2f2b476cf046d611 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 22 Mar 2019 13:43:09 -0600 Subject: [PATCH 1/6] prepare for v1.5.0 release --- README.md | 3 +++ netCDF4/_netCDF4.pyx | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e90abf56..7840d41f0 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ ## News For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). +03/24/2019: Version [1.5.0](https://pypi.python.org/pypi/netCDF4/1.5.0) released. Parallel IO support for classic +file formats added using the pnetcdf library (contribution from Lars Pastewka, [pull request #897](https://github.com/Unidata/netcdf4-python/pull/897). + 03/08/2019: Version [1.4.3.2](https://pypi.python.org/pypi/netCDF4/1.4.3.2) released. Include missing membuf.pyx file in source tarball. No need to update if you installed 1.4.3.1 from a binary wheel. diff --git a/netCDF4/_netCDF4.pyx b/netCDF4/_netCDF4.pyx index 29563c290..32accb8ad 100644 --- a/netCDF4/_netCDF4.pyx +++ b/netCDF4/_netCDF4.pyx @@ -1190,7 +1190,7 @@ except ImportError: # python3: zip is already python2's itertools.izip pass -__version__ = "1.4.3.2" +__version__ = "1.5.0" # Initialize numpy import posixpath diff --git a/setup.py b/setup.py index 8f1ade563..1b273526c 100644 --- a/setup.py +++ b/setup.py @@ -584,7 +584,7 @@ def _populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs): setup(name="netCDF4", cmdclass=cmdclass, - version="1.4.3.2", + version="1.5.0", long_description="netCDF version 4 has many features not found in earlier versions of the library, such as hierarchical groups, zlib compression, multiple unlimited dimensions, and new data types. It is implemented on top of HDF5. This module implements most of the new features, and can read and write netCDF files compatible with older versions of the library. The API is modelled after Scientific.IO.NetCDF, and should be familiar to users of that module.\n\nThis project is hosted on a `GitHub repository `_ where you may access the most up-to-date source.", author="Jeff Whitaker", author_email="jeffrey.s.whitaker@noaa.gov", From 4bfa2356adc9dc0c3380103a7412d2ef1a145d33 Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 22 Mar 2019 13:46:56 -0600 Subject: [PATCH 2/6] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7840d41f0..d39a787af 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog). 03/24/2019: Version [1.5.0](https://pypi.python.org/pypi/netCDF4/1.5.0) released. Parallel IO support for classic -file formats added using the pnetcdf library (contribution from Lars Pastewka, [pull request #897](https://github.com/Unidata/netcdf4-python/pull/897). +file formats added using the pnetcdf library (contribution from Lars Pastewka, [pull request #897](https://github.com/Unidata/netcdf4-python/pull/897)). 03/08/2019: Version [1.4.3.2](https://pypi.python.org/pypi/netCDF4/1.4.3.2) released. Include missing membuf.pyx file in source tarball. No need to update if you installed From 7fe713b2becde6f97d25429a6daf8a34f3e801dc Mon Sep 17 00:00:00 2001 From: Jeff Whitaker Date: Fri, 22 Mar 2019 13:59:17 -0600 Subject: [PATCH 3/6] update docs --- docs/netCDF4/index.html | 731 ++++++++++------------------------------ 1 file changed, 170 insertions(+), 561 deletions(-) diff --git a/docs/netCDF4/index.html b/docs/netCDF4/index.html index ce921ebca..e4a3c6fb9 100644 --- a/docs/netCDF4/index.html +++ b/docs/netCDF4/index.html @@ -1174,6 +1174,8 @@

Index

@@ -1335,9 +1335,10 @@

Requires

If you want OPeNDAP support, add --enable-dap. If you want HDF4 SD support, add --enable-hdf4 and add the location of the HDF4 headers and library to $CPPFLAGS and $LDFLAGS. -
  • for MPI parallel IO support, MPI-enabled versions of the HDF5 and netcdf - libraries are required, as is the mpi4py python - module.
  • +
  • for MPI parallel IO support, an MPI-enabled versions of the netcdf library + is required, as is the mpi4py python module. + Parallel IO further depends on the existence of MPI-enabled HDF5 or the + PnetCDF library.
  • Install

      @@ -2151,13 +2152,14 @@

      12) Enum data type.

      13) Parallel IO.

      -

      If MPI parallel enabled versions of netcdf and hdf5 are detected, and -mpi4py is installed, netcdf4-python will -be built with parallel IO capabilities enabled. Since parallel IO -uses features of HDF5, it can only be used with NETCDF4 or -NETCDF4_CLASSIC formatted files. To use parallel IO, -your program must be running in an MPI environment using -mpi4py.

      +

      If MPI parallel enabled versions of netcdf and hdf5 or pnetcdf are detected, +and mpi4py is installed, netcdf4-python will +be built with parallel IO capabilities enabled. Parallel IO of NETCDF4 or +NETCDF4_CLASSIC formatted files is only available if the MPI parallel HDF5 +library is available. Parallel IO of classic netcdf-3 file formats is only +available if the PnetCDF library is +available. To use parallel IO, your program must be running in an MPI +environment using mpi4py.

      >>> from mpi4py import MPI
       >>> import numpy as np
       >>> from netCDF4 import Dataset
      @@ -2204,9 +2206,12 @@ 

      13) Parallel IO.

      the two types of IO, use the set_collective Variablemethod. All metadata operations (such as creation of groups, types, variables, dimensions, or attributes) -are collective. There are a couple of important limitatons of parallel IO:

      +are collective. There are a couple of important limitations of parallel IO:

        -
      • only works with NETCDF4 or NETCDF4_CLASSIC formatted files.
      • +
      • parallel IO for NETCDF4 or NETCDF4_CLASSIC formatted files is only available + if the netcdf library was compiled with MPI enabled HDF5.
      • +
      • parallel IO for all classic netcdf-3 file formats is only available if the + netcdf library was compiled with PnetCDF.
      • If a variable has an unlimited dimension, appending data must be done in collective mode. If the write is done in independent mode, the operation will fail with a a generic "HDF Error".
      • @@ -2616,7 +2621,7 @@

        Classes

        Ancestors (in MRO)

        Class variables

        @@ -2747,7 +2752,7 @@

        Static methods

        Ancestors (in MRO)

        • Dataset
        • -
        • __builtin__.object
        • +
        • builtins.object

        Class variables

        @@ -3669,7 +3674,7 @@

        Static methods

        Ancestors (in MRO)

        • Dimension
        • -
        • __builtin__.object
        • +
        • builtins.object

        Class variables

        @@ -3767,7 +3772,7 @@

        Static methods

        Ancestors (in MRO)

        • EnumType
        • -
        • __builtin__.object
        • +
        • builtins.object

        Class variables

        @@ -3855,22 +3860,15 @@

        Ancestors (in MRO)

        Class variables

        var cmptypes

        -

        - Inheritance: - Dataset.cmptypes -

        -

        The cmptypes dictionary maps the names of -compound types defined for the Group or Dataset to instances of the -CompoundType class.

        @@ -3878,16 +3876,9 @@

        Class variables

        var data_model

        -

        - Inheritance: - Dataset.data_model -

        -

        data_model describes the netCDF -data model version, one of NETCDF3_CLASSIC, NETCDF4, -NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

        @@ -3895,16 +3886,9 @@

        Class variables

        var dimensions

        -

        - Inheritance: - Dataset.dimensions -

        -

        The dimensions dictionary maps the names of -dimensions defined for the Group or Dataset to instances of the -Dimension class.

        @@ -3912,18 +3896,9 @@

        Class variables

        var disk_format

        -

        - Inheritance: - Dataset.disk_format -

        -

        disk_format describes the underlying -file format, one of NETCDF3, HDF5, HDF4, -PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using -netcdf C library version >= 4.3.1, otherwise will always return -UNDEFINED.

        @@ -3931,16 +3906,9 @@

        Class variables

        var enumtypes

        -

        - Inheritance: - Dataset.enumtypes -

        -

        The enumtypes dictionary maps the names of -Enum types defined for the Group or Dataset to instances of the -EnumType class.

        @@ -3948,14 +3916,9 @@

        Class variables

        var file_format

        -

        - Inheritance: - Dataset.file_format -

        -

        same as data_model, retained for backwards compatibility.

        @@ -3963,17 +3926,9 @@

        Class variables

        var groups

        -

        - Inheritance: - Dataset.groups -

        -

        The groups dictionary maps the names of groups created for -this Dataset or Group to instances of the Group class (the -Dataset class is simply a special case of the Group class which -describes the root group in the netCDF4 file).

        @@ -3981,15 +3936,9 @@

        Class variables

        var keepweakref

        -

        - Inheritance: - Dataset.keepweakref -

        -

        If True, child Dimension and Variables objects only keep weak references to -the parent Dataset or Group.

        @@ -4008,15 +3957,9 @@

        Class variables

        var parent

        -

        - Inheritance: - Dataset.parent -

        -

        parent is a reference to the parent -Group instance. None for the root group or Dataset instance

        @@ -4024,17 +3967,9 @@

        Class variables

        var path

        -

        - Inheritance: - Dataset.path -

        -

        path shows the location of the Group in -the Dataset in a unix directory format (the names of groups in the -hierarchy separated by backslashes). A Dataset instance is the root -group, so the path is simply '/'.

        @@ -4042,16 +3977,9 @@

        Class variables

        var variables

        -

        - Inheritance: - Dataset.variables -

        -

        The variables dictionary maps the names of variables -defined for this Dataset or Group to instances of the Variable -class.

        @@ -4059,16 +3987,9 @@

        Class variables

        var vltypes

        -

        - Inheritance: - Dataset.vltypes -

        -

        The vltypes dictionary maps the names of -variable-length types defined for the Group or Dataset to instances of the -VLType class.

        @@ -4105,10 +4026,6 @@

        Static methods

        def close(

        self)

        -

        - Inheritance: - Dataset.close -

        @@ -4125,14 +4042,10 @@

        Static methods

        def createCompoundType(

        self, datatype, datatype_name)

        -

        - Inheritance: - Dataset.createCompoundType -

        -

        Creates a new compound data type named datatype_name from the numpy +

        Creates a new compound data type named datatype_name from the numpy dtype object datatype.

        Note: If the new compound data type contains other compound data types (i.e. it is a 'nested' compound type, where not all of the elements @@ -4151,14 +4064,10 @@

        Static methods

        def createDimension(

        self, dimname, size=None)

        -

        - Inheritance: - Dataset.createDimension -

        -

        Creates a new dimension with the given dimname and size.

        +

        Creates a new dimension with the given dimname and size.

        size must be a positive integer or None, which stands for "unlimited" (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the Dimension @@ -4177,14 +4086,10 @@

        Static methods

        def createEnumType(

        self, datatype, datatype_name, enum_dict)

        -

        - Inheritance: - Dataset.createEnumType -

        -

        Creates a new Enum data type named datatype_name from a numpy +

        Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.

        The return value is the EnumType class instance describing the new @@ -4200,14 +4105,10 @@

        Static methods

        def createGroup(

        self, groupname)

        -

        - Inheritance: - Dataset.createGroup -

        -

        Creates a new Group with the given groupname.

        +

        Creates a new Group with the given groupname.

        If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analogous to mkdir -p in unix). For example, @@ -4227,14 +4128,10 @@

        Static methods

        def createVLType(

        self, datatype, datatype_name)

        -

        - Inheritance: - Dataset.createVLType -

        -

        Creates a new VLEN data type named datatype_name from a numpy +

        Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.

        The return value is the VLType class instance describing the new datatype.

        @@ -4249,14 +4146,10 @@

        Static methods

        def 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)

        -

        - Inheritance: - Dataset.createVariable -

        -

        Creates a new variable with the given varname, datatype, and +

        Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.

        If varname is specified as a path, using forward slashes as in unix to @@ -4366,14 +4259,10 @@

        Static methods

        def delncattr(

        self,name,value)

        -

        - Inheritance: - Dataset.delncattr -

        -

        delete a netCDF dataset or group attribute. Use if you need to delete a +

        delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

        @@ -4387,14 +4276,10 @@

        Static methods

        def filepath(

        self,encoding=None)

        -

        - Inheritance: - Dataset.filepath -

        -

        Get the file system path (or the opendap URL) which was used to +

        Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2. The path is decoded into a string using sys.getfilesystemencoding() by default, this can be changed using the encoding kwarg.

        @@ -4409,14 +4294,10 @@

        Static methods

        def get_variables_by_attributes(

        ...)

        -

        - Inheritance: - Dataset.get_variables_by_attributes -

        -

        Returns a list of variables that match specific conditions.

        +

        Returns a list of variables that match specific conditions.

        Can pass in key=value parameters and variables are returned that contain all of the matches. For example,

        >>> # Get variables with x-axis attribute.
        @@ -4448,14 +4329,10 @@ 

        Static methods

        def getncattr(

        self,name)

        -

        - Inheritance: - Dataset.getncattr -

        -

        retrieve a netCDF dataset or group attribute. +

        retrieve a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.

        option kwarg encoding can be used to specify the @@ -4471,14 +4348,10 @@

        Static methods

        def isopen(

        ...)

        -

        - Inheritance: - Dataset.isopen -

        -

        is the Dataset open or closed?

        +

        is the Dataset open or closed?

        @@ -4490,14 +4363,10 @@

        Static methods

        def ncattrs(

        self)

        -

        - Inheritance: - Dataset.ncattrs -

        -

        return netCDF global attribute names for this Dataset or Group in a list.

        +

        return netCDF global attribute names for this Dataset or Group in a list.

        @@ -4509,14 +4378,10 @@

        Static methods

        def renameAttribute(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameAttribute -

        -

        rename a Dataset or Group attribute named oldname to newname.

        +

        rename a Dataset or Group attribute named oldname to newname.

        @@ -4528,14 +4393,10 @@

        Static methods

        def renameDimension(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameDimension -

        -

        rename a Dimension named oldname to newname.

        +

        rename a Dimension named oldname to newname.

        @@ -4547,14 +4408,10 @@

        Static methods

        def renameGroup(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameGroup -

        -

        rename a Group named oldname to newname (requires netcdf >= 4.3.1).

        +

        rename a Group named oldname to newname (requires netcdf >= 4.3.1).

        @@ -4566,14 +4423,10 @@

        Static methods

        def renameVariable(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameVariable -

        -

        rename a Variable named oldname to newname

        +

        rename a Variable named oldname to newname

        @@ -4585,14 +4438,10 @@

        Static methods

        def set_always_mask(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_always_mask -

        -

        Call set_always_mask for all variables contained in +

        Call set_always_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion of @@ -4612,14 +4461,10 @@

        Static methods

        def set_auto_chartostring(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_chartostring -

        -

        Call set_auto_chartostring for all variables contained in this Dataset or +

        Call set_auto_chartostring for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion of all character arrays <--> string arrays should be performed for @@ -4638,14 +4483,10 @@

        Static methods

        def set_auto_mask(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_mask -

        -

        Call set_auto_mask for all variables contained in this Dataset or +

        Call set_auto_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.

        @@ -4662,14 +4503,10 @@

        Static methods

        def set_auto_maskandscale(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_maskandscale -

        -

        Call set_auto_maskandscale for all variables contained in this Dataset or +

        Call set_auto_maskandscale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.

        @@ -4686,14 +4523,10 @@

        Static methods

        def set_auto_scale(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_scale -

        -

        Call set_auto_scale for all variables contained in this Dataset or +

        Call set_auto_scale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic variable scaling shall be applied for all variables.

        @@ -4710,14 +4543,10 @@

        Static methods

        def set_fill_off(

        self)

        -

        - Inheritance: - Dataset.set_fill_off -

        -

        Sets the fill mode for a Dataset open for writing to off.

        +

        Sets the fill mode for a Dataset open for writing to off.

        This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.

        @@ -4732,14 +4561,10 @@

        Static methods

        def set_fill_on(

        self)

        -

        - Inheritance: - Dataset.set_fill_on -

        -

        Sets the fill mode for a Dataset open for writing to on.

        +

        Sets the fill mode for a Dataset open for writing to on.

        This causes data to be pre-filled with fill values. The fill values can be controlled by the variable's _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined @@ -4758,14 +4583,10 @@

        Static methods

        def set_ncstring_attrs(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_ncstring_attrs -

        -

        Call set_ncstring_attrs for all variables contained in +

        Call set_ncstring_attrs for all variables contained in this Dataset or Group, as well as for all its subgroups and their variables.

        True_or_False: Boolean determining if all string attributes are @@ -4784,14 +4605,10 @@

        Static methods

        def setncattr(

        self,name,value)

        -

        - Inheritance: - Dataset.setncattr -

        -

        set a netCDF dataset or group attribute using name,value pair. +

        set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.

        @@ -4805,14 +4622,10 @@

        Static methods

        def setncattr_string(

        self,name,value)

        -

        - Inheritance: - Dataset.setncattr_string -

        -

        set a netCDF dataset or group string attribute using name,value pair. +

        set a netCDF dataset or group string attribute using name,value pair. Use if you need to ensure that a netCDF attribute is created with type NC_STRING if the file format is NETCDF4.

        @@ -4826,14 +4639,10 @@

        Static methods

        def setncatts(

        self,attdict)

        -

        - Inheritance: - Dataset.setncatts -

        -

        set a bunch of netCDF dataset or group attributes at once using a python dictionary. +

        set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

        @@ -4848,14 +4657,10 @@

        Static methods

        def sync(

        self)

        -

        - Inheritance: - Dataset.sync -

        -

        Writes all buffered data in the Dataset to the disk file.

        +

        Writes all buffered data in the Dataset to the disk file.

        @@ -4900,22 +4705,15 @@

        Ancestors (in MRO)

        Class variables

        var cmptypes

        -

        - Inheritance: - Dataset.cmptypes -

        -

        The cmptypes dictionary maps the names of -compound types defined for the Group or Dataset to instances of the -CompoundType class.

        @@ -4923,16 +4721,9 @@

        Class variables

        var data_model

        -

        - Inheritance: - Dataset.data_model -

        -

        data_model describes the netCDF -data model version, one of NETCDF3_CLASSIC, NETCDF4, -NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.

        @@ -4940,16 +4731,9 @@

        Class variables

        var dimensions

        -

        - Inheritance: - Dataset.dimensions -

        -

        The dimensions dictionary maps the names of -dimensions defined for the Group or Dataset to instances of the -Dimension class.

        @@ -4957,18 +4741,9 @@

        Class variables

        var disk_format

        -

        - Inheritance: - Dataset.disk_format -

        -

        disk_format describes the underlying -file format, one of NETCDF3, HDF5, HDF4, -PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using -netcdf C library version >= 4.3.1, otherwise will always return -UNDEFINED.

        @@ -4976,16 +4751,9 @@

        Class variables

        var enumtypes

        -

        - Inheritance: - Dataset.enumtypes -

        -

        The enumtypes dictionary maps the names of -Enum types defined for the Group or Dataset to instances of the -EnumType class.

        @@ -4993,14 +4761,9 @@

        Class variables

        var file_format

        -

        - Inheritance: - Dataset.file_format -

        -

        same as data_model, retained for backwards compatibility.

        @@ -5008,17 +4771,9 @@

        Class variables

        var groups

        -

        - Inheritance: - Dataset.groups -

        -

        The groups dictionary maps the names of groups created for -this Dataset or Group to instances of the Group class (the -Dataset class is simply a special case of the Group class which -describes the root group in the netCDF4 file).

        @@ -5026,15 +4781,9 @@

        Class variables

        var keepweakref

        -

        - Inheritance: - Dataset.keepweakref -

        -

        If True, child Dimension and Variables objects only keep weak references to -the parent Dataset or Group.

        @@ -5042,15 +4791,9 @@

        Class variables

        var parent

        -

        - Inheritance: - Dataset.parent -

        -

        parent is a reference to the parent -Group instance. None for the root group or Dataset instance

        @@ -5058,17 +4801,9 @@

        Class variables

        var path

        -

        - Inheritance: - Dataset.path -

        -

        path shows the location of the Group in -the Dataset in a unix directory format (the names of groups in the -hierarchy separated by backslashes). A Dataset instance is the root -group, so the path is simply '/'.

        @@ -5076,16 +4811,9 @@

        Class variables

        var variables

        -

        - Inheritance: - Dataset.variables -

        -

        The variables dictionary maps the names of variables -defined for this Dataset or Group to instances of the Variable -class.

        @@ -5093,16 +4821,9 @@

        Class variables

        var vltypes

        -

        - Inheritance: - Dataset.vltypes -

        -

        The vltypes dictionary maps the names of -variable-length types defined for the Group or Dataset to instances of the -VLType class.

        @@ -5110,18 +4831,74 @@

        Class variables

        Static methods

        -
        -

        def createCompoundType(

        self, datatype, datatype_name)

        +
        +

        def __init__(

        self, files, check=False, aggdim=None, exclude=[], master_file=None)

        Inheritance: - Dataset.createCompoundType + Dataset.__init__

        -

        Creates a new compound data type named datatype_name from the numpy +

        __init__(self, files, check=False, aggdim=None, exclude=[], +master_file=None)

        +

        Open a Dataset spanning multiple files, making it look as if it was a +single file. Variables in the list of files that share the same +dimension (specified with the keyword aggdim) are aggregated. If +aggdim is not specified, the unlimited is aggregated. Currently, +aggdim must be the leftmost (slowest varying) dimension of each +of the variables to be aggregated.

        +

        files: either a sequence of netCDF files or a string with a +wildcard (converted to a sorted list of files using glob) If +the master_file kwarg is not specified, the first file +in the list will become the "master" file, defining all the +variables with an aggregation dimension which may span +subsequent files. Attribute access returns attributes only from "master" +file. The files are always opened in read-only mode.

        +

        check: True if you want to do consistency checking to ensure the +correct variables structure for all of the netcdf files. Checking makes +the initialization of the MFDataset instance much slower. Default is +False.

        +

        aggdim: The name of the dimension to aggregate over (must +be the leftmost dimension of each of the variables to be aggregated). +If None (default), aggregate over the unlimited dimension.

        +

        exclude: A list of variable names to exclude from aggregation. +Default is an empty list.

        +

        master_file: file to use as "master file", defining all the +variables with an aggregation dimension and all global attributes.

        +
        +
        + +
        + + +
        +
        +

        def close(

        self)

        +
        + + + + +

        close(self)

        +

        close all the open files.

        +
        +
        + +
        + + +
        +
        +

        def createCompoundType(

        self, datatype, datatype_name)

        +
        + + + + +

        Creates a new compound data type named datatype_name from the numpy dtype object datatype.

        Note: If the new compound data type contains other compound data types (i.e. it is a 'nested' compound type, where not all of the elements @@ -5140,14 +4917,10 @@

        Static methods

        def createDimension(

        self, dimname, size=None)

        -

        - Inheritance: - Dataset.createDimension -

        -

        Creates a new dimension with the given dimname and size.

        +

        Creates a new dimension with the given dimname and size.

        size must be a positive integer or None, which stands for "unlimited" (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the Dimension @@ -5166,14 +4939,10 @@

        Static methods

        def createEnumType(

        self, datatype, datatype_name, enum_dict)

        -

        - Inheritance: - Dataset.createEnumType -

        -

        Creates a new Enum data type named datatype_name from a numpy +

        Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.

        The return value is the EnumType class instance describing the new @@ -5189,14 +4958,10 @@

        Static methods

        def createGroup(

        self, groupname)

        -

        - Inheritance: - Dataset.createGroup -

        -

        Creates a new Group with the given groupname.

        +

        Creates a new Group with the given groupname.

        If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analogous to mkdir -p in unix). For example, @@ -5216,14 +4981,10 @@

        Static methods

        def createVLType(

        self, datatype, datatype_name)

        -

        - Inheritance: - Dataset.createVLType -

        -

        Creates a new VLEN data type named datatype_name from a numpy +

        Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.

        The return value is the VLType class instance describing the new datatype.

        @@ -5238,14 +4999,10 @@

        Static methods

        def 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)

        -

        - Inheritance: - Dataset.createVariable -

        -

        Creates a new variable with the given varname, datatype, and +

        Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.

        If varname is specified as a path, using forward slashes as in unix to @@ -5355,14 +5112,10 @@

        Static methods

        def delncattr(

        self,name,value)

        -

        - Inheritance: - Dataset.delncattr -

        -

        delete a netCDF dataset or group attribute. Use if you need to delete a +

        delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.

        @@ -5376,14 +5129,10 @@

        Static methods

        def filepath(

        self,encoding=None)

        -

        - Inheritance: - Dataset.filepath -

        -

        Get the file system path (or the opendap URL) which was used to +

        Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2. The path is decoded into a string using sys.getfilesystemencoding() by default, this can be changed using the encoding kwarg.

        @@ -5398,14 +5147,10 @@

        Static methods

        def get_variables_by_attributes(

        ...)

        -

        - Inheritance: - Dataset.get_variables_by_attributes -

        -

        Returns a list of variables that match specific conditions.

        +

        Returns a list of variables that match specific conditions.

        Can pass in key=value parameters and variables are returned that contain all of the matches. For example,

        >>> # Get variables with x-axis attribute.
        @@ -5437,14 +5182,10 @@ 

        Static methods

        def getncattr(

        self,name)

        -

        - Inheritance: - Dataset.getncattr -

        -

        retrieve a netCDF dataset or group attribute. +

        retrieve a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.

        option kwarg encoding can be used to specify the @@ -5460,14 +5201,26 @@

        Static methods

        def isopen(

        ...)

        -

        - Inheritance: - Dataset.isopen -

        -

        is the Dataset open or closed?

        +

        is the Dataset open or closed?

        +
        +
        + +
        + + +
        +
        +

        def ncattrs(

        self)

        +
        + + + + +

        ncattrs(self)

        +

        return the netcdf attribute names from the master file.

        @@ -5479,14 +5232,10 @@

        Static methods

        def renameAttribute(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameAttribute -

        -

        rename a Dataset or Group attribute named oldname to newname.

        +

        rename a Dataset or Group attribute named oldname to newname.

        @@ -5498,14 +5247,10 @@

        Static methods

        def renameDimension(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameDimension -

        -

        rename a Dimension named oldname to newname.

        +

        rename a Dimension named oldname to newname.

        @@ -5517,14 +5262,10 @@

        Static methods

        def renameGroup(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameGroup -

        -

        rename a Group named oldname to newname (requires netcdf >= 4.3.1).

        +

        rename a Group named oldname to newname (requires netcdf >= 4.3.1).

        @@ -5536,14 +5277,10 @@

        Static methods

        def renameVariable(

        self, oldname, newname)

        -

        - Inheritance: - Dataset.renameVariable -

        -

        rename a Variable named oldname to newname

        +

        rename a Variable named oldname to newname

        @@ -5555,14 +5292,10 @@

        Static methods

        def set_always_mask(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_always_mask -

        -

        Call set_always_mask for all variables contained in +

        Call set_always_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion of @@ -5582,14 +5315,10 @@

        Static methods

        def set_auto_chartostring(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_chartostring -

        -

        Call set_auto_chartostring for all variables contained in this Dataset or +

        Call set_auto_chartostring for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion of all character arrays <--> string arrays should be performed for @@ -5608,14 +5337,10 @@

        Static methods

        def set_auto_mask(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_mask -

        -

        Call set_auto_mask for all variables contained in this Dataset or +

        Call set_auto_mask for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.

        @@ -5632,14 +5357,10 @@

        Static methods

        def set_auto_maskandscale(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_maskandscale -

        -

        Call set_auto_maskandscale for all variables contained in this Dataset or +

        Call set_auto_maskandscale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.

        @@ -5656,14 +5377,10 @@

        Static methods

        def set_auto_scale(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_auto_scale -

        -

        Call set_auto_scale for all variables contained in this Dataset or +

        Call set_auto_scale for all variables contained in this Dataset or Group, as well as for all variables in all its subgroups.

        True_or_False: Boolean determining if automatic variable scaling shall be applied for all variables.

        @@ -5680,14 +5397,10 @@

        Static methods

        def set_fill_off(

        self)

        -

        - Inheritance: - Dataset.set_fill_off -

        -

        Sets the fill mode for a Dataset open for writing to off.

        +

        Sets the fill mode for a Dataset open for writing to off.

        This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.

        @@ -5702,14 +5415,10 @@

        Static methods

        def set_fill_on(

        self)

        -

        - Inheritance: - Dataset.set_fill_on -

        -

        Sets the fill mode for a Dataset open for writing to on.

        +

        Sets the fill mode for a Dataset open for writing to on.

        This causes data to be pre-filled with fill values. The fill values can be controlled by the variable's _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined @@ -5728,14 +5437,10 @@

        Static methods

        def set_ncstring_attrs(

        self, True_or_False)

        -

        - Inheritance: - Dataset.set_ncstring_attrs -

        -

        Call set_ncstring_attrs for all variables contained in +

        Call set_ncstring_attrs for all variables contained in this Dataset or Group, as well as for all its subgroups and their variables.

        True_or_False: Boolean determining if all string attributes are @@ -5754,14 +5459,10 @@

        Static methods

        def setncattr(

        self,name,value)

        -

        - Inheritance: - Dataset.setncattr -

        -

        set a netCDF dataset or group attribute using name,value pair. +

        set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.

        @@ -5775,14 +5476,10 @@

        Static methods

        def setncattr_string(

        self,name,value)

        -

        - Inheritance: - Dataset.setncattr_string -

        -

        set a netCDF dataset or group string attribute using name,value pair. +

        set a netCDF dataset or group string attribute using name,value pair. Use if you need to ensure that a netCDF attribute is created with type NC_STRING if the file format is NETCDF4.

        @@ -5796,14 +5493,10 @@

        Static methods

        def setncatts(

        self,attdict)

        -

        - Inheritance: - Dataset.setncatts -

        -

        set a bunch of netCDF dataset or group attributes at once using a python dictionary. +

        set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute

        @@ -5818,95 +5511,10 @@

        Static methods

        def sync(

        self)

        -

        - Inheritance: - Dataset.sync -

        -

        Writes all buffered data in the Dataset to the disk file.

        -
        -
        - -
        - -

        Methods

        - -
        -
        -

        def __init__(

        self, files, check=False, aggdim=None, exclude=[], master_file=None)

        -
        - -

        - Inheritance: - Dataset.__init__ -

        - - - -

        Open a Dataset spanning multiple files, making it look as if it was a -single file. Variables in the list of files that share the same -dimension (specified with the keyword aggdim) are aggregated. If -aggdim is not specified, the unlimited is aggregated. Currently, -aggdim must be the leftmost (slowest varying) dimension of each -of the variables to be aggregated.

        -

        files: either a sequence of netCDF files or a string with a -wildcard (converted to a sorted list of files using glob) If -the master_file kwarg is not specified, the first file -in the list will become the "master" file, defining all the -variables with an aggregation dimension which may span -subsequent files. Attribute access returns attributes only from "master" -file. The files are always opened in read-only mode.

        -

        check: True if you want to do consistency checking to ensure the -correct variables structure for all of the netcdf files. Checking makes -the initialization of the MFDataset instance much slower. Default is -False.

        -

        aggdim: The name of the dimension to aggregate over (must -be the leftmost dimension of each of the variables to be aggregated). -If None (default), aggregate over the unlimited dimension.

        -

        exclude: A list of variable names to exclude from aggregation. -Default is an empty list.

        -

        master_file: file to use as "master file", defining all the -variables with an aggregation dimension and all global attributes.

        -
        -
        - -
        - - -
        -
        -

        def close(

        self)

        -
        - -

        - Inheritance: - Dataset.close -

        - - - -

        close all the open files.

        -
        -
        - -
        - - -
        -
        -

        def ncattrs(

        self)

        -
        - -

        - Inheritance: - Dataset.ncattrs -

        - - - -

        return the netcdf attribute names from the master file.

        +

        Writes all buffered data in the Dataset to the disk file.

        @@ -5957,9 +5565,9 @@

        Ancestors (in MRO)

        • MFTime
        • netCDF4._netCDF4._Variable
        • -
        • __builtin__.object
        • +
        • builtins.object
        -

        Methods

        +

        Static methods

        @@ -5969,7 +5577,8 @@

        Methods

        -

        Create a time Variable with units consistent across a multifile +

        __init__(self, time, units=None, calendar=None)

        +

        Create a time Variable with units consistent across a multifile dataset.

        time: Time variable from a MFDataset.

        units: Time units, for example, 'days since 1979-01-01'. If None, @@ -5986,7 +5595,7 @@

        Methods

        -

        def ncattrs(

        ...)

        +

        def ncattrs(

        self)

        @@ -6000,7 +5609,7 @@

        Methods

        -

        def set_always_mask(

        ...)

        +

        def set_always_mask(

        self, val)

        @@ -6014,7 +5623,7 @@

        Methods

        -

        def set_auto_chartostring(

        ...)

        +

        def set_auto_chartostring(

        self, val)

        @@ -6028,7 +5637,7 @@

        Methods

        -

        def set_auto_mask(

        ...)

        +

        def set_auto_mask(

        self, val)

        @@ -6042,7 +5651,7 @@

        Methods

        -

        def set_auto_maskandscale(

        ...)

        +

        def set_auto_maskandscale(

        self, val)

        @@ -6056,7 +5665,7 @@

        Methods

        -

        def set_auto_scale(

        ...)

        +

        def set_auto_scale(

        self, val)

        @@ -6070,7 +5679,7 @@

        Methods

        -

        def typecode(

        ...)

        +

        def typecode(

        self)

        @@ -6102,7 +5711,7 @@

        Methods

        Ancestors (in MRO)

        • VLType
        • -
        • __builtin__.object
        • +
        • builtins.object

        Class variables

        @@ -6207,7 +5816,7 @@

        Static methods

        Ancestors (in MRO)

        • Variable
        • -
        • __builtin__.object
        • +
        • builtins.object

        Class variables

        @@ -6936,7 +6545,7 @@

        Static methods