diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-05-03 13:44:18 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2021-05-03 16:48:49 -0600 |
commit | 8145b0549d6744d854d94b66006ac7aeb1ad0864 (patch) | |
tree | 732f648d8c91a44658abaacfb9fe431cd029cfe5 /numpy | |
parent | 2416ff43c4feb199890c13046f5f3e666a29f7e5 (diff) | |
download | numpy-8145b0549d6744d854d94b66006ac7aeb1ad0864.tar.gz |
MAINT: Add ".csv" to some data file names.
It is useful to encode the data file type in the name.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-README.txt (renamed from numpy/core/tests/data/umath-validation-set-README) | 4 | ||||
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-cos.csv (renamed from numpy/core/tests/data/umath-validation-set-cos) | 0 | ||||
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-exp.csv (renamed from numpy/core/tests/data/umath-validation-set-exp) | 0 | ||||
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-log.csv (renamed from numpy/core/tests/data/umath-validation-set-log) | 0 | ||||
-rw-r--r-- | numpy/core/tests/data/umath-validation-set-sin.csv (renamed from numpy/core/tests/data/umath-validation-set-sin) | 0 | ||||
-rw-r--r-- | numpy/core/tests/test_umath_accuracy.py | 11 |
6 files changed, 8 insertions, 7 deletions
diff --git a/numpy/core/tests/data/umath-validation-set-README b/numpy/core/tests/data/umath-validation-set-README.txt index 6561ca3b5..cfc9e4145 100644 --- a/numpy/core/tests/data/umath-validation-set-README +++ b/numpy/core/tests/data/umath-validation-set-README.txt @@ -1,5 +1,5 @@ Steps to validate transcendental functions: -1) Add a file 'umath-validation-set-<ufuncname>', where ufuncname is name of +1) Add a file 'umath-validation-set-<ufuncname>.txt', where ufuncname is name of the function in NumPy you want to validate 2) The file should contain 4 columns: dtype,input,expected output,ulperror a. dtype: one of np.float16, np.float32, np.float64 @@ -11,5 +11,5 @@ Steps to validate transcendental functions: d. ulperror: expected maximum ulp error of the function. This should be same across all rows of the same dtype. Otherwise, the function is tested for the maximum ulp error among all entries of that dtype. -3) Add file umath-validation-set-<ufuncname> to the test file test_umath_accuracy.py +3) Add file umath-validation-set-<ufuncname>.txt to the test file test_umath_accuracy.py which will then validate your ufunc. diff --git a/numpy/core/tests/data/umath-validation-set-cos b/numpy/core/tests/data/umath-validation-set-cos.csv index 2e75f044c..2e75f044c 100644 --- a/numpy/core/tests/data/umath-validation-set-cos +++ b/numpy/core/tests/data/umath-validation-set-cos.csv diff --git a/numpy/core/tests/data/umath-validation-set-exp b/numpy/core/tests/data/umath-validation-set-exp.csv index 7c5ef3b33..7c5ef3b33 100644 --- a/numpy/core/tests/data/umath-validation-set-exp +++ b/numpy/core/tests/data/umath-validation-set-exp.csv diff --git a/numpy/core/tests/data/umath-validation-set-log b/numpy/core/tests/data/umath-validation-set-log.csv index b8f6b0875..b8f6b0875 100644 --- a/numpy/core/tests/data/umath-validation-set-log +++ b/numpy/core/tests/data/umath-validation-set-log.csv diff --git a/numpy/core/tests/data/umath-validation-set-sin b/numpy/core/tests/data/umath-validation-set-sin.csv index 64e78ae15..64e78ae15 100644 --- a/numpy/core/tests/data/umath-validation-set-sin +++ b/numpy/core/tests/data/umath-validation-set-sin.csv diff --git a/numpy/core/tests/test_umath_accuracy.py b/numpy/core/tests/test_umath_accuracy.py index 33080edbb..8e04d2875 100644 --- a/numpy/core/tests/test_umath_accuracy.py +++ b/numpy/core/tests/test_umath_accuracy.py @@ -28,10 +28,10 @@ def convert(s, datatype="np.float32"): return fp.contents.value # dereference the pointer, get the float str_to_float = np.vectorize(convert) -files = ['umath-validation-set-exp', - 'umath-validation-set-log', - 'umath-validation-set-sin', - 'umath-validation-set-cos'] +files = ['umath-validation-set-exp.csv', + 'umath-validation-set-log.csv', + 'umath-validation-set-sin.csv', + 'umath-validation-set-cos.csv'] class TestAccuracy: @platform_skip @@ -47,7 +47,8 @@ class TestAccuracy: names=('type','input','output','ulperr'), delimiter=',', skip_header=1) - npfunc = getattr(np, filename.split('-')[3]) + npname = path.splitext(filename)[0].split('-')[3] + npfunc = getattr(np, npname) for datatype in np.unique(data['type']): data_subset = data[data['type'] == datatype] inval = np.array(str_to_float(data_subset['input'].astype(str), data_subset['type'].astype(str)), dtype=eval(datatype)) |