OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
numpy
/
f2py
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📄
__init__.py
0 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📁
__pycache__
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📁
src
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📄
test_array_from_pyobj.py
21.46 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_assumed_shape.py
1.55 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_block_docstring.py
621 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_callback.py
3.89 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_common.py
802 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_compile_function.py
4.21 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_crackfortran.py
2.73 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_kind.py
1012 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_mixed.py
911 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_parameter.py
3.82 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_quoted_character.py
927 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_regression.py
698 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_character.py
3.83 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_complex.py
4.51 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_integer.py
4.47 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_logical.py
4.73 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_real.py
5.28 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_semicolon_split.py
1.48 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_size.py
1.26 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_string.py
610 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
util.py
9.39 KB
10/28/2024 05:59:24 AM
rw-r--r--
Editing: test_parameter.py
Close
import os import pytest import numpy as np from numpy.testing import assert_raises, assert_equal from . import util def _path(*a): return os.path.join(*((os.path.dirname(__file__),) + a)) class TestParameters(util.F2PyTest): # Check that intent(in out) translates as intent(inout) sources = [_path('src', 'parameter', 'constant_real.f90'), _path('src', 'parameter', 'constant_integer.f90'), _path('src', 'parameter', 'constant_both.f90'), _path('src', 'parameter', 'constant_compound.f90'), _path('src', 'parameter', 'constant_non_compound.f90'), ] @pytest.mark.slow def test_constant_real_single(self): # non-contiguous should raise error x = np.arange(6, dtype=np.float32)[::2] assert_raises(ValueError, self.module.foo_single, x) # check values with contiguous array x = np.arange(3, dtype=np.float32) self.module.foo_single(x) assert_equal(x, [0 + 1 + 2*3, 1, 2]) @pytest.mark.slow def test_constant_real_double(self): # non-contiguous should raise error x = np.arange(6, dtype=np.float64)[::2] assert_raises(ValueError, self.module.foo_double, x) # check values with contiguous array x = np.arange(3, dtype=np.float64) self.module.foo_double(x) assert_equal(x, [0 + 1 + 2*3, 1, 2]) @pytest.mark.slow def test_constant_compound_int(self): # non-contiguous should raise error x = np.arange(6, dtype=np.int32)[::2] assert_raises(ValueError, self.module.foo_compound_int, x) # check values with contiguous array x = np.arange(3, dtype=np.int32) self.module.foo_compound_int(x) assert_equal(x, [0 + 1 + 2*6, 1, 2]) @pytest.mark.slow def test_constant_non_compound_int(self): # check values x = np.arange(4, dtype=np.int32) self.module.foo_non_compound_int(x) assert_equal(x, [0 + 1 + 2 + 3*4, 1, 2, 3]) @pytest.mark.slow def test_constant_integer_int(self): # non-contiguous should raise error x = np.arange(6, dtype=np.int32)[::2] assert_raises(ValueError, self.module.foo_int, x) # check values with contiguous array x = np.arange(3, dtype=np.int32) self.module.foo_int(x) assert_equal(x, [0 + 1 + 2*3, 1, 2]) @pytest.mark.slow def test_constant_integer_long(self): # non-contiguous should raise error x = np.arange(6, dtype=np.int64)[::2] assert_raises(ValueError, self.module.foo_long, x) # check values with contiguous array x = np.arange(3, dtype=np.int64) self.module.foo_long(x) assert_equal(x, [0 + 1 + 2*3, 1, 2]) @pytest.mark.slow def test_constant_both(self): # non-contiguous should raise error x = np.arange(6, dtype=np.float64)[::2] assert_raises(ValueError, self.module.foo, x) # check values with contiguous array x = np.arange(3, dtype=np.float64) self.module.foo(x) assert_equal(x, [0 + 1*3*3 + 2*3*3, 1*3, 2*3]) @pytest.mark.slow def test_constant_no(self): # non-contiguous should raise error x = np.arange(6, dtype=np.float64)[::2] assert_raises(ValueError, self.module.foo_no, x) # check values with contiguous array x = np.arange(3, dtype=np.float64) self.module.foo_no(x) assert_equal(x, [0 + 1*3*3 + 2*3*3, 1*3, 2*3]) @pytest.mark.slow def test_constant_sum(self): # non-contiguous should raise error x = np.arange(6, dtype=np.float64)[::2] assert_raises(ValueError, self.module.foo_sum, x) # check values with contiguous array x = np.arange(3, dtype=np.float64) self.module.foo_sum(x) assert_equal(x, [0 + 1*3*3 + 2*3*3, 1*3, 2*3])