Search is not available for this dataset
repo_id stringlengths 12 110 | file_path stringlengths 24 164 | content stringlengths 3 89.3M | __index_level_0__ int64 0 0 |
|---|---|---|---|
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/_backends/meson.build.template | project('${modulename}',
['c', 'fortran'],
version : '0.1',
meson_version: '>= 1.1.0',
default_options : [
'warning_level=1',
'buildtype=${buildtype}'
])
fc = meson.get_compiler('fortran')
py = import('pyt... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/_backends/_backend.py | from __future__ import annotations
from abc import ABC, abstractmethod
class Backend(ABC):
def __init__(
self,
modulename,
sources,
extra_objects,
build_dir,
include_dirs,
library_dirs,
libraries,
define_macros,
undef_macros,
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/_backends/__init__.py | def f2py_build_generator(name):
if name == "meson":
from ._meson import MesonBackend
return MesonBackend
elif name == "distutils":
from ._distutils import DistutilsBackend
return DistutilsBackend
else:
raise ValueError(f"Unknown backend: {name}")
| 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/src/fortranobject.c | #define FORTRANOBJECT_C
#include "fortranobject.h"
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
/*
This file implements: FortranObject, array_from_pyobj, copy_ND_array
Author: Pearu Peterson <pearu@cens.ioc.ee>
$Revision: 1.52 $
$Date: 2005/07/11 07:44:2... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/src/fortranobject.h | #ifndef Py_FORTRANOBJECT_H
#define Py_FORTRANOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <Python.h>
#ifndef NPY_NO_DEPRECATED_API
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#endif
#ifdef FORTRANOBJECT_C
#define NO_IMPORT_ARRAY
#endif
#define PY_ARRAY_UNIQUE_SYMBOL _npy_f2py_ARRAY_API
#include "numpy/a... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_data.py | import os
import pytest
import numpy as np
from . import util
from numpy.f2py.crackfortran import crackfortran
class TestData(util.F2PyTest):
sources = [util.getpath("tests", "src", "crackfortran", "data_stmts.f90")]
# For gh-23276
def test_data_stmts(self):
assert self.module.cmplxdat.i == 2
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_compile_function.py | """See https://github.com/numpy/numpy/pull/11937.
"""
import sys
import os
import uuid
from importlib import import_module
import pytest
import numpy.f2py
from . import util
def setup_module():
if not util.has_c_compiler():
pytest.skip("Needs C compiler")
if not util.has_f77_compiler():
pyt... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_parameter.py | import os
import pytest
import numpy as np
from . import util
class TestParameters(util.F2PyTest):
# Check that intent(in out) translates as intent(inout)
sources = [
util.getpath("tests", "src", "parameter", "constant_real.f90"),
util.getpath("tests", "src", "parameter", "constant_integer.f... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_docs.py | import os
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_equal
from . import util
def get_docdir():
# assuming that documentation tests are run from a source
# directory
return os.path.abspath(os.path.join(
os.path.dirname(__file__),
'..', '..', '..',... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_crackfortran.py | import importlib
import codecs
import time
import unicodedata
import pytest
import numpy as np
from numpy.f2py.crackfortran import markinnerspaces, nameargspattern
from . import util
from numpy.f2py import crackfortran
import textwrap
import contextlib
import io
class TestNoSpace(util.F2PyTest):
# issue gh-15035:... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_abstract_interface.py | from pathlib import Path
import pytest
import textwrap
from . import util
from numpy.f2py import crackfortran
from numpy.testing import IS_WASM
@pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
class TestAbstractInterface(util.F2PyTest):
sources = [util.getpath("tests", "src", "abstract_interface", "... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_f2py2e.py | import textwrap, re, sys, subprocess, shlex
from pathlib import Path
from collections import namedtuple
import pytest
from . import util
from numpy.f2py.f2py2e import main as f2pycli
#########################
# CLI utils and classes #
#########################
PPaths = namedtuple("PPaths", "finp, f90inp, pyf, wrap7... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_block_docstring.py | import sys
import pytest
from . import util
from numpy.testing import IS_PYPY
class TestBlockDocString(util.F2PyTest):
sources = [util.getpath("tests", "src", "block_docstring", "foo.f")]
@pytest.mark.skipif(sys.platform == "win32",
reason="Fails with MinGW64 Gfortran (Issue #9673)")... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_array_from_pyobj.py | import os
import sys
import copy
import platform
import pytest
import numpy as np
from numpy.testing import assert_, assert_equal
from numpy._core._type_aliases import c_names_dict as _c_names_dict
from . import util
wrap = None
# Extend core typeinfo with CHARACTER to test dtype('c')
c_names_dict = dict(
CHARA... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_regression.py | import os
import pytest
import numpy as np
from . import util
class TestIntentInOut(util.F2PyTest):
# Check that intent(in out) translates as intent(inout)
sources = [util.getpath("tests", "src", "regression", "inout.f90")]
@pytest.mark.slow
def test_inout(self):
# non-contiguous should rai... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_common.py | import os
import sys
import pytest
import numpy as np
from . import util
class TestCommonBlock(util.F2PyTest):
sources = [util.getpath("tests", "src", "common", "block.f")]
@pytest.mark.skipif(sys.platform == "win32",
reason="Fails with MinGW64 Gfortran (Issue #9673)")
def test_c... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_size.py | import os
import pytest
import numpy as np
from . import util
class TestSizeSumExample(util.F2PyTest):
sources = [util.getpath("tests", "src", "size", "foo.f90")]
@pytest.mark.slow
def test_all(self):
r = self.module.foo([[]])
assert r == [0]
r = self.module.foo([[1, 2]])
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_return_complex.py | import pytest
from numpy import array
from . import util
class TestReturnComplex(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t8", "s0", "s8"]:
err = 1e-5
else:
err = 0.0
assert abs(t(234j) - 234.0j) <= err
assert abs(t(234.6) - 2... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_f2cmap.py | from . import util
import numpy as np
class TestF2Cmap(util.F2PyTest):
sources = [
util.getpath("tests", "src", "f2cmap", "isoFortranEnvMap.f90"),
util.getpath("tests", "src", "f2cmap", ".f2py_f2cmap")
]
# gh-15095
def test_long_long_map(self):
inp = np.ones(3)
out = se... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_return_integer.py | import pytest
from numpy import array
from . import util
class TestReturnInteger(util.F2PyTest):
def check_function(self, t, tname):
assert t(123) == 123
assert t(123.6) == 123
assert t("123") == 123
assert t(-123) == -123
assert t([123]) == 123
assert t((123, )) =... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_assumed_shape.py | import os
import pytest
import tempfile
from . import util
class TestAssumedShapeSumExample(util.F2PyTest):
sources = [
util.getpath("tests", "src", "assumed_shape", "foo_free.f90"),
util.getpath("tests", "src", "assumed_shape", "foo_use.f90"),
util.getpath("tests", "src", "assumed_shape"... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_callback.py | import math
import textwrap
import sys
import pytest
import threading
import traceback
import time
import numpy as np
from numpy.testing import IS_PYPY
from . import util
class TestF77Callback(util.F2PyTest):
sources = [util.getpath("tests", "src", "callback", "foo.f")]
@pytest.mark.parametrize("name", "t,t... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_string.py | import os
import pytest
import textwrap
import numpy as np
from . import util
class TestString(util.F2PyTest):
sources = [util.getpath("tests", "src", "string", "char.f90")]
@pytest.mark.slow
def test_char(self):
strings = np.array(["ab", "cd", "ef"], dtype="c").T
inp, out = self.module.c... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_value_attrspec.py | import os
import pytest
from . import util
class TestValueAttr(util.F2PyTest):
sources = [util.getpath("tests", "src", "value_attrspec", "gh21665.f90")]
# gh-21665
def test_long_long_map(self):
inp = 2
out = self.module.fortfuncs.square(inp)
exp_out = 4
assert out == exp_o... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_kind.py | import os
import pytest
import platform
from numpy.f2py.crackfortran import (
_selected_int_kind_func as selected_int_kind,
_selected_real_kind_func as selected_real_kind,
)
from . import util
class TestKind(util.F2PyTest):
sources = [util.getpath("tests", "src", "kind", "foo.f90")]
def test_int(sel... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_return_character.py | import pytest
from numpy import array
from . import util
import platform
IS_S390X = platform.machine() == "s390x"
class TestReturnCharacter(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t1", "s0", "s1"]:
assert t("23") == b"2"
r = t("ab")
ass... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_symbolic.py | import pytest
from numpy.f2py.symbolic import (
Expr,
Op,
ArithOp,
Language,
as_symbol,
as_number,
as_string,
as_array,
as_complex,
as_terms,
as_factors,
eliminate_quotes,
insert_quotes,
fromstring,
as_expr,
as_apply,
as_numer_denom,
as_ternary,
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/util.py | """
Utility functions for
- building and importing modules on test time, using a temporary location
- detecting if compilers are present
- determining paths to tests
"""
import glob
import os
import sys
import subprocess
import tempfile
import shutil
import atexit
import textwrap
import re
import pytest
import contex... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_module_doc.py | import os
import sys
import pytest
import textwrap
from . import util
from numpy.testing import IS_PYPY
class TestModuleDocString(util.F2PyTest):
sources = [
util.getpath("tests", "src", "module_data",
"module_data_docstring.f90")
]
@pytest.mark.skipif(sys.platform == "win32... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_return_real.py | import platform
import pytest
import numpy as np
from numpy import array
from . import util
class TestReturnReal(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t4", "s0", "s4"]:
err = 1e-5
else:
err = 0.0
assert abs(t(234) - 234.0) <= err
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_return_logical.py | import pytest
from numpy import array
from . import util
class TestReturnLogical(util.F2PyTest):
def check_function(self, t):
assert t(True) == 1
assert t(False) == 0
assert t(0) == 0
assert t(None) == 0
assert t(0.0) == 0
assert t(0j) == 0
assert t(1j) == ... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_semicolon_split.py | import platform
import pytest
import numpy as np
from . import util
@pytest.mark.skipif(
platform.system() == "Darwin",
reason="Prone to error when run with numpy/f2py/tests on mac os, "
"but not when run in isolation",
)
@pytest.mark.skipif(
np.dtype(np.intp).itemsize < 8,
reason="32-bit builds ... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_character.py | import pytest
import textwrap
from numpy.testing import assert_array_equal, assert_equal, assert_raises
import numpy as np
from numpy.f2py.tests import util
class TestCharacterString(util.F2PyTest):
# options = ['--debug-capi', '--build-dir', '/tmp/test-build-f2py']
suffix = '.f90'
fprefix = 'test_charact... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_mixed.py | import os
import textwrap
import pytest
from numpy.testing import IS_PYPY
from . import util
class TestMixed(util.F2PyTest):
sources = [
util.getpath("tests", "src", "mixed", "foo.f"),
util.getpath("tests", "src", "mixed", "foo_fixed.f90"),
util.getpath("tests", "src", "mixed", "foo_free.... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_isoc.py | from . import util
import numpy as np
class TestISOC(util.F2PyTest):
sources = [
util.getpath("tests", "src", "isocintrin", "isoCtests.f90"),
]
# gh-24553
def test_c_double(self):
out = self.module.coddity.c_add(1, 2)
exp_out = 3
assert out == exp_out
# gh-9693
... | 0 |
public_repos/numpy/numpy/f2py | public_repos/numpy/numpy/f2py/tests/test_quoted_character.py | """See https://github.com/numpy/numpy/pull/10676.
"""
import sys
import pytest
from . import util
class TestQuotedCharacter(util.F2PyTest):
sources = [util.getpath("tests", "src", "quoted_character", "foo.f")]
@pytest.mark.skipif(sys.platform == "win32",
reason="Fails with MinGW64 G... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/block_docstring/foo.f | SUBROUTINE FOO()
INTEGER BAR(2, 3)
COMMON /BLOCK/ BAR
RETURN
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/isocintrin/isoCtests.f90 | module coddity
use iso_c_binding, only: c_double, c_int
implicit none
contains
subroutine c_add(a, b, c) bind(c, name="c_add")
real(c_double), intent(in) :: a, b
real(c_double), intent(out) :: c
c = a + b
end subroutine c_add
! gh-9693
function wat(x, y) res... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/common/block.f | SUBROUTINE INITCB
DOUBLE PRECISION LONG
CHARACTER STRING
INTEGER OK
COMMON /BLOCK/ LONG, STRING, OK
LONG = 1.0
STRING = '2'
OK = 3
RETURN
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/callback/gh17797.f90 | function gh17797(f, y) result(r)
external f
integer(8) :: r, f
integer(8), dimension(:) :: y
r = f(0)
r = r + sum(y)
end function gh17797
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/callback/gh18335.f90 | ! When gh18335_workaround is defined as an extension,
! the issue cannot be reproduced.
!subroutine gh18335_workaround(f, y)
! implicit none
! external f
! integer(kind=1) :: y(1)
! call f(y)
!end subroutine gh18335_workaround
function gh18335... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/callback/foo.f | subroutine t(fun,a)
integer a
cf2py intent(out) a
external fun
call fun(a)
end
subroutine func(a)
cf2py intent(in,out) a
integer a
a = a + 11
end
subroutine func0(a)
cf2py intent(out) a
integer a
a = 11
end
subroutin... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_real/foo77.f | function t0(value)
real value
real t0
t0 = value
end
function t4(value)
real*4 value
real*4 t4
t4 = value
end
function t8(value)
real*8 value
real*8 t8
t8 = value
end
function td(value)
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_real/foo90.f90 | module f90_return_real
contains
function t0(value)
real :: value
real :: t0
t0 = value
end function t0
function t4(value)
real(kind=4) :: value
real(kind=4) :: t4
t4 = value
end function t4
function t8(value)
real(kind=8... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/regression/inout.f90 | ! Check that intent(in out) translates as intent(inout).
! The separation seems to be a common usage.
subroutine foo(x)
implicit none
real(4), intent(in out) :: x
dimension x(3)
x(1) = x(1) + x(2) + x(3)
return
end
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/mixed/foo_fixed.f90 | module foo_fixed
contains
subroutine bar12(a)
!f2py intent(out) a
integer a
a = 12
end subroutine bar12
end module foo_fixed
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/mixed/foo.f | subroutine bar11(a)
cf2py intent(out) a
integer a
a = 11
end
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/mixed/foo_free.f90 | module foo_free
contains
subroutine bar13(a)
!f2py intent(out) a
integer a
a = 13
end subroutine bar13
end module foo_free
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_integer/foo77.f | function t0(value)
integer value
integer t0
t0 = value
end
function t1(value)
integer*1 value
integer*1 t1
t1 = value
end
function t2(value)
integer*2 value
integer*2 t2
t2 = value
end
funct... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_integer/foo90.f90 | module f90_return_integer
contains
function t0(value)
integer :: value
integer :: t0
t0 = value
end function t0
function t1(value)
integer(kind=1) :: value
integer(kind=1) :: t1
t1 = value
end function t1
function t2(value)
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/assumed_shape/foo_use.f90 | subroutine sum_with_use(x, res)
use precision
implicit none
real(kind=rk), intent(in) :: x(:)
real(kind=rk), intent(out) :: res
integer :: i
!print *, "size(x) = ", size(x)
res = 0.0
do i = 1, size(x)
res = res + x(i)
enddo
end subroutine
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/assumed_shape/precision.f90 | module precision
integer, parameter :: rk = selected_real_kind(8)
integer, parameter :: ik = selected_real_kind(4)
end module
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/assumed_shape/.f2py_f2cmap | dict(real=dict(rk="double"))
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/assumed_shape/foo_mod.f90 |
module mod
contains
subroutine sum(x, res)
implicit none
real, intent(in) :: x(:)
real, intent(out) :: res
integer :: i
!print *, "sum: size(x) = ", size(x)
res = 0.0
do i = 1, size(x)
res = res + x(i)
enddo
end subroutine sum
function fsum(x) result (res)
implicit none
real, intent(in)... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/assumed_shape/foo_free.f90 |
subroutine sum(x, res)
implicit none
real, intent(in) :: x(:)
real, intent(out) :: res
integer :: i
!print *, "sum: size(x) = ", size(x)
res = 0.0
do i = 1, size(x)
res = res + x(i)
enddo
end subroutine sum
function fsum(x) result (res)
implicit none
real, intent(in) :: x(:)
real :: res... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/string/gh24008.f | SUBROUTINE GREET(NAME, GREETING)
CHARACTER NAME*(*), GREETING*(*)
CHARACTER*(50) MESSAGE
MESSAGE = 'Hello, ' // NAME // ', ' // GREETING
c$$$ PRINT *, MESSAGE
END SUBROUTINE GREET
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/string/char.f90 | MODULE char_test
CONTAINS
SUBROUTINE change_strings(strings, n_strs, out_strings)
IMPLICIT NONE
! Inputs
INTEGER, INTENT(IN) :: n_strs
CHARACTER, INTENT(IN), DIMENSION(2,n_strs) :: strings
CHARACTER, INTENT(OUT), DIMENSION(2,n_strs) :: out_strings
!f2py INTEGER, INTENT(IN) :: n_strs
!f2py CHARAC... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/string/string.f | C FILE: STRING.F
SUBROUTINE FOO(A,B,C,D)
CHARACTER*5 A, B
CHARACTER*(*) C,D
Cf2py intent(in) a,c
Cf2py intent(inout) b,d
A(1:1) = 'A'
B(1:1) = 'B'
C(1:1) = 'C'
D(1:1) = 'D'
END
C END OF FILE STRING.F
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/string/fixed_string.f90 | function sint(s) result(i)
implicit none
character(len=*) :: s
integer :: j, i
i = 0
do j=len(s), 1, -1
if (.not.((i.eq.0).and.(s(j:j).eq.' '))) then
i = i + ichar(s(j:j)) * 10 ** (j - 1)
endif
end do
return
end function sint
function test_in_bytes4(a) result (i)
implicit none
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/string/scalar_string.f90 | MODULE string_test
character(len=8) :: string
character string77 * 8
character(len=12), dimension(5,7) :: strarr
character strarr77(5,7) * 12
END MODULE string_test
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/negative_bounds/issue_20853.f90 | subroutine foo(is_, ie_, arr, tout)
implicit none
integer :: is_,ie_
real, intent(in) :: arr(is_:ie_)
real, intent(out) :: tout(is_:ie_)
tout = arr
end
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/parameter/constant_integer.f90 | ! Check that parameters are correct intercepted.
! Constants with comma separations are commonly
! used, for instance Pi = 3._dp
subroutine foo_int(x)
implicit none
integer, parameter :: ii = selected_int_kind(9)
integer(ii), intent(inout) :: x
dimension x(3)
integer(ii), parameter :: three = 3_ii
x(1) = x(... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/parameter/constant_compound.f90 | ! Check that parameters are correct intercepted.
! Constants with comma separations are commonly
! used, for instance Pi = 3._dp
subroutine foo_compound_int(x)
implicit none
integer, parameter :: ii = selected_int_kind(9)
integer(ii), intent(inout) :: x
dimension x(3)
integer(ii), parameter :: three = 3_ii
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/parameter/constant_non_compound.f90 | ! Check that parameters are correct intercepted.
! Specifically that types of constants without
! compound kind specs are correctly inferred
! adapted Gibbs iteration code from pymc
! for this test case
subroutine foo_non_compound_int(x)
implicit none
integer, parameter :: ii = selected_int_kind(9)
integer(ii... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/parameter/constant_both.f90 | ! Check that parameters are correct intercepted.
! Constants with comma separations are commonly
! used, for instance Pi = 3._dp
subroutine foo(x)
implicit none
integer, parameter :: sp = selected_real_kind(6)
integer, parameter :: dp = selected_real_kind(15)
integer, parameter :: ii = selected_int_kind(9)
in... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/parameter/constant_real.f90 | ! Check that parameters are correct intercepted.
! Constants with comma separations are commonly
! used, for instance Pi = 3._dp
subroutine foo_single(x)
implicit none
integer, parameter :: rp = selected_real_kind(6)
real(rp), intent(inout) :: x
dimension x(3)
real(rp), parameter :: three = 3._rp
x(1) = x(1... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/abstract_interface/foo.f90 | module ops_module
abstract interface
subroutine op(x, y, z)
integer, intent(in) :: x, y
integer, intent(out) :: z
end subroutine
end interface
contains
subroutine foo(x, y, r1, r2)
integer, intent(in) :: x, y
integer, intent(out) :: r1, r2
procedure (op) add1, add2
procedure... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/abstract_interface/gh18403_mod.f90 | module test
abstract interface
subroutine foo()
end subroutine
end interface
end module test
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_complex/foo77.f | function t0(value)
complex value
complex t0
t0 = value
end
function t8(value)
complex*8 value
complex*8 t8
t8 = value
end
function t16(value)
complex*16 value
complex*16 t16
t16 = value
end
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_complex/foo90.f90 | module f90_return_complex
contains
function t0(value)
complex :: value
complex :: t0
t0 = value
end function t0
function t8(value)
complex(kind=4) :: value
complex(kind=4) :: t8
t8 = value
end function t8
function t16(value)
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/kind/foo.f90 |
subroutine selectedrealkind(p, r, res)
implicit none
integer, intent(in) :: p, r
!f2py integer :: r=0
integer, intent(out) :: res
res = selected_real_kind(p, r)
end subroutine
subroutine selectedintkind(p, res)
implicit none
integer, intent(in) :: p
integer, intent(out) :: res
res = selected_i... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_character/foo77.f | function t0(value)
character value
character t0
t0 = value
end
function t1(value)
character*1 value
character*1 t1
t1 = value
end
function t5(value)
character*5 value
character*5 t5
t5 = value
end
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/return_character/foo90.f90 | module f90_return_char
contains
function t0(value)
character :: value
character :: t0
t0 = value
end function t0
function t1(value)
character(len=1) :: value
character(len=1) :: t1
t1 = value
end function t1
function t5(value)
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/value_attrspec/gh21665.f90 | module fortfuncs
implicit none
contains
subroutine square(x,y)
integer, intent(in), value :: x
integer, intent(out) :: y
y = x*x
end subroutine square
end module fortfuncs
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/f2cmap/isoFortranEnvMap.f90 | subroutine func1(n, x, res)
use, intrinsic :: iso_fortran_env, only: int64, real64
implicit none
integer(int64), intent(in) :: n
real(real64), intent(in) :: x(n)
real(real64), intent(out) :: res
!f2py intent(hide) :: n
res = sum(x)
end
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/f2cmap/.f2py_f2cmap | dict(real=dict(real32='float', real64='double'), integer=dict(int64='long_long'))
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/array_from_pyobj/wrapmodule.c | /*
* This file was auto-generated with f2py (version:2_1330) and hand edited by
* Pearu for testing purposes. Do not edit this file unless you know what you
* are doing!!!
*/
#ifdef __cplusplus
extern "C" {
#endif
/*********************** See f2py2e/cfuncs.py: includes ***********************/
#define PY_SSIZE_... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/size/foo.f90 |
subroutine foo(a, n, m, b)
implicit none
real, intent(in) :: a(n, m)
integer, intent(in) :: n, m
real, intent(out) :: b(size(a, 1))
integer :: i
do i = 1, size(b)
b(i) = sum(a(i,:))
enddo
end subroutine
subroutine trans(x,y)
implicit none
real, intent(in), dimension(:,:) :: x
real, intent(o... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/quoted_character/foo.f | SUBROUTINE FOO(OUT1, OUT2, OUT3, OUT4, OUT5, OUT6)
CHARACTER SINGLE, DOUBLE, SEMICOL, EXCLA, OPENPAR, CLOSEPAR
PARAMETER (SINGLE="'", DOUBLE='"', SEMICOL=';', EXCLA="!",
1 OPENPAR="(", CLOSEPAR=")")
CHARACTER OUT1, OUT2, OUT3, OUT4, OUT5, OUT6
Cf2py intent(out) OUT1, OUT2, OUT3, O... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/data_multiplier.f | BLOCK DATA MYBLK
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
COMMON /MYCOM/ IVAR1, IVAR2, IVAR3, IVAR4, EVAR5
DATA IVAR1, IVAR2, IVAR3, IVAR4, EVAR5 /2*3,2*2,0.0D0/
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/foo_deps.f90 | module foo
type bar
character(len = 4) :: text
end type bar
type(bar), parameter :: abar = bar('abar')
end module foo
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/operators.f90 | module foo
type bar
character(len = 32) :: item
end type bar
interface operator(.item.)
module procedure item_int, item_real
end interface operator(.item.)
interface operator(==)
module procedure items_are_equal
end interface operator(==)
interface assignment(=)
module procedure get_in... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/pubprivmod.f90 | module foo
public
integer, private :: a
integer :: b
contains
subroutine setA(v)
integer, intent(in) :: v
a = v
end subroutine setA
end module foo
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh2848.f90 | subroutine gh2848( &
! first 2 parameters
par1, par2,&
! last 2 parameters
par3, par4)
integer, intent(in) :: par1, par2
integer, intent(out) :: par3, par4
par3 = par1
par4 = par2
end subroutine gh2848
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh23533.f | SUBROUTINE EXAMPLE( )
IF( .TRUE. ) THEN
CALL DO_SOMETHING()
END IF ! ** .TRUE. **
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh15035.f | subroutine subb(k)
real(8), intent(inout) :: k(:)
k=k+1
endsubroutine
subroutine subc(w,k)
real(8), intent(in) :: w(:)
real(8), intent(out) :: k(size(w))
k=w+1
endsubroutine
function t0(value)
character value
... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh22648.pyf | python module iri16py ! in
interface ! in :iri16py
block data ! in :iri16py:iridreg_modified.for
COMMON /fircom/ eden,tabhe,tabla,tabmo,tabza,tabfl
end block data
end interface
end python module iri16py
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh23598.f90 | integer function intproduct(a, b) result(res)
integer, intent(in) :: a, b
res = a*b
end function
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/data_stmts.f90 | ! gh-23276
module cmplxdat
implicit none
integer :: i, j
real :: x, y
real, dimension(2) :: z
real(kind=8) :: pi
complex(kind=8), target :: medium_ref_index
complex(kind=8), target :: ref_index_one, ref_index_two
complex(kind=8), dimension(2) :: my_array
real(kind=8), dimension(3) :: my_real_array = (... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/accesstype.f90 | module foo
public
type, private, bind(c) :: a
integer :: i
end type a
type, bind(c) :: b_
integer :: j
end type b_
public :: b_
type :: c
integer :: k
end type c
end module foo
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/unicode_comment.f90 | subroutine foo(x)
real(8), intent(in) :: x
! Écrit à l'écran la valeur de x
end subroutine
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh17859.f | integer(8) function external_as_statement(fcn)
implicit none
external fcn
integer(8) :: fcn
external_as_statement = fcn(0)
end
integer(8) function external_as_attribute(fcn)
implicit none
integer(8), external :: fcn
external_as_attribute =... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh23598Warn.f90 | module test_bug
implicit none
private
public :: intproduct
contains
integer function intproduct(a, b) result(res)
integer, intent(in) :: a, b
res = a*b
end function
end module
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/publicmod.f90 | module foo
public
integer, private :: a
public :: setA
contains
subroutine setA(v)
integer, intent(in) :: v
a = v
end subroutine setA
end module foo
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/gh23879.f90 | module gh23879
implicit none
private
public :: foo
contains
subroutine foo(a, b)
integer, intent(in) :: a
integer, intent(out) :: b
b = a
call bar(b)
end subroutine
subroutine bar(x)
integer, intent(inout) :: x
x = 2*x
end subroutine
end mod... | 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/data_common.f | BLOCK DATA PARAM_INI
COMMON /MYCOM/ MYDATA
DATA MYDATA /0/
END
SUBROUTINE SUB1
COMMON /MYCOM/ MYDATA
MYDATA = MYDATA + 1
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/data_with_comments.f | BLOCK DATA PARAM_INI
COMMON /MYCOM/ MYTAB
INTEGER MYTAB(3)
DATA MYTAB/
* 0, ! 1 and more commenty stuff
* 4, ! 2
* 0 /
END
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/crackfortran/privatemod.f90 | module foo
private
integer :: a
public :: setA
integer :: b
contains
subroutine setA(v)
integer, intent(in) :: v
a = v
end subroutine setA
end module foo
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/cli/hi77.f | SUBROUTINE HI
PRINT*, "HELLO WORLD"
END SUBROUTINE
| 0 |
public_repos/numpy/numpy/f2py/tests/src | public_repos/numpy/numpy/f2py/tests/src/cli/hiworld.f90 | function hi()
print*, "Hello World"
end function
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.