diff options
| author | Bas van Beek <b.f.van.beek@vu.nl> | 2020-10-19 16:11:07 +0200 |
|---|---|---|
| committer | Bas van Beek <b.f.van.beek@vu.nl> | 2021-01-16 02:22:35 +0100 |
| commit | a4260ab10fff84710c3ae4a67271f03f823ac75c (patch) | |
| tree | cb598beac47e27d05fd802e8c058ed0af8916074 /numpy/core | |
| parent | c6fc6884d3c9bc68872a7adaae2974143a910eac (diff) | |
| download | numpy-a4260ab10fff84710c3ae4a67271f03f823ac75c.tar.gz | |
MAINT,DEP: Replace references to `typeDict` with `sctypeDict`
Diffstat (limited to 'numpy/core')
| -rw-r--r-- | numpy/core/numerictypes.py | 2 | ||||
| -rw-r--r-- | numpy/core/records.py | 2 | ||||
| -rw-r--r-- | numpy/core/tests/test_multiarray.py | 10 | ||||
| -rw-r--r-- | numpy/core/tests/test_regression.py | 4 | ||||
| -rw-r--r-- | numpy/core/tests/test_scalarmath.py | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py index 5a9c50ee3..62cebc775 100644 --- a/numpy/core/numerictypes.py +++ b/numpy/core/numerictypes.py @@ -5,7 +5,7 @@ This module is designed so "from numerictypes import \\*" is safe. Exported symbols include: Dictionary with all registered number types (including aliases): - typeDict + sctypeDict Type objects (not all will be available, depends on platform): see variable sctypes for which ones you have diff --git a/numpy/core/records.py b/numpy/core/records.py index 00d456658..5cc82ca6e 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -70,7 +70,7 @@ _byteorderconv = {'b':'>', # of the letter code '(2,3)f4' and ' ( 2 , 3 ) f4 ' # are equally allowed -numfmt = nt.typeDict +numfmt = nt.sctypeDict # taken from OrderedDict recipes in the Python documentation # https://docs.python.org/3.3/library/collections.html#ordereddict-examples-and-recipes diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index b30fcb812..19b065b46 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -207,7 +207,7 @@ class TestFlags: a[2] = 10 # only warn once assert_(len(w) == 1) - + @pytest.mark.parametrize(["flag", "flag_value", "writeable"], [("writeable", True, True), # Delete _warn_on_write after deprecation and simplify @@ -1418,11 +1418,11 @@ class TestStructured: a = np.array([(1,2)], dtype=[('a', 'i4'), ('b', 'i4')]) a[['a', 'b']] = a[['b', 'a']] assert_equal(a[0].item(), (2,1)) - + def test_scalar_assignment(self): with assert_raises(ValueError): - arr = np.arange(25).reshape(5, 5) - arr.itemset(3) + arr = np.arange(25).reshape(5, 5) + arr.itemset(3) def test_structuredscalar_indexing(self): # test gh-7262 @@ -7214,7 +7214,7 @@ class TestNewBufferProtocol: self._check_roundtrip(x) def test_roundtrip_single_types(self): - for typ in np.typeDict.values(): + for typ in np.sctypeDict.values(): dtype = np.dtype(typ) if dtype.char in 'Mm': diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 831e48e8b..3c7d6f668 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -1531,7 +1531,7 @@ class TestRegression: np.fromstring(b'aa, aa, 1.0', sep=',') def test_ticket_1539(self): - dtypes = [x for x in np.typeDict.values() + dtypes = [x for x in np.sctypeDict.values() if (issubclass(x, np.number) and not issubclass(x, np.timedelta64))] a = np.array([], np.bool_) # not x[0] because it is unordered @@ -2332,7 +2332,7 @@ class TestRegression: def test_correct_hash_dict(self): # gh-8887 - __hash__ would be None despite tp_hash being set - all_types = set(np.typeDict.values()) - {np.void} + all_types = set(np.sctypeDict.values()) - {np.void} for t in all_types: val = t() diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py index 0b615edfa..e097235fd 100644 --- a/numpy/core/tests/test_scalarmath.py +++ b/numpy/core/tests/test_scalarmath.py @@ -404,13 +404,13 @@ class TestConversion: assert_(res == tgt) for code in np.typecodes['AllInteger']: - res = np.typeDict[code](np.iinfo(code).max) + res = np.sctypeDict[code](np.iinfo(code).max) tgt = np.iinfo(code).max assert_(res == tgt) def test_int_raise_behaviour(self): def overflow_error_func(dtype): - np.typeDict[dtype](np.iinfo(dtype).max + 1) + np.sctypeDict[dtype](np.iinfo(dtype).max + 1) for code in 'lLqQ': assert_raises(OverflowError, overflow_error_func, code) |
