Commits

Roberto De Almeida  committed 0fa832f

Clean up

  • Participants
  • Parent commits 8bf915c

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.