MCPcopy Create free account
hub / github.com/numpy/numpy / do_precision_lower_bound

Method do_precision_lower_bound

numpy/lib/tests/test_histograms.py:340–355  ·  view source on GitHub ↗
(self, float_small, float_large)

Source from the content-addressed store, hash-verified

338 self.do_signed_overflow_bounds(np.longlong)
339
340 def do_precision_lower_bound(self, float_small, float_large):
341 eps = np.finfo(float_large).eps
342
343 arr = np.array([1.0], float_small)
344 range = np.array([1.0 + eps, 2.0], float_large)
345
346 # test is looking for behavior when the bounds change between dtypes
347 if range.astype(float_small)[0] != 1:
348 return
349
350 # previously crashed
351 count, x_loc = np.histogram(arr, bins=1, range=range)
352 assert_equal(count, [1])
353
354 # gh-10322 means that the type comes from arr - this may change
355 assert_equal(x_loc.dtype, float_small)
356
357 def do_precision_upper_bound(self, float_small, float_large):
358 eps = np.finfo(float_large).eps

Callers 1

do_precisionMethod · 0.95

Calls 2

assert_equalFunction · 0.90
astypeMethod · 0.80

Tested by

no test coverage detected