fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
568
test_tuple
def
function
def test_tuple(self): actual = (1 + 1e-7, 2 + 1e-8) expected = (1, 2) # Return false if any element is outside the tolerance. assert actual == approx(expected, rel=5e-7, abs=0) assert actual != approx(expected, rel=5e-8, abs=0) assert approx(expected, rel=5e-7, abs=0...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
573
approx
ref
function
assert actual == approx(expected, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
574
approx
ref
function
assert actual != approx(expected, rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
575
approx
ref
function
assert approx(expected, rel=5e-7, abs=0) == actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
576
approx
ref
function
assert approx(expected, rel=5e-8, abs=0) != actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
578
test_tuple_wrong_len
def
function
def test_tuple_wrong_len(self): assert (1, 2) != approx((1,)) assert (1, 2) != approx((1, 2, 3)) def test_tuple_vs_other(self): assert 1 != approx((1,)) def test_dict(self): actual = {"a": 1 + 1e-7, "b": 2 + 1e-8} # Dictionaries became ordered in python3.6, so switc...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
579
approx
ref
function
assert (1, 2) != approx((1,))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
580
approx
ref
function
assert (1, 2) != approx((1, 2, 3))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
582
test_tuple_vs_other
def
function
def test_tuple_vs_other(self): assert 1 != approx((1,)) def test_dict(self): actual = {"a": 1 + 1e-7, "b": 2 + 1e-8} # Dictionaries became ordered in python3.6, so switch up the order here # to make sure it doesn't matter. expected = {"b": 2, "a": 1} # Return fa...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
583
approx
ref
function
assert 1 != approx((1,))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
585
test_dict
def
function
def test_dict(self): actual = {"a": 1 + 1e-7, "b": 2 + 1e-8} # Dictionaries became ordered in python3.6, so switch up the order here # to make sure it doesn't matter. expected = {"b": 2, "a": 1} # Return false if any element is outside the tolerance. assert actual ==...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
592
approx
ref
function
assert actual == approx(expected, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
593
approx
ref
function
assert actual != approx(expected, rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
594
approx
ref
function
assert approx(expected, rel=5e-7, abs=0) == actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
595
approx
ref
function
assert approx(expected, rel=5e-8, abs=0) != actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
597
test_dict_decimal
def
function
def test_dict_decimal(self): actual = {"a": Decimal("1.000001"), "b": Decimal("2.000001")} # Dictionaries became ordered in python3.6, so switch up the order here # to make sure it doesn't matter. expected = {"b": Decimal("2"), "a": Decimal("1")} assert actual == approx(expe...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
603
approx
ref
function
assert actual == approx(expected)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
605
test_dict_wrong_len
def
function
def test_dict_wrong_len(self): assert {"a": 1, "b": 2} != approx({"a": 1}) assert {"a": 1, "b": 2} != approx({"a": 1, "c": 2}) assert {"a": 1, "b": 2} != approx({"a": 1, "b": 2, "c": 3}) def test_dict_nonnumeric(self): assert {"a": 1.0, "b": None} == pytest.approx({"a": 1.0, "b"...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
606
approx
ref
function
assert {"a": 1, "b": 2} != approx({"a": 1})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
607
approx
ref
function
assert {"a": 1, "b": 2} != approx({"a": 1, "c": 2})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
608
approx
ref
function
assert {"a": 1, "b": 2} != approx({"a": 1, "b": 2, "c": 3})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
610
test_dict_nonnumeric
def
function
def test_dict_nonnumeric(self): assert {"a": 1.0, "b": None} == pytest.approx({"a": 1.0, "b": None}) assert {"a": 1.0, "b": 1} != pytest.approx({"a": 1.0, "b": None}) def test_dict_vs_other(self): assert 1 != approx({"a": 0}) def test_numpy_array(self): np = pytest.importor...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
611
approx
ref
function
assert {"a": 1.0, "b": None} == pytest.approx({"a": 1.0, "b": None})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
612
approx
ref
function
assert {"a": 1.0, "b": 1} != pytest.approx({"a": 1.0, "b": None})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
614
test_dict_vs_other
def
function
def test_dict_vs_other(self): assert 1 != approx({"a": 0}) def test_numpy_array(self): np = pytest.importorskip("numpy") actual = np.array([1 + 1e-7, 2 + 1e-8]) expected = np.array([1, 2]) # Return false if any element is outside the tolerance. assert actual ==...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
615
approx
ref
function
assert 1 != approx({"a": 0})
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
617
test_numpy_array
def
function
def test_numpy_array(self): np = pytest.importorskip("numpy") actual = np.array([1 + 1e-7, 2 + 1e-8]) expected = np.array([1, 2]) # Return false if any element is outside the tolerance. assert actual == approx(expected, rel=5e-7, abs=0) assert actual != approx(expec...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
618
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
620
array
ref
function
actual = np.array([1 + 1e-7, 2 + 1e-8])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
621
array
ref
function
expected = np.array([1, 2])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
624
approx
ref
function
assert actual == approx(expected, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
625
approx
ref
function
assert actual != approx(expected, rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
626
approx
ref
function
assert approx(expected, rel=5e-7, abs=0) == expected
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
627
approx
ref
function
assert approx(expected, rel=5e-8, abs=0) != actual
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
630
approx
ref
function
assert list(actual) == approx(expected, rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
631
approx
ref
function
assert list(actual) != approx(expected, rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
632
approx
ref
function
assert actual == approx(list(expected), rel=5e-7, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
633
approx
ref
function
assert actual != approx(list(expected), rel=5e-8, abs=0)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
635
test_numpy_tolerance_args
def
function
def test_numpy_tolerance_args(self): """ Check that numpy rel/abs args are handled correctly for comparison against an np.array Check both sides of the operator, hopefully it doesn't impact things. Test all permutations of where the approx and np.array() can show up "...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
642
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
656
op
ref
function
assert op(np.array(actual), approx(expected, abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
656
array
ref
function
assert op(np.array(actual), approx(expected, abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
656
approx
ref
function
assert op(np.array(actual), approx(expected, abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
657
op
ref
function
assert op(approx(expected, abs=_abs, rel=_rel), np.array(actual)) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
657
approx
ref
function
assert op(approx(expected, abs=_abs, rel=_rel), np.array(actual)) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
657
array
ref
function
assert op(approx(expected, abs=_abs, rel=_rel), np.array(actual)) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
659
op
ref
function
assert op(actual, approx(np.array(expected), abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
659
approx
ref
function
assert op(actual, approx(np.array(expected), abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
659
array
ref
function
assert op(actual, approx(np.array(expected), abs=_abs, rel=_rel)) # a, b
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
660
op
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), actual) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
660
approx
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), actual) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
660
array
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), actual) # b, a
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
662
op
ref
function
assert op(np.array(actual), approx(np.array(expected), abs=_abs, rel=_rel))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
662
array
ref
function
assert op(np.array(actual), approx(np.array(expected), abs=_abs, rel=_rel))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
662
approx
ref
function
assert op(np.array(actual), approx(np.array(expected), abs=_abs, rel=_rel))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
662
array
ref
function
assert op(np.array(actual), approx(np.array(expected), abs=_abs, rel=_rel))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
663
op
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), np.array(actual))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
663
approx
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), np.array(actual))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
663
array
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), np.array(actual))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
663
array
ref
function
assert op(approx(np.array(expected), abs=_abs, rel=_rel), np.array(actual))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
665
test_numpy_expecting_nan
def
function
def test_numpy_expecting_nan(self): np = pytest.importorskip("numpy") examples = [ (eq, nan, nan), (eq, -nan, -nan), (eq, nan, -nan), (ne, 0.0, nan), (ne, inf, nan), ] for op, a, x in examples: # Nothing is equal...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
666
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
676
array
ref
function
assert np.array(a) != approx(x)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
676
approx
ref
function
assert np.array(a) != approx(x)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
677
approx
ref
function
assert a != approx(np.array(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
677
array
ref
function
assert a != approx(np.array(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
680
op
ref
function
assert op(np.array(a), approx(x, nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
680
array
ref
function
assert op(np.array(a), approx(x, nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
680
approx
ref
function
assert op(np.array(a), approx(x, nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
681
op
ref
function
assert op(a, approx(np.array(x), nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
681
approx
ref
function
assert op(a, approx(np.array(x), nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
681
array
ref
function
assert op(a, approx(np.array(x), nan_ok=True))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
683
test_numpy_expecting_inf
def
function
def test_numpy_expecting_inf(self): np = pytest.importorskip("numpy") examples = [ (eq, inf, inf), (eq, -inf, -inf), (ne, inf, -inf), (ne, 0.0, inf), (ne, nan, inf), ] for op, a, x in examples: assert op(np.array...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
684
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
693
op
ref
function
assert op(np.array(a), approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
693
array
ref
function
assert op(np.array(a), approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
693
approx
ref
function
assert op(np.array(a), approx(x))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
694
op
ref
function
assert op(a, approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
694
approx
ref
function
assert op(a, approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
694
array
ref
function
assert op(a, approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
695
op
ref
function
assert op(np.array(a), approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
695
array
ref
function
assert op(np.array(a), approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
695
approx
ref
function
assert op(np.array(a), approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
695
array
ref
function
assert op(np.array(a), approx(np.array(x)))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
697
test_numpy_array_wrong_shape
def
function
def test_numpy_array_wrong_shape(self): np = pytest.importorskip("numpy") a12 = np.array([[1, 2]]) a21 = np.array([[1], [2]]) assert a12 != approx(a21) assert a21 != approx(a12) def test_numpy_array_protocol(self): """ array-like objects such as tensorf...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
698
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
700
array
ref
function
a12 = np.array([[1, 2]])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
701
array
ref
function
a21 = np.array([[1], [2]])
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
703
approx
ref
function
assert a12 != approx(a21)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
704
approx
ref
function
assert a21 != approx(a12)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
706
test_numpy_array_protocol
def
function
def test_numpy_array_protocol(self): """ array-like objects such as tensorflow's DeviceArray are handled like ndarray. See issue #8132 """ np = pytest.importorskip("numpy") class DeviceArray: def __init__(self, value, size): self.value = v...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
711
importorskip
ref
function
np = pytest.importorskip("numpy")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
713
DeviceArray
def
class
__init__ __array__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
718
__array__
def
function
def __array__(self): return self.value * np.ones(self.size) class DeviceScalar: def __init__(self, value): self.value = value def __array__(self): return np.array(self.value) expected = 1 actual = 1 + 1e-6 ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
719
ones
ref
function
return self.value * np.ones(self.size)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
721
DeviceScalar
def
class
__init__ __array__
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
725
__array__
def
function
def __array__(self): return self.value * np.ones(self.size) class DeviceScalar: def __init__(self, value): self.value = value def __array__(self): return np.array(self.value) expected = 1 actual = 1 + 1e-6 ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
726
array
ref
function
return np.array(self.value)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
730
approx
ref
function
assert approx(expected) == DeviceArray(actual, size=1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/python/approx.py
testing/python/approx.py
730
DeviceArray
ref
function
assert approx(expected) == DeviceArray(actual, size=1)