Codebase list netcdf4-python / bacca40
New upstream version 1.5.1.2 Bas Couwenberg 4 years ago
7 changed file(s) with 39 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
0 version 1.5.1.2 (tag v1.5.1.2rel)
1 ==================================
2 * fix another slicing bug introduced by the fix to issue #906 (issue #922).
3
04 version 1.5.1.1 (tag v1.5.1.1rel)
15 ==================================
26 * fixed __version__ attribute (was set incorrectly in 1.5.1 release).
99 ## News
1010 For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog).
1111
12 05/02/2019: Version [1.5.1.1](https://pypi.python.org/pypi/netCDF4/1.5.1.1) released. Fixes incorrect __version__
12 05/06/2019: Version [1.5.1.2](https://pypi.python.org/pypi/netCDF4/1.5.1.2) released. Fixes another slicing
13 slicing regression ([issue #922)](https://github.com/Unidata/netcdf4-python/issues/922)) introduced in the 1.5.1 release.
14
15 05/02/2019: Version [1.5.1.1](https://pypi.python.org/pypi/netCDF4/1.5.1.1) released. Fixes incorrect `__version__`
1316 module variable in 1.5.1 release, plus a slicing bug ([issue #919)](https://github.com/Unidata/netcdf4-python/issues/919)).
1417
1518 04/30/2019: Version [1.5.1](https://pypi.python.org/pypi/netCDF4/1.5.1) released. Bugfixes, no new features.
33 <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
44
55 <title>netCDF4 API documentation</title>
6 <meta name="description" content="Version 1.5.1.1
6 <meta name="description" content="Version 1.5.1.2
77 ---------------
88 - - -
99
12791279
12801280 <header id="section-intro">
12811281 <h1 class="title"><span class="name">netCDF4</span> module</h1>
1282 <h2>Version 1.5.1.1</h2>
1282 <h2>Version 1.5.1.2</h2>
12831283 <hr />
12841284 <h1>Introduction</h1>
12851285 <p>netcdf4-python is a Python interface to the netCDF C library.</p>
00 """
1 Version 1.5.1.1
1 Version 1.5.1.2
22 ---------------
33 - - -
44
11891189 # python3: zip is already python2's itertools.izip
11901190 pass
11911191
1192 __version__ = "1.5.1.1"
1192 __version__ = "1.5.1.2"
11931193
11941194 # Initialize numpy
11951195 import posixpath
364364 datashape = broadcasted_shape(shape, datashape)
365365
366366 # pad datashape with zeros for dimensions not being sliced (issue #906)
367 if datashape:
367 # only used when data covers slice over subset of dimensions
368 if datashape and len(datashape) != len(elem) and\
369 len(datashape) == sum(1 for e in elem if type(e) == slice):
368370 datashapenew = (); i=0
369371 for e in elem:
370 if type(e) != slice:
372 if type(e) != slice and not np.iterable(e): # scalar integer slice
371373 datashapenew = datashapenew + (0,)
372 else:
374 else: # slice object
373375 datashapenew = datashapenew + (datashape[i],)
374376 i+=1
375377 datashape = datashapenew
406408 if unlim and e.stop is not None and e.stop > shape[i]:
407409 length = e.stop
408410 elif unlim and e.stop is None and datashape != ():
409 if e.start is None:
410 length = datashape[i]
411 else:
412 length = e.start+datashape[i]
411 try:
412 if e.start is None:
413 length = datashape[i]
414 else:
415 length = e.start+datashape[i]
416 except IndexError:
417 raise IndexError("shape of data does not conform to slice")
413418 else:
414419 if unlim and datashape == () and len(dim) == 0:
415420 # writing scalar along unlimited dimension using slicing
583583
584584 setup(name="netCDF4",
585585 cmdclass=cmdclass,
586 version="1.5.1.1",
586 version="1.5.1.2",
587587 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 <https://github.com/Unidata/netcdf4-python>`_ where you may access the most up-to-date source.",
588588 author="Jeff Whitaker",
589589 author_email="jeffrey.s.whitaker@noaa.gov",
234234 f['v1'][:] = arr
235235 assert_array_equal(f['v1'][:],np.broadcast_to(arr,f['v1'].shape))
236236
237 def test_issue922(self):
238 with Dataset(self.file,'w') as f:
239 f.createDimension('d1',3)
240 f.createDimension('d2',None)
241 f.createVariable('v1',np.int,('d2','d1',))
242 f['v1'][0] = np.arange(3,dtype=np.int)
243 f['v1'][1:3] = np.arange(3,dtype=np.int)
244 assert_array_equal(f['v1'][:], np.broadcast_to(np.arange(3),(3,3)))
245 f.createVariable('v2',np.int,('d1','d2',))
246 f['v2'][:,0] = np.arange(3,dtype=np.int)
247 f['v2'][:,1:3] = np.arange(6,dtype=np.int).reshape(3,2)
248 assert_array_equal(f['v2'][:,1:3],np.arange(6,dtype=np.int).reshape(3,2))
249 assert_array_equal(f['v2'][:,0],np.arange(3,dtype=np.int))
250
237251 if __name__ == '__main__':
238252 unittest.main()