- Timestamp:
- 01/16/2008 11:32:27 AM (12 months ago)
- Location:
- trunk/fipy
- Files:
-
- 2 modified
-
meshes/numMesh/mesh.py (modified) (1 diff)
-
tools/numerix.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/fipy/meshes/numMesh/mesh.py
r2447 r2455 218 218 for i in range(otherNumFaces): 219 219 ## Seems to be overwriting other.faceVertexIDs with new numpy 220 ## currFace = other.faceVertexIDs[i] 221 currFace = other.faceVertexIDs[...,i].copy() 220 ## currFace = other.faceVertexIDs[i] 221 ## currFace = other.faceVertexIDs[...,i].copy() 222 ## Changed this again as numpy 1.0.4 seems to have no copy method for 223 ## masked arrays. 224 try: 225 currFace = other.faceVertexIDs[...,i].copy() 226 except: 227 currFace = MA.array(other.faceVertexIDs[...,i], mask=MA.getmask(other.faceVertexIDs[...,i])) 228 222 229 keepGoing = 1 223 230 currIndex = 0 -
trunk/fipy/tools/numerix.py
r2347 r2455 283 283 separator=separator) 284 284 elif isFloat(arr): 285 from numpy.core.arrayprint import _floatFormat, _formatFloat286 ## _floatFormat seems to be broken 287 ## if isinstance(arr, NUMERIX.ndarray): 288 ## format, length = _floatFormat(arr, precision=precision, 289 ## suppress_small=suppress_small) 290 ## else:291 ## format, length = _floatFormat(NUMERIX.array(arr), 292 ## precision=precision, suppress_small=suppress_small)293 return _formatFloat(arr, format='%%1.%df' % precision) 285 try: 286 ## this is for numpy 1.0.4 and above 287 ## why has the interface changed again? 288 from numpy.core.arrayprint import FloatFormat 289 return FloatFormat(NUMERIX.array((arr,)), precision, suppress_small)(arr).strip() 290 except: 291 from numpy.core.arrayprint import _floatFormat, _formatFloat 292 return _formatFloat(arr, format='%%1.%df' % precision) 293 294 294 elif isInt(arr): 295 295 from numpy.core.arrayprint import _formatInteger … … 568 568 569 569 >>> print tostring(cos(2*pi/6), precision=3) 570 0.5 570 0.5 571 571 >>> print tostring(cos(array((0,2*pi/6,pi/2))), precision=3, suppress_small=1) 572 572 [ 1. 0.5 0. ]
FiPy: A Finite Volume PDE Solver Using Python