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

Method setup_method

numpy/core/tests/test_numeric.py:2717–2726  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2715 # Test ones, zeros, empty and full.
2716
2717 def setup_method(self):
2718 dtypes = {np.dtype(tp) for tp in itertools.chain(*np.sctypes.values())}
2719 # void, bytes, str
2720 variable_sized = {tp for tp in dtypes if tp.str.endswith('0')}
2721 self.dtypes = sorted(dtypes - variable_sized |
2722 {np.dtype(tp.str.replace("0", str(i)))
2723 for tp in variable_sized for i in range(1, 10)},
2724 key=lambda dtype: dtype.str)
2725 self.orders = {'C': 'c_contiguous', 'F': 'f_contiguous'}
2726 self.ndims = 10
2727
2728 def check_function(self, func, fill_value=None):
2729 par = ((0, 1, 2),

Callers

nothing calls this directly

Calls 4

valuesMethod · 0.80
endswithMethod · 0.80
replaceMethod · 0.80
dtypeMethod · 0.45

Tested by

no test coverage detected