|
1 | | -"""Version 1.7.5 |
| 1 | +"""Version 1.7.5.1 |
2 | 2 | ------------- |
3 | 3 |
|
4 | 4 | # Introduction |
@@ -1283,7 +1283,7 @@ import sys |
1283 | 1283 | import functools |
1284 | 1284 | from typing import Union |
1285 | 1285 |
|
1286 | | -__version__ = "1.7.5" |
| 1286 | +__version__ = "1.7.5.1" |
1287 | 1287 |
|
1288 | 1288 | # Initialize numpy |
1289 | 1289 | import posixpath |
@@ -1493,7 +1493,9 @@ def set_alignment(threshold, alignment): |
1493 | 1493 |
|
1494 | 1494 | __netcdf4libversion__ = getlibversion().split()[0] |
1495 | 1495 | __hdf5libversion__ = _gethdf5libversion() |
1496 | | -_needsworkaround_issue485 = __netcdf4libversion__ < "4.4.0" or \ |
| 1496 | +# parsed lib version for comparisons (string comparison breaks for 4.10+) |
| 1497 | +_nclibversion = Version(__netcdf4libversion__.split('-')[0]) |
| 1498 | +_needsworkaround_issue485 = _nclibversion < Version("4.4.0") or \ |
1497 | 1499 | (__netcdf4libversion__.startswith("4.4.0") and \ |
1498 | 1500 | "-development" in __netcdf4libversion__) |
1499 | 1501 |
|
@@ -1605,7 +1607,7 @@ is_native_big = numpy.dtype('>f4').byteorder == c'=' |
1605 | 1607 | # so it will compile with versions <= 4.2. |
1606 | 1608 | NC_DISKLESS = 0x0008 |
1607 | 1609 | # introduced in 4.6.2 |
1608 | | -if __netcdf4libversion__[0:5] >= "4.6.2": |
| 1610 | +if _nclibversion >= Version("4.6.2"): |
1609 | 1611 | NC_PERSIST = 0x4000 |
1610 | 1612 | else: # prior to 4.6.2 this flag doesn't work, so make the same as NC_DISKLESS |
1611 | 1613 | NC_PERSIST = NC_DISKLESS |
@@ -4499,7 +4501,7 @@ does not do anything.""" |
4499 | 4501 | # a fix for strided slice access using HDF5 was added |
4500 | 4502 | # in 4.6.2. |
4501 | 4503 | # always use nc_get_vars for strided access with OpenDAP (issue #838). |
4502 | | - if __netcdf4libversion__ >= "4.6.2" or\ |
| 4504 | + if _nclibversion >= Version("4.6.2") or\ |
4503 | 4505 | self._grp.filepath().startswith('http'): |
4504 | 4506 | self._use_get_vars = True |
4505 | 4507 | else: |
@@ -4574,7 +4576,7 @@ does not do anything.""" |
4574 | 4576 | if (self._grp.path != '/'): ncdump.append('path = %s' % self._grp.path) |
4575 | 4577 | ncdump.append('unlimited dimensions: %s' % ', '.join(unlimdims)) |
4576 | 4578 | ncdump.append('current shape = %r' % (self.shape,)) |
4577 | | - if __netcdf4libversion__ < '4.5.1' and\ |
| 4579 | + if _nclibversion < Version('4.5.1') and\ |
4578 | 4580 | self._grp.file_format.startswith('NETCDF3'): |
4579 | 4581 | # issue #908: no_fill not correct for NETCDF3 files before 4.5.1 |
4580 | 4582 | # before 4.5.1 there was no way to turn off filling on a |
@@ -5267,7 +5269,7 @@ rename a `Variable` attribute named `oldname` to `newname`.""" |
5267 | 5269 | # issue 209: don't return masked array if variable filling |
5268 | 5270 | # is disabled. |
5269 | 5271 | else: |
5270 | | - if __netcdf4libversion__ < '4.5.1' and\ |
| 5272 | + if _nclibversion < Version('4.5.1') and\ |
5271 | 5273 | self._grp.file_format.startswith('NETCDF3'): |
5272 | 5274 | # issue #908: no_fill not correct for NETCDF3 files before 4.5.1 |
5273 | 5275 | # before 4.5.1 there was no way to turn off filling on a |
|
0 commit comments