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/tests/src
public_repos/numpy/numpy/f2py/tests/src/return_logical/foo77.f
function t0(value) logical value logical t0 t0 = value end function t1(value) logical*1 value logical*1 t1 t1 = value end function t2(value) logical*2 value logical*2 t2 t2 = value end funct...
0
public_repos/numpy/numpy/f2py/tests/src
public_repos/numpy/numpy/f2py/tests/src/return_logical/foo90.f90
module f90_return_logical contains function t0(value) logical :: value logical :: t0 t0 = value end function t0 function t1(value) logical(kind=1) :: value logical(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/module_data/module_data_docstring.f90
module mod integer :: i integer :: x(4) real, dimension(2,3) :: a real, allocatable, dimension(:,:) :: b contains subroutine foo integer :: k k = 1 a(1,2) = a(1,2)+3 end subroutine foo end module mod
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/mrecords.pyi
from typing import Any, TypeVar from numpy import dtype from numpy.ma import MaskedArray __all__: list[str] # TODO: Set the `bound` to something more suitable once we # have proper shape support _ShapeType = TypeVar("_ShapeType", bound=Any) _DType_co = TypeVar("_DType_co", bound=dtype[Any], covariant=True) class Ma...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/__init__.pyi
from numpy._pytesttester import PytestTester from numpy.ma import extras as extras from numpy.ma.core import ( MAError as MAError, MaskError as MaskError, MaskType as MaskType, MaskedArray as MaskedArray, abs as abs, absolute as absolute, add as add, all as all, allclose as allclos...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/core.pyi
from collections.abc import Callable from typing import Any, TypeVar from numpy import ndarray, dtype, float64 from numpy import ( amax as amax, amin as amin, bool_ as bool_, expand_dims as expand_dims, clip as clip, indices as indices, ones_like as ones_like, squeeze as squeeze, ze...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/README.rst
================================== A guide to masked arrays in NumPy ================================== .. Contents:: See http://www.scipy.org/scipy/numpy/wiki/MaskedArray (dead link) for updates of this document. History ------- As a regular user of MaskedArray, I (Pierre G.F. Gerard-Marchant) became increasingly...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/extras.pyi
from typing import Any from numpy.lib.index_tricks import AxisConcatenator from numpy.ma.core import ( dot as dot, mask_rowcols as mask_rowcols, ) __all__: list[str] def count_masked(arr, axis=...): ... def masked_all(shape, dtype = ...): ... def masked_all_like(arr): ... class _fromnxfunction: __name__...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/timer_comparison.py
import timeit from functools import reduce import numpy as np import numpy._core.fromnumeric as fromnumeric from numpy.testing import build_err_msg pi = np.pi class ModuleTester: def __init__(self, module): self.module = module self.allequal = module.allequal self.arange = module.arange...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/API_CHANGES.txt
.. -*- rest -*- ================================================== API changes in the new masked array implementation ================================================== Masked arrays are subclasses of ndarray --------------------------------------- Contrary to the original implementation, masked arrays are now regul...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/core.py
""" numpy.ma : a package to handle missing or invalid values. This package was initially written for numarray by Paul F. Dubois at Lawrence Livermore National Laboratory. In 2006, the package was completely rewritten by Pierre Gerard-Marchant (University of Georgia) to make the MaskedArray class a subclass of ndarray,...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/testutils.py
"""Miscellaneous functions for testing masked arrays and subclasses :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: testutils.py 3529 2007-11-13 08:01:14Z jarrod.millman $ """ import operator import numpy as np from numpy import ndarray import numpy._core.umath as umath import numpy....
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/LICENSE
* Copyright (c) 2006, University of Georgia and Pierre G.F. Gerard-Marchant * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright *...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/mrecords.py
""":mod:`numpy.ma..mrecords` Defines the equivalent of :class:`numpy.recarrays` for masked arrays, where fields can be accessed as attributes. Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes and the masking of individual fields. .. moduleauthor:: Pierre Gerard-Marchant """ # We should ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/extras.py
""" Masked arrays add-ons. A collection of utilities for `numpy.ma`. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ __all__ = [ 'apply_along_axis', 'apply_over_axes', 'atleast_1d', 'atleast_2d', 'atleast_3d', 'average'...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/ma/__init__.py
""" ============= Masked Arrays ============= Arrays sometimes contain invalid or missing data. When doing operations on such arrays, we wish to suppress invalid values, which is the purpose masked arrays fulfill (an example of typical use is given below). For example, examine the following array: >>> x = np.array(...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_extras.py
# pylint: disable-msg=W0611, W0612, W0511 """Tests suite for MaskedArray. Adapted from the original test_ma by Pierre Gerard-Marchant :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ import warnings import itertools import p...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_mrecords.py
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for mrecords. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ import pickle import numpy as np import numpy.ma as ma from numpy.ma import masked, nomask from numpy.testing import temppath from numpy._core.records import ( recarr...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_regression.py
import numpy as np from numpy.testing import ( assert_, assert_array_equal, assert_allclose, suppress_warnings ) class TestRegression: def test_masked_array_create(self): # Ticket #17 x = np.ma.masked_array([0, 1, 2, 3, 0, 4, 5, 6], mask=[0, 0, 0, 1, 1, 1, 0,...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_arrayobject.py
import pytest import numpy as np from numpy.ma import masked_array from numpy.testing import assert_array_equal def test_matrix_transpose_raises_error_for_1d(): msg = "matrix transpose with ndim < 2 is undefined" ma_arr = masked_array(data=[1, 2, 3, 4, 5, 6], mask=[1, 0, 1, 1, 1, 0]...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_core.py
# pylint: disable-msg=W0400,W0511,W0611,W0612,W0614,R0201,E1102 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu """ __author__ = "Pierre GF Gerard-Marchant" import sys import warnings import copy import operator import itertools import textwrap import pi...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_deprecations.py
"""Test deprecation and future warnings. """ import pytest import numpy as np from numpy.testing import assert_warns from numpy.ma.testutils import assert_equal from numpy.ma.core import MaskedArrayFutureWarning import io import textwrap class TestArgsort: """ gh-8701 """ def _test_base(self, argsort, cls): ...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_old_ma.py
from functools import reduce import pickle import pytest import numpy as np import numpy._core.umath as umath import numpy._core.fromnumeric as fromnumeric from numpy.testing import ( assert_, assert_raises, assert_equal, ) from numpy.ma import ( MaskType, MaskedArray, absolute, add, all, allclose, allequ...
0
public_repos/numpy/numpy/ma
public_repos/numpy/numpy/ma/tests/test_subclassing.py
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_subclassing.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ import numpy as np from numpy.lib.mixins import NDArrayOperatorsMixin from n...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/__init__.pyi
from typing import Any # TODO: remove when the full numpy namespace is defined def __getattr__(name: str) -> Any: ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/line_endings.py
""" Functions for converting from DOS to UNIX line endings """ import os import re import sys def dos2unix(file): "Replace CRLF with LF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") return with open(file, "rb") as fp: data = ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/mingw32ccompiler.py
""" Support code for building Python extensions on Windows. # NT stuff # 1. Make sure libpython<version>.a exists for gcc. If not, build it. # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) # 3. Force windows to use g77 """ import os import sys import subprocess import re im...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/msvc9compiler.py
import os from distutils.msvc9compiler import MSVCCompiler as _MSVCCompiler from .system_info import platform_bits def _merge(old, new): """Concatenate two environment paths avoiding repeats. Here `old` is the environment string before the base class initialize function is called and `new` is the string...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/pathccompiler.py
from distutils.unixccompiler import UnixCCompiler class PathScaleCCompiler(UnixCCompiler): """ PathScale compiler compatible with an gcc built Python. """ compiler_type = 'pathcc' cc_exe = 'pathcc' cxx_exe = 'pathCC' def __init__ (self, verbose=0, dry_run=0, force=0): UnixCCompil...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/log.py
# Colored log import sys from distutils.log import * # noqa: F403 from distutils.log import Log as old_Log from distutils.log import _global_log from numpy.distutils.misc_util import (red_text, default_text, cyan_text, green_text, is_sequence, is_string) def _fix_args(args,flag=1): if is_string(args): ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/intelccompiler.py
import platform from distutils.unixccompiler import UnixCCompiler from numpy.distutils.exec_command import find_executable from numpy.distutils.ccompiler import simple_version_match if platform.system() == 'Windows': from numpy.distutils.msvc9compiler import MSVCCompiler class IntelCCompiler(UnixCCompiler): ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/ccompiler.py
import os import re import sys import platform import shlex import time import subprocess from copy import copy from pathlib import Path from distutils import ccompiler from distutils.ccompiler import ( compiler_class, gen_lib_options, get_default_compiler, new_compiler, CCompiler ) from distutils.errors import...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/conv_template.py
#!/usr/bin/env python3 """ takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h, using the following template rules /**begin repeat -- on a line by itself marks the start of a repeated code segment /**end repeat**/ -- on a line by itself marks it's end After the /**b...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/lib2def.py
import re import sys import subprocess __doc__ = """This module generates a DEF file from the symbols in an MSVC-compiled DLL import library. It correctly discriminates between data and functions. The data is collected from the output of the program nm(1). Usage: python lib2def.py [libname.lib] [output.def] or ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/fujitsuccompiler.py
from distutils.unixccompiler import UnixCCompiler class FujitsuCCompiler(UnixCCompiler): """ Fujitsu compiler. """ compiler_type = 'fujitsu' cc_exe = 'fcc' cxx_exe = 'FCC' def __init__(self, verbose=0, dry_run=0, force=0): UnixCCompiler.__init__(self, verbose, dry_run, force) ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/core.py
import sys from distutils.core import Distribution if 'setuptools' in sys.modules: have_setuptools = True from setuptools import setup as old_setup # easy_install imports math, it may be picked up from cwd from setuptools.command import easy_install try: # very old versions of setuptools do...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/msvccompiler.py
import os from distutils.msvccompiler import MSVCCompiler as _MSVCCompiler from .system_info import platform_bits def _merge(old, new): """Concatenate two environment paths avoiding repeats. Here `old` is the environment string before the base class initialize function is called and `new` is the string ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/numpy_distribution.py
# XXX: Handle setuptools ? from distutils.core import Distribution # This class is used because we add new files (sconscripts, and so on) with the # scons command class NumpyDistribution(Distribution): def __init__(self, attrs = None): # A list of (sconscripts, pre_hook, post_hook, src, parent_names) ...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/exec_command.py
""" exec_command Implements exec_command function that is (almost) equivalent to commands.getstatusoutput function but on NT, DOS systems the returned status is actually correct (though, the returned status values may be different by a factor). In addition, exec_command takes keyword arguments for (re-)defining enviro...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/unixccompiler.py
""" unixccompiler - can handle very long argument lists for ar. """ import os import sys import subprocess import shlex from distutils.errors import CompileError, DistutilsExecError, LibError from distutils.unixccompiler import UnixCCompiler from numpy.distutils.ccompiler import replace_method from numpy.distutils.mi...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/npy_pkg_config.py
import sys import re import os from configparser import RawConfigParser __all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet', 'read_config', 'parse_flags'] _VAR = re.compile(r'\$\{([a-zA-Z0-9_-]+)\}') class FormatError(OSError): """ Exception thrown when there is a problem parsing a...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/ccompiler_opt.py
"""Provides the `CCompilerOpt` class, used for handling the CPU/hardware optimization, starting from parsing the command arguments, to managing the relation between the CPU baseline and dispatch-able features, also generating the required C headers and ending with compiling the sources with proper compiler's flags. `C...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/_shell_utils.py
""" Helper functions for interacting with the shell, and consuming shell-style parameters provided in config files. """ import os import shlex import subprocess __all__ = ['WindowsParser', 'PosixParser', 'NativeParser'] class CommandLineParser: """ An object that knows how to split and join command-line argu...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/misc_util.py
import os import re import sys import copy import glob import atexit import tempfile import subprocess import shutil import multiprocessing import textwrap import importlib.util from threading import local as tlocal from functools import reduce import distutils from distutils.errors import DistutilsError # stores tem...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/armccompiler.py
from distutils.unixccompiler import UnixCCompiler class ArmCCompiler(UnixCCompiler): """ Arm compiler. """ compiler_type = 'arm' cc_exe = 'armclang' cxx_exe = 'armclang++' def __init__(self, verbose=0, dry_run=0, force=0): UnixCCompiler.__init__(self...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/system_info.py
#!/usr/bin/env python3 """ This file defines a set of system_info classes for getting information about various resources (libraries, library directories, include directories, etc.) in the system. Usage: info_dict = get_info(<name>) where <name> is a string 'atlas','x11','fftw','lapack','blas', 'lapack_src', 'b...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/__init__.py
""" An enhanced distutils, providing support for Fortran compilers, for BLAS, LAPACK and other common libraries for numerical computing, and more. Public submodules are:: misc_util system_info cpu_info log exec_command For details, please see the *Packaging* and *NumPy Distutils User Guide* secti...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/extension.py
"""distutils.extension Provides the Extension class, used to describe C/C++ extension modules in setup scripts. Overridden to support f2py. """ import re from distutils.extension import Extension as old_Extension cxx_ext_re = re.compile(r'.*\.(cpp|cxx|cc)\Z', re.I).match fortran_pyf_ext_re = re.compile(r'.*\.(f90|...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/from_template.py
#!/usr/bin/env python3 """ process_file(filename) takes templated file .xxx.src and produces .xxx file where .xxx is .pyf .f90 or .f using the following template rules: '<..>' denotes a template. All function and subroutine blocks in a source file with names that contain '<..>' will be replicated accordin...
0
public_repos/numpy/numpy
public_repos/numpy/numpy/distutils/cpuinfo.py
#!/usr/bin/env python3 """ cpuinfo Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. NO WARRANTY IS EX...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build_clib.py
""" Modified version of build_clib that handles fortran source files. """ import os from glob import glob import shutil from distutils.command.build_clib import build_clib as old_build_clib from distutils.errors import DistutilsSetupError, DistutilsError, \ DistutilsFileError from numpy.distutils import log from d...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build_ext.py
""" Modified version of build_ext that handles fortran source files. """ import os import subprocess from glob import glob from distutils.dep_util import newer_group from distutils.command.build_ext import build_ext as old_build_ext from distutils.errors import DistutilsFileError, DistutilsSetupError,\ DistutilsE...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build_src.py
""" Build swig and f2py sources. """ import os import re import sys import shlex import copy from distutils.command import build_ext from distutils.dep_util import newer_group, newer from distutils.util import get_platform from distutils.errors import DistutilsError, DistutilsSetupError # this import can't be done h...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/install_data.py
import sys have_setuptools = ('setuptools' in sys.modules) from distutils.command.install_data import install_data as old_install_data #data installer with improved intelligence over distutils #data files are copied into the project directory instead #of willy-nilly class install_data (old_install_data): def run...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/install_headers.py
import os from distutils.command.install_headers import install_headers as old_install_headers class install_headers (old_install_headers): def run (self): headers = self.distribution.headers if not headers: return prefix = os.path.dirname(self.install_dir) for header ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/config_compiler.py
from distutils.core import Command from numpy.distutils import log #XXX: Linker flags def show_fortran_compilers(_cache=None): # Using cache to prevent infinite recursion. if _cache: return elif _cache is None: _cache = [] _cache.append(1) from numpy.distutils.fcompiler import show...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/config.py
# Added Fortran compiler support to config. Currently useful only for # try_compile call. try_run works but is untested for most of Fortran # compilers (they must define linker_exe first). # Pearu Peterson import os import signal import subprocess import sys import textwrap import warnings from distutils.command.confi...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/egg_info.py
import sys from setuptools.command.egg_info import egg_info as _egg_info class egg_info(_egg_info): def run(self): if 'sdist' in sys.argv: import warnings import textwrap msg = textwrap.dedent(""" `build_src` is being run, this may lead to missing ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build_py.py
from distutils.command.build_py import build_py as old_build_py from numpy.distutils.misc_util import is_string class build_py(old_build_py): def run(self): build_src = self.get_finalized_command('build_src') if build_src.py_modules_dict and self.packages is None: self.packages = list(...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/bdist_rpm.py
import os import sys if 'setuptools' in sys.modules: from setuptools.command.bdist_rpm import bdist_rpm as old_bdist_rpm else: from distutils.command.bdist_rpm import bdist_rpm as old_bdist_rpm class bdist_rpm(old_bdist_rpm): def _make_spec_file(self): spec_file = old_bdist_rpm._make_spec_file(sel...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/install.py
import sys if 'setuptools' in sys.modules: import setuptools.command.install as old_install_mod have_setuptools = True else: import distutils.command.install as old_install_mod have_setuptools = False from distutils.file_util import write_file old_install = old_install_mod.install class install(old_in...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/install_clib.py
import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] def initialize_options(self): self.install_dir = None ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/develop.py
""" Override the develop command from setuptools so we can ensure that our generated files (from build_src or build_scripts) are properly converted to real files with filenames. """ from setuptools.command.develop import develop as old_develop class develop(old_develop): __doc__ = old_develop.__doc__ def inst...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build_scripts.py
""" Modified version of build_scripts that handles building scripts from functions. """ from distutils.command.build_scripts import build_scripts as old_build_scripts from numpy.distutils import log from numpy.distutils.misc_util import is_string class build_scripts(old_build_scripts): def generate_scripts(self,...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/sdist.py
import sys if 'setuptools' in sys.modules: from setuptools.command.sdist import sdist as old_sdist else: from distutils.command.sdist import sdist as old_sdist from numpy.distutils.misc_util import get_data_files class sdist(old_sdist): def add_defaults (self): old_sdist.add_defaults(self) ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/autodist.py
"""This module implements additional tests ala autoconf which can be useful. """ import textwrap # We put them here since they could be easily reused outside numpy.distutils def check_inline(cmd): """Return the inline identifier (may be empty).""" cmd._check_compiler() body = textwrap.dedent(""" ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/__init__.py
"""distutils.command Package containing implementation of all the standard Distutils commands. """ def test_na_writable_attributes_deletion(): a = np.NA(2) attr = ['payload', 'dtype'] for s in attr: assert_raises(AttributeError, delattr, a, s) __revision__ = "$Id: __init__.py,v 1.3 2005/05/16 1...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/command/build.py
import os import sys from distutils.command.build import build as old_build from distutils.util import get_platform from numpy.distutils.command.config_compiler import show_fortran_compilers class build(old_build): sub_commands = [('config_cc', lambda *args: True), ('config_fc', lambda...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/nv.py
from numpy.distutils.fcompiler import FCompiler compilers = ['NVHPCFCompiler'] class NVHPCFCompiler(FCompiler): """ NVIDIA High Performance Computing (HPC) SDK Fortran Compiler https://developer.nvidia.com/hpc-sdk Since august 2020 the NVIDIA HPC SDK includes the compilers formerly known as The Po...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/pg.py
# http://www.pgroup.com import sys from numpy.distutils.fcompiler import FCompiler from sys import platform from os.path import join, dirname, normpath compilers = ['PGroupFCompiler', 'PGroupFlangCompiler'] class PGroupFCompiler(FCompiler): compiler_type = 'pg' description = 'Portland Group Fortran Compile...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/gnu.py
import re import os import sys import warnings import platform import tempfile import hashlib import base64 import subprocess from subprocess import Popen, PIPE, STDOUT from numpy.distutils.exec_command import filepath_from_subprocess_output from numpy.distutils.fcompiler import FCompiler from distutils.version import ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/mips.py
from numpy.distutils.cpuinfo import cpu from numpy.distutils.fcompiler import FCompiler compilers = ['MIPSFCompiler'] class MIPSFCompiler(FCompiler): compiler_type = 'mips' description = 'MIPSpro Fortran Compiler' version_pattern = r'MIPSpro Compilers: Version (?P<version>[^\s*,]*)' executables = {...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/compaq.py
#http://www.compaq.com/fortran/docs/ import os import sys from numpy.distutils.fcompiler import FCompiler from distutils.errors import DistutilsPlatformError compilers = ['CompaqFCompiler'] if os.name != 'posix' or sys.platform[:6] == 'cygwin' : # Otherwise we'd get a false positive on posix systems with # c...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/arm.py
import sys from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file from sys import platform from os.path...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/ibm.py
import os import re import sys import subprocess from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import find_executable from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompiler'] class IBMFCompiler(FCompiler): compiler_type = 'ibm...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/vast.py
import os from numpy.distutils.fcompiler.gnu import GnuFCompiler compilers = ['VastFCompiler'] class VastFCompiler(GnuFCompiler): compiler_type = 'vast' compiler_aliases = () description = 'Pacific-Sierra Research Fortran 90 Compiler' version_pattern = (r'\s*Pacific-Sierra Research vf90 ' ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/pathf95.py
from numpy.distutils.fcompiler import FCompiler compilers = ['PathScaleFCompiler'] class PathScaleFCompiler(FCompiler): compiler_type = 'pathf95' description = 'PathScale Fortran Compiler' version_pattern = r'PathScale\(TM\) Compiler Suite: Version (?P<version>[\d.]+)' executables = { 'vers...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/none.py
from numpy.distutils.fcompiler import FCompiler from numpy.distutils import customized_fcompiler compilers = ['NoneFCompiler'] class NoneFCompiler(FCompiler): compiler_type = 'none' description = 'Fake Fortran compiler' executables = {'compiler_f77': None, 'compiler_f90': None, ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/lahey.py
import os from numpy.distutils.fcompiler import FCompiler compilers = ['LaheyFCompiler'] class LaheyFCompiler(FCompiler): compiler_type = 'lahey' description = 'Lahey/Fujitsu Fortran 95 Compiler' version_pattern = r'Lahey/Fujitsu Fortran 95 Compiler Release (?P<version>[^\s*]*)' executables = { ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/sun.py
from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler compilers = ['SunFCompiler'] class SunFCompiler(FCompiler): compiler_type = 'sun' description = 'Sun or Forte Fortran 95 Compiler' # ex: # f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 11169...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/hpux.py
from numpy.distutils.fcompiler import FCompiler compilers = ['HPUXFCompiler'] class HPUXFCompiler(FCompiler): compiler_type = 'hpux' description = 'HP Fortran 90 Compiler' version_pattern = r'HP F90 (?P<version>[^\s*,]*)' executables = { 'version_cmd' : ["f90", "+version"], 'compil...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/g95.py
# http://g95.sourceforge.net/ from numpy.distutils.fcompiler import FCompiler compilers = ['G95FCompiler'] class G95FCompiler(FCompiler): compiler_type = 'g95' description = 'G95 Fortran Compiler' # version_pattern = r'G95 \((GCC (?P<gccversion>[\d.]+)|.*?) \(g95!\) (?P<version>.*)\).*' # $ g95 --vers...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/nag.py
import sys import re from numpy.distutils.fcompiler import FCompiler compilers = ['NAGFCompiler', 'NAGFORCompiler'] class BaseNAGFCompiler(FCompiler): version_pattern = r'NAG.* Release (?P<version>[^(\s]*)' def version_match(self, version_string): m = re.search(self.version_pattern, version_string) ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/absoft.py
# Absoft Corporation ceased operations on 12/31/2022. # Thus, all links to <http://www.absoft.com> are invalid. # Notes: # - when using -g77 then use -DUNDERSCORE_G77 to compile f2py # generated extension modules (works for f2py v2.45.241_1936 and up) import os from numpy.distutils.cpuinfo import cpu from numpy.di...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/intel.py
# http://developer.intel.com/software/products/compilers/flin/ import sys from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler, dummy_fortran_file compilers = ['IntelFCompiler', 'IntelVisualFCompiler', 'IntelItaniumFCompiler', 'IntelItaniumVisualFComp...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/environment.py
import os from distutils.dist import Distribution __metaclass__ = type class EnvironmentConfig: def __init__(self, distutils_section='ALL', **kw): self._distutils_section = distutils_section self._conf_keys = kw self._conf = None self._hook_handler = None def dump_variable(sel...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/__init__.py
"""numpy.distutils.fcompiler Contains FCompiler, an abstract base class that defines the interface for the numpy.distutils Fortran compiler abstraction model. Terminology: To be consistent, where the term 'executable' is used, it means the single file, like 'gcc', that is executed, and should be a string. In contras...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/fcompiler/fujitsu.py
""" fujitsu Supports Fujitsu compiler function. This compiler is developed by Fujitsu and is used in A64FX on Fugaku. """ from numpy.distutils.fcompiler import FCompiler compilers = ['FujitsuFCompiler'] class FujitsuFCompiler(FCompiler): compiler_type = 'fujitsu' description = 'Fujitsu Fortran Compiler' ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_fcompiler_nagfor.py
from numpy.testing import assert_ import numpy.distutils.fcompiler nag_version_strings = [('nagfor', 'NAG Fortran Compiler Release ' '6.2(Chiyoda) Build 6200', '6.2'), ('nagfor', 'NAG Fortran Compiler Release ' '6.1(Tozai) Build 6136', '6.1'), ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_from_template.py
from numpy.distutils.from_template import process_str from numpy.testing import assert_equal pyf_src = """ python module foo <_rd=real,double precision> interface subroutine <s,d>foosub(tol) <_rd>, intent(in,out) :: tol end subroutine <s,d>foosub end interface end python modul...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_fcompiler_intel.py
import numpy.distutils.fcompiler from numpy.testing import assert_ intel_32bit_version_strings = [ ("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications" "running on Intel(R) 32, Version 11.1", '11.1'), ] intel_64bit_version_strings = [ ("Intel(R) Fortran IA-64 Compiler Professional ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_shell_utils.py
import pytest import subprocess import json import sys from numpy.distutils import _shell_utils from numpy.testing import IS_WASM argv_cases = [ [r'exe'], [r'path/exe'], [r'path\exe'], [r'\\server\path\exe'], [r'path to/exe'], [r'path to\exe'], [r'exe', '--flag'], [r'path/exe', '--fla...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_npy_pkg_config.py
import os from numpy.distutils.npy_pkg_config import read_config, parse_flags from numpy.testing import temppath, assert_ simple = """\ [meta] Name = foo Description = foo lib Version = 0.1 [default] cflags = -I/usr/include libs = -L/usr/lib """ simple_d = {'cflags': '-I/usr/include', 'libflags': '-L/usr/lib', ...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_log.py
import io import re from contextlib import redirect_stdout import pytest from numpy.distutils import log def setup_module(): f = io.StringIO() # changing verbosity also logs here, capture that with redirect_stdout(f): log.set_verbosity(2, force=True) # i.e. DEBUG def teardown_module(): log.s...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_system_info.py
import os import shutil import pytest from tempfile import mkstemp, mkdtemp from subprocess import Popen, PIPE import importlib.metadata from distutils.errors import DistutilsError from numpy.testing import assert_, assert_equal, assert_raises from numpy.distutils import ccompiler, customized_ccompiler from numpy.dist...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_fcompiler.py
from numpy.testing import assert_ import numpy.distutils.fcompiler customizable_flags = [ ('f77', 'F77FLAGS'), ('f90', 'F90FLAGS'), ('free', 'FREEFLAGS'), ('arch', 'FARCH'), ('debug', 'FDEBUG'), ('flags', 'FFLAGS'), ('linker_so', 'LDFLAGS'), ] def test_fcompiler_flags(monkeypatch): mo...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_build_ext.py
'''Tests for numpy.distutils.build_ext.''' import os import subprocess import sys from textwrap import indent, dedent import pytest from numpy.testing import IS_WASM @pytest.mark.skipif(IS_WASM, reason="cannot start subprocess in wasm") @pytest.mark.slow def test_multi_fortran_libs_link(tmp_path): ''' Ensures...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_misc_util.py
from os.path import join, sep, dirname from numpy.distutils.misc_util import ( appendpath, minrelpath, gpaths, get_shared_lib_extension, get_info ) from numpy.testing import ( assert_, assert_equal ) ajoin = lambda *paths: join(*((sep,)+paths)) class TestAppendpath: def test_1(self): ass...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_exec_command.py
import os import pytest import sys from tempfile import TemporaryFile from numpy.distutils import exec_command from numpy.distutils.exec_command import get_pythonexe from numpy.testing import tempdir, assert_, assert_warns, IS_WASM # In python 3 stdout, stderr are text (unicode compliant) devices, so to # emulate th...
0
public_repos/numpy/numpy/distutils
public_repos/numpy/numpy/distutils/tests/test_mingw32ccompiler.py
import shutil import subprocess import sys import pytest from numpy.distutils import mingw32ccompiler @pytest.mark.skipif(sys.platform != 'win32', reason='win32 only test') def test_build_import(): '''Test the mingw32ccompiler.build_import_library, which builds a `python.a` from the MSVC `python.lib` '''...
0