[GRASS-SVN] r62206 - grass/trunk/lib/python/pygrass/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 7 08:36:28 PDT 2014


Author: zarch
Date: 2014-10-07 08:36:28 -0700 (Tue, 07 Oct 2014)
New Revision: 62206

Modified:
   grass/trunk/lib/python/pygrass/raster/buffer.py
Log:
pygrass: Fix #2442 np.float128 does not always exist

Modified: grass/trunk/lib/python/pygrass/raster/buffer.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/buffer.py	2014-10-07 15:30:46 UTC (rev 62205)
+++ grass/trunk/lib/python/pygrass/raster/buffer.py	2014-10-07 15:36:28 UTC (rev 62206)
@@ -1,9 +1,4 @@
 # -*- coding: utf-8 -*-
-"""
-Created on Fri Jun  8 18:46:34 2012
-
- at author: pietro
-"""
 from grass.pygrass.raster.raster_type import TYPE as RTYPE
 import ctypes
 import numpy as np
@@ -11,7 +6,8 @@
 
 CELL = (np.int, np.int0, np.int8, np.int16, np.int32, np.int64)
 FCELL = (np.float, np.float16, np.float32)
-DCELL = (np.float64, np.float128)
+_DCELL = 'float64', 'float128'
+DCELL = tuple([getattr(np, attr) for attr in _DCELL if hasattr(np, attr)])
 
 
 class Buffer(np.ndarray):



More information about the grass-commit mailing list