Roberto De Almeida avatar Roberto De Almeida committed 0fa832f

Clean up

Comments (0)

Files changed (2)

 import numpy as np
 from numpy.compat import asbytes, asstr
 from numpy import fromstring, ndarray, dtype, empty, array, asarray
-from numpy import little_endian as LITTLE_ENDIAN
 
 
 ABSENT       = asbytes('\x00\x00\x00\x00\x00\x00\x00\x00')
                 self.flush()
             finally:
                 self.fp.close()
-    __del__ = close
 
     def createDimension(self, name, length):
         """
         createVariable
 
         """
+        if length is None and self._dims:
+            raise ValueError("Only first dimension may be unlimited!")
+
         self.dimensions[name] = length
         self._dims.append(name)
 
 
         # Write data.
         if (var.data.dtype.byteorder == '<' or
-                (var.data.dtype.byteorder == '=' and LITTLE_ENDIAN)):
+                (var.data.dtype.byteorder == '=' and np.little_endian)):
             var.data = var.data.byteswap()
 
         if not var.isrec:
         self._pack_int(nelems)
 
         if not values.shape and (values.dtype.byteorder == '<' or
-                (values.dtype.byteorder == '=' and LITTLE_ENDIAN)):
+                (values.dtype.byteorder == '=' and np.little_endian)):
             values = values.byteswap()
         self.fp.write(values.tostring())
         count = values.size * values.itemsize
 Intended Audience :: Science/Research
 License :: OSI Approved :: MIT License
 Operating System :: OS Independent
-Programming Language :: Python
 Topic :: Scientific/Engineering
 Topic :: Software Development :: Libraries :: Python Modules
 """
     Improved type conversion between Numpy and Netcdf.
     Added optional automatic masking and conversion of data.
     Added paging for improved mmap().
+    Python 3 version.
 
 1.0.15
     Added fix for empty attributes.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.