Changeset 2971
- Timestamp:
- May 25, 2006, 3:15:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/utilities/test_numerical_tools.py
r2778 r2971 217 217 bins = [0,1.5,2,3] 218 218 assert allclose(histogram(a, bins), [8,0,3,4]) 219 220 221 219 assert allclose(histogram(a, [0,3]), histogram(a, [-0.5,3])) 222 220 223 221 # Check situation with #bins >= #datapoints 222 a = [1.7] 223 bins = [0,1.5,2,3] 224 assert allclose(histogram(a, bins), [0,1,0,0]) 225 226 a = [1.7] 227 bins = [0] 228 assert allclose(histogram(a, bins), [1]) 229 230 a = [-1.7] 231 bins = [0] 232 assert allclose(histogram(a, bins), [0]) 233 234 a = [-1.7] 235 bins = [-1.7] 236 assert allclose(histogram(a, bins), [1]) 237 224 238 225 239
Note: See TracChangeset
for help on using the changeset viewer.