PageRenderTime 164ms queryTime 43ms sortTime 0ms getByIdsTime 39ms findMatchingLines 43ms

49+ results for 'numpy fromtextfile' (164 ms)

Not the results you expected?
mrecords.py https://github.com/tris-sondon/numpy.git | Python | 720 lines
                    
1""":mod:`numpy.ma..mrecords`
                    
2
                    
2
                    
3Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
                    
4where fields can be accessed as attributes.
                    
4where fields can be accessed as attributes.
                    
5Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
                    
6and the masking of individual fields.
                    
20
                    
21import numpy as np
                    
22from numpy import bool_, dtype, \
                    
23    ndarray, recarray, array as narray
                    
24import numpy.core.numerictypes as ntypes
                    
25from numpy.core.records import fromarrays as recfromarrays, \
                    
30
                    
31import numpy.ma as ma
                    
32from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array, \
                    
                
test_mrecords.py https://github.com/wizzk42/numpy.git | Python | 501 lines
                    
11import sys
                    
12import numpy as np
                    
13from numpy import recarray
                    
13from numpy import recarray
                    
14from numpy.core.records import fromrecords as recfromrecords, \
                    
15                               fromarrays as recfromarrays
                    
16
                    
17from numpy.compat import asbytes, asbytes_nested
                    
18
                    
18
                    
19import numpy.ma.testutils
                    
20from numpy.ma.testutils import *
                    
21
                    
22import numpy.ma as ma
                    
23from numpy.ma import masked, nomask
                    
                
test_mrecords.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 520 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.compat import asbytes, asbytes_nested
                    
16from numpy.compat import asbytes, asbytes_nested
                    
17from numpy.ma import masked, nomask
                    
18from numpy.testing import TestCase, run_module_suite
                    
18from numpy.testing import TestCase, run_module_suite
                    
19from numpy.core.records import (
                    
20    fromrecords as recfromrecords, fromarrays as recfromarrays
                    
21    )
                    
22from numpy.ma.mrecords import (
                    
23    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
                
mrecords.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 796 lines
                    
1""":mod:`numpy.ma..mrecords`
                    
2
                    
2
                    
3Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
                    
4where fields can be accessed as attributes.
                    
4where fields can be accessed as attributes.
                    
5Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
                    
6and the masking of individual fields.
                    
20
                    
21import numpy as np
                    
22import numpy.core.numerictypes as ntypes
                    
22import numpy.core.numerictypes as ntypes
                    
23from numpy.compat import basestring
                    
24from numpy import (
                    
26        )
                    
27from numpy.core.records import (
                    
28        fromarrays as recfromarrays, fromrecords as recfromrecords
                    
                
test_mrecords.py https://gitlab.com/pierreEffiScience/ImageLabeling | Python | 516 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.compat import asbytes, asbytes_nested
                    
16from numpy.compat import asbytes, asbytes_nested
                    
17from numpy.ma import masked, nomask
                    
18from numpy.testing import TestCase, run_module_suite, temppath
                    
18from numpy.testing import TestCase, run_module_suite, temppath
                    
19from numpy.core.records import (
                    
20    fromrecords as recfromrecords, fromarrays as recfromarrays
                    
21    )
                    
22from numpy.ma.mrecords import (
                    
23    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
                
test_mrecords.py https://github.com/dpritsos/WEGA.git | Python | 496 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.ma import masked, nomask
                    
16from numpy.ma import masked, nomask
                    
17from numpy.testing import temppath
                    
18from numpy.core.records import (
                    
20    )
                    
21from numpy.ma.mrecords import (
                    
22    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
24    )
                    
25from numpy.ma.testutils import (
                    
26    assert_, assert_equal,
                    
                
test_mrecords.py https://github.com/plaes/numpy.git | Python | 491 lines
                    
10
                    
11import numpy as np
                    
12from numpy import recarray
                    
12from numpy import recarray
                    
13from numpy.core.records import fromrecords as recfromrecords, \
                    
14                               fromarrays as recfromarrays
                    
15
                    
16import numpy.ma.testutils
                    
17from numpy.ma.testutils import *
                    
18
                    
19import numpy.ma as ma
                    
20from numpy.ma import masked, nomask
                    
21
                    
22from numpy.ma.mrecords import MaskedRecords, mrecarray, fromarrays, \
                    
23                              fromtextfile, fromrecords, addfield
                    
                
mrecords.py https://github.com/plaes/numpy.git | Python | 719 lines
                    
19
                    
20import numpy as np
                    
21from numpy import bool_, dtype, \
                    
22    ndarray, recarray, array as narray
                    
23import numpy.core.numerictypes as ntypes
                    
24from numpy.core.records import fromarrays as recfromarrays, \
                    
29
                    
30import numpy.ma as ma
                    
31from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array,\
                    
38__all__ = ['MaskedRecords','mrecarray',
                    
39           'fromarrays','fromrecords','fromtextfile','addfield',
                    
40           ]
                    
                
test_mrecords.py https://github.com/WeatherGod/numpy.git | Python | 522 lines
                    
13
                    
14import numpy as np
                    
15import numpy.ma.testutils
                    
15import numpy.ma.testutils
                    
16import numpy.ma as ma
                    
17from numpy import recarray
                    
17from numpy import recarray
                    
18from numpy.core.records import fromrecords as recfromrecords, \
                    
19                               fromarrays as recfromarrays
                    
20
                    
21from numpy.compat import asbytes, asbytes_nested
                    
22from numpy.ma.testutils import *
                    
22from numpy.ma.testutils import *
                    
23from numpy.ma import masked, nomask
                    
24from numpy.testing.utils import WarningManager
                    
                
test_wcsapi.py https://gitlab.com/MatiasRepetto/astropy | Python | 473 lines
                    
7import pytest
                    
8import numpy as np
                    
9
                    
81    cube_header = get_pkg_data_filename('data/cube_header')
                    
82    header = fits.Header.fromtextfile(cube_header)
                    
83    return WCS(header=header)
                    
                
test_misc.py https://gitlab.com/MatiasRepetto/astropy | Python | 541 lines
                    
4import pytest
                    
5import numpy as np
                    
6import matplotlib
                    
9from matplotlib.contour import QuadContourSet
                    
10import numpy as np
                    
11
                    
78@pytest.mark.parametrize('grid_type', ['lines', 'contours'])
                    
79def test_no_numpy_warnings(ignore_matplotlibrc, tmpdir, grid_type):
                    
80    fig = plt.figure()
                    
97                'No contour levels were found within the data range' in w_msg or
                    
98                'np.asscalar(a) is deprecated since NumPy v1.16' in w_msg or
                    
99                'PY_SSIZE_T_CLEAN will be required' in w_msg)
                    
117    twoMASS_k_header = get_pkg_data_filename('data/2MASS_k_header')
                    
118    twoMASS_k_header = fits.Header.fromtextfile(twoMASS_k_header)
                    
119    fig = plt.figure(figsize=(6, 6))
                    
                
test_images.py https://gitlab.com/MatiasRepetto/astropy | Python | 1009 lines
                    
7
                    
8import numpy as np
                    
9
                    
27        msx_header = get_pkg_data_filename('data/msx_header')
                    
28        cls.msx_header = fits.Header.fromtextfile(msx_header)
                    
29
                    
30        rosat_header = get_pkg_data_filename('data/rosat_header')
                    
31        cls.rosat_header = fits.Header.fromtextfile(rosat_header)
                    
32
                    
33        twoMASS_k_header = get_pkg_data_filename('data/2MASS_k_header')
                    
34        cls.twoMASS_k_header = fits.Header.fromtextfile(twoMASS_k_header)
                    
35
                    
36        cube_header = get_pkg_data_filename('data/cube_header')
                    
37        cls.cube_header = fits.Header.fromtextfile(cube_header)
                    
38
                    
                
mrecords.py https://github.com/mbentz80/jzigbeercp.git | Python | 807 lines
                    
20
                    
21import numpy as np
                    
22from numpy import bool_, complex_, float_, int_, str_, object_, dtype, \
                    
23    chararray, ndarray, recarray, record, array as narray
                    
24import numpy.core.numerictypes as ntypes
                    
25from numpy.core.records import find_duplicate, format_parser
                    
25from numpy.core.records import find_duplicate, format_parser
                    
26from numpy.core.records import fromarrays as recfromarrays, \
                    
27    fromrecords as recfromrecords
                    
31
                    
32import numpy.ma as ma
                    
33from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array,\
                    
40__all__ = ['MaskedRecords','mrecarray',
                    
41           'fromarrays','fromrecords','fromtextfile','addfield',
                    
42           ]
                    
                
trecords.py https://github.com/pierregm/scikits.timeseries.git | Python | 501 lines
                    
17
                    
18import numpy as np
                    
19from numpy import bool_, complex_, float_, int_, str_, object_, \
                    
20    ndarray, chararray, recarray
                    
21import numpy.core.numerictypes as ntypes
                    
22import numpy.core.umath as umath
                    
22import numpy.core.umath as umath
                    
23from numpy.core.records import find_duplicate, format_parser, record, \
                    
24    fromarrays as recfromarrays
                    
25
                    
26import numpy.ma as ma
                    
27from numpy.ma import MaskedArray, MAError, \
                    
30
                    
31import numpy.ma.mrecords
                    
32from numpy.ma.mrecords import _checknames, \
                    
                
test_misc.py https://github.com/eteq/astropy.git | Python | 280 lines
                    
6import pytest
                    
7import numpy as np
                    
8import matplotlib.pyplot as plt
                    
67@ignore_matplotlibrc
                    
68def test_no_numpy_warnings(tmpdir):
                    
69
                    
104    twoMASS_k_header = os.path.join(DATA, '2MASS_k_header')
                    
105    twoMASS_k_header = fits.Header.fromtextfile(twoMASS_k_header)
                    
106    fig = plt.figure(figsize=(6, 6))
                    
                
__init__.py https://github.com/ayshih/sunpy.git | Python | 151 lines
                    
9
                    
10import numpy as np
                    
11
                    
93    """
                    
94    header = astropy.io.fits.Header.fromtextfile(header_file)
                    
95    shape = [header[f'naxis{i+1}'] for i in range(header['naxis'])]
                    
112    filepath = get_test_filepath(filename)
                    
113    header = astropy.io.fits.Header.fromtextfile(filepath)
                    
114    data = np.random.rand(header['naxis2'], header['naxis1'])
                    
                
test_mrecords.py https://bitbucket.org/alevector/instastuff.git | Python | 500 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.ma import masked, nomask
                    
16from numpy.ma import masked, nomask
                    
17from numpy.testing import run_module_suite, temppath
                    
18from numpy.core.records import (
                    
20    )
                    
21from numpy.ma.mrecords import (
                    
22    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
24    )
                    
25from numpy.ma.testutils import (
                    
26    assert_, assert_equal,
                    
                
test_mrecords.py https://github.com/mbentz80/jzigbeercp.git | Python | 178 lines
                    
14
                    
15import numpy as N
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
17from numpy.testing import NumpyTest, NumpyTestCase
                    
18from numpy.testing.utils import build_err_msg
                    
24#import maskedarray.mrecords
                    
25#from maskedarray.mrecords import mrecarray, fromarrays, fromtextfile, fromrecords
                    
26import maskedarray.mrecords
                    
27from maskedarray.mrecords import MaskedRecords, \
                    
28    fromarrays, fromtextfile, fromrecords, addfield
                    
29
                    
30#..............................................................................
                    
31class test_mrecords(NumpyTestCase):
                    
32    "Base test class for MaskedArrays."
                    
                
test_mrecords.py https://github.com/Pymol-Scripts/Pymol-script-repo.git | Python | 386 lines
                    
12
                    
13import numpy as np
                    
14from numpy import recarray
                    
14from numpy import recarray
                    
15from numpy.core.records import fromrecords as recfromrecords, \
                    
16    fromarrays as recfromarrays
                    
17
                    
18import numpy.ma.testutils
                    
19from numpy.ma.testutils import *
                    
20
                    
21import numpy.ma as ma
                    
22from numpy.ma import masked, nomask, getdata, getmaskarray
                    
23
                    
24import numpy.ma.mrecords
                    
25reload(numpy.ma.mrecords)
                    
                
test_deprecations.py https://github.com/rgommers/numpy.git | Python | 89 lines
                    
4import pytest
                    
5import numpy as np
                    
6from numpy.testing import assert_warns
                    
6from numpy.testing import assert_warns
                    
7from numpy.ma.testutils import assert_equal
                    
8from numpy.ma.core import MaskedArrayFutureWarning
                    
48    def test_axis_default(self):
                    
49        # NumPy 1.13, 2017-05-06
                    
50
                    
73
                    
74class TestFromtextfile:
                    
75    def test_fromtextfile_delimitor(self):
                    
75    def test_fromtextfile_delimitor(self):
                    
76        # NumPy 1.22.0, 2021-09-23
                    
77
                    
                
test_mrecords.py git://github.com/numpy/numpy.git | Python | 493 lines
                    
7"""
                    
8import numpy as np
                    
9import numpy.ma as ma
                    
9import numpy.ma as ma
                    
10from numpy import recarray
                    
11from numpy.ma import masked, nomask
                    
11from numpy.ma import masked, nomask
                    
12from numpy.testing import temppath
                    
13from numpy.core.records import (
                    
15    )
                    
16from numpy.ma.mrecords import (
                    
17    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
19    )
                    
20from numpy.ma.testutils import (
                    
21    assert_, assert_equal,
                    
                
mrecords.py git://github.com/numpy/numpy.git | Python | 770 lines
                    
1""":mod:`numpy.ma..mrecords`
                    
2
                    
2
                    
3Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
                    
4where fields can be accessed as attributes.
                    
4where fields can be accessed as attributes.
                    
5Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
                    
6and the masking of individual fields.
                    
17
                    
18import numpy as np
                    
19from numpy import (
                    
21        )
                    
22from numpy.core.records import (
                    
23        fromarrays as recfromarrays, fromrecords as recfromrecords
                    
27
                    
28import numpy.ma as ma
                    
29from numpy.ma import (
                    
                
test_beam.py git://github.com/aplpy/aplpy.git | Python | 214 lines
                    
3import pytest
                    
4import numpy as np
                    
5from astropy import units as u
                    
13
                    
14HEADER = fits.Header.fromtextfile(os.path.join(header_dir, '1904-66_TAN.hdr'))
                    
15HDU = fits.PrimaryHDU(np.zeros((16, 16)), HEADER)
                    
                
helpers.py git://github.com/aplpy/aplpy.git | Python | 72 lines
                    
4
                    
5import numpy as np
                    
6from astropy.io import fits
                    
16    # Read in header
                    
17    header = fits.Header.fromtextfile(header_file)
                    
18
                    
                
test_mrecords.py https://github.com/numpy/numpy-refactor.git | Python | 504 lines
                    
13
                    
14import numpy as np
                    
15from numpy import recarray
                    
15from numpy import recarray
                    
16from numpy.core.records import fromrecords as recfromrecords, \
                    
17                               fromarrays as recfromarrays
                    
18
                    
19from numpy.compat import asbytes, asbytes_nested
                    
20
                    
20
                    
21import numpy.ma.testutils
                    
22from numpy.ma.testutils import *
                    
23
                    
24import numpy.ma as ma
                    
25from numpy.ma import masked, nomask
                    
                
test_pixworldmarkers.py git://github.com/aplpy/aplpy.git | Python | 66 lines
                    
3import pytest
                    
4import numpy as np
                    
5
                    
37    wcs = generate_wcs(HEADER)
                    
38    header = fits.Header.fromtextfile(HEADER)
                    
39    wcs.naxis1 = header['NAXIS1']
                    
58    wcs = generate_wcs(HEADER)
                    
59    header = fits.Header.fromtextfile(HEADER)
                    
60    wcs.naxis1 = header['NAXIS1']
                    
                
tmulti.py https://github.com/mbentz80/jzigbeercp.git | Python | 531 lines
                    
16
                    
17import numpy
                    
18from numpy import bool_, complex_, float_, int_, str_, object_
                    
18from numpy import bool_, complex_, float_, int_, str_, object_
                    
19import numpy.core.fromnumeric as fromnumeric
                    
20import numpy.core.numeric as numeric
                    
20import numpy.core.numeric as numeric
                    
21from numpy.core.numeric import ndarray
                    
22import numpy.core.numerictypes as ntypes
                    
22import numpy.core.numerictypes as ntypes
                    
23import numpy.core.umath as umath
                    
24from numpy.core.defchararray import chararray
                    
24from numpy.core.defchararray import chararray
                    
25from numpy.core.records import find_duplicate
                    
26from numpy.core.records import format_parser, recarray, record 
                    
                
test_mrecords.py https://github.com/mbentz80/jzigbeercp.git | Python | 411 lines
                    
12
                    
13import numpy as np
                    
14from numpy import recarray
                    
14from numpy import recarray
                    
15from numpy.core.records import fromrecords as recfromrecords, \
                    
16    fromarrays as recfromarrays
                    
17
                    
18import numpy.ma.testutils
                    
19from numpy.ma.testutils import *
                    
20
                    
21import numpy.ma as ma
                    
22from numpy.ma import masked, nomask, getdata, getmaskarray
                    
23
                    
24import numpy.ma.mrecords
                    
25
                    
                
test_mrecords.py https://github.com/pv/numpy.git | Python | 521 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.core.records import (fromrecords as recfromrecords,
                    
18
                    
19from numpy.compat import asbytes, asbytes_nested
                    
20from numpy.ma.testutils import *
                    
20from numpy.ma.testutils import *
                    
21from numpy.ma import masked, nomask
                    
22from numpy.ma.mrecords import (MaskedRecords, mrecarray, fromarrays,
                    
22from numpy.ma.mrecords import (MaskedRecords, mrecarray, fromarrays,
                    
23                               fromtextfile, fromrecords, addfield)
                    
24
                    
                
mrecords.py https://github.com/numpy/numpy.git | Python | 783 lines
                    
1""":mod:`numpy.ma..mrecords`
                    
2
                    
2
                    
3Defines the equivalent of :class:`numpy.recarrays` for masked arrays,
                    
4where fields can be accessed as attributes.
                    
4where fields can be accessed as attributes.
                    
5Note that :class:`numpy.ma.MaskedArray` already supports structured datatypes
                    
6and the masking of individual fields.
                    
15
                    
16from numpy.ma import (
                    
17    MAError, MaskedArray, masked, nomask, masked_array, getdata,
                    
19)
                    
20import numpy.ma as ma
                    
21import warnings
                    
22
                    
23import numpy as np
                    
24from numpy import (
                    
                
test_wcs_util.py git://github.com/aplpy/aplpy.git | Python | 50 lines
                    
2
                    
3import numpy as np
                    
4from astropy.io import fits
                    
11HEADER_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
                    
12HEADER_2D = fits.Header.fromtextfile(os.path.join(HEADER_DIR, '2d_fits', '1904-66_TAN.hdr'))
                    
13HEADER_3D = fits.Header.fromtextfile(os.path.join(HEADER_DIR, '3d_fits', 'cube.hdr'))
                    
                
test_scalebar.py git://github.com/aplpy/aplpy.git | Python | 113 lines
                    
3import pytest
                    
4import numpy as np
                    
5from astropy import units as u
                    
12HEADER_DIR = os.path.join(ROOT, 'data/2d_fits')
                    
13HEADER = fits.Header.fromtextfile(os.path.join(HEADER_DIR, '1904-66_TAN.hdr'))
                    
14HDU = fits.PrimaryHDU(np.zeros((16, 16)), HEADER)
                    
                
test_init_image.py git://github.com/aplpy/aplpy.git | Python | 194 lines
                    
3import pytest
                    
4import numpy as np
                    
5from astropy.io import fits
                    
82    wcs = generate_wcs(REFERENCE)
                    
83    header_ = fits.Header.fromtextfile(REFERENCE)
                    
84    header = wcs.to_header()
                    
101
                    
102# Test initalization through a Numpy array (no WCS)
                    
103def test_numpy_nowcs_init():
                    
                
test_rgb.py git://github.com/aplpy/aplpy.git | Python | 126 lines
                    
4import pytest
                    
5import numpy as np
                    
6from astropy.io import fits
                    
37
                    
38        header = fits.Header.fromtextfile(HEADER)
                    
39
                    
92
                    
93        header = fits.Header.fromtextfile(HEADER)
                    
94
                    
                
test_mrecords.py https://github.com/joferkington/numpy.git | Python | 518 lines
                    
13
                    
14import numpy as np
                    
15import numpy.ma.testutils
                    
15import numpy.ma.testutils
                    
16import numpy.ma as ma
                    
17from numpy import recarray
                    
17from numpy import recarray
                    
18from numpy.core.records import fromrecords as recfromrecords, \
                    
19                               fromarrays as recfromarrays
                    
20
                    
21from numpy.compat import asbytes, asbytes_nested
                    
22from numpy.ma.testutils import *
                    
22from numpy.ma.testutils import *
                    
23from numpy.ma import masked, nomask
                    
24from numpy.ma.mrecords import MaskedRecords, mrecarray, fromarrays, \
                    
                
test_pickle.py https://github.com/astropy/astropy.git | Python | 160 lines
                    
5
                    
6import numpy as np
                    
7import pytest
                    
7import pytest
                    
8from numpy.testing import assert_array_almost_equal
                    
9
                    
12from astropy.utils.exceptions import AstropyDeprecationWarning
                    
13from astropy.utils.misc import NumpyRNGContext
                    
14from astropy.io import fits
                    
37
                    
38        with NumpyRNGContext(123456789):
                    
39            x = np.random.rand(2 ** 16, wcs1.wcs.naxis)
                    
55
                    
56        with NumpyRNGContext(123456789):
                    
57            x = np.random.rand(2 ** 16, wcs1.wcs.naxis)
                    
                
test_mrecords.py https://github.com/jonovik/numpy.git | Python | 513 lines
                    
12
                    
13import numpy as np
                    
14import numpy.ma as ma
                    
14import numpy.ma as ma
                    
15from numpy import recarray
                    
16from numpy.ma import masked, nomask
                    
16from numpy.ma import masked, nomask
                    
17from numpy.testing import TestCase, run_module_suite, temppath
                    
18from numpy.core.records import (
                    
20    )
                    
21from numpy.ma.mrecords import (
                    
22    MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords,
                    
24    )
                    
25from numpy.ma.testutils import (
                    
26    assert_, assert_equal,
                    
                
test_multitimeseries.py https://github.com/mbentz80/jzigbeercp.git | Python | 188 lines
                    
14
                    
15import numpy as N
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
17from numpy.testing import NumpyTest, NumpyTestCase
                    
18from numpy.testing.utils import build_err_msg
                    
30from timeseries.tmulti import MultiTimeSeries, TimeSeries,\
                    
31    fromarrays, fromtextfile, fromrecords, \
                    
32    date_array, time_series
                    
35#..............................................................................
                    
36class test_mrecords(NumpyTestCase):
                    
37    "Base test class for MaskedArrays."
                    
38    def __init__(self, *args, **kwds):
                    
39        NumpyTestCase.__init__(self, *args, **kwds)
                    
40        self.setup()
                    
                
test_polynomial.py https://gitlab.com/JakenHerman/astropy.git | Python | 161 lines
                    
9import os
                    
10import numpy as np
                    
11
                    
11
                    
12from numpy.testing import utils
                    
13from .. import fitting
                    
116    test_file = get_pkg_data_filename(os.path.join('data', 'hst_sip.hdr'))
                    
117    hdr = fits.Header.fromtextfile(test_file)
                    
118    crpix1 = hdr['CRPIX1']
                    
137    test_file = get_pkg_data_filename(os.path.join('data', 'irac_sip.hdr'))
                    
138    hdr = fits.Header.fromtextfile(test_file)
                    
139    crpix1 = hdr['CRPIX1']
                    
                
test_init_image.py https://github.com/keflavich/aplpy.git | Python | 182 lines
                    
5
                    
6import numpy as np
                    
7from astropy.tests.helper import pytest
                    
90    wcs = generate_wcs(REFERENCE)
                    
91    header_ = fits.Header.fromtextfile(REFERENCE)
                    
92    header = wcs.to_header()
                    
110
                    
111# Test initalization through a Numpy array (no WCS)
                    
112def test_numpy_nowcs_init():
                    
                
test_pixworldmarkers.py https://github.com/keflavich/aplpy.git | Python | 67 lines
                    
5
                    
6import numpy as np
                    
7
                    
38    wcs = generate_wcs(HEADER)
                    
39    header = fits.Header.fromtextfile(HEADER)
                    
40    wcs.naxis1 = header['NAXIS1']
                    
51        f.show_markers(inputval[0], inputval[1])
                    
52    assert exc.value.args[0] == "world2pix should be provided either with two scalars, two lists, or two numpy arrays"
                    
53    f.close()
                    
57    wcs = generate_wcs(HEADER)
                    
58    header = fits.Header.fromtextfile(HEADER)
                    
59    wcs.naxis1 = header['NAXIS1']
                    
64    f.close()
                    
65    assert exc.value.args[0] == "world2pix should be provided either with two scalars, two lists, or two numpy arrays"
                    
66
                    
                
test_scalebar.py https://github.com/keflavich/aplpy.git | Python | 115 lines
                    
5
                    
6import numpy as np
                    
7from astropy.tests.helper import pytest
                    
15
                    
16HEADER = fits.Header.fromtextfile(os.path.join(header_dir, '1904-66_TAN.hdr'))
                    
17HDU = fits.PrimaryHDU(np.zeros((16, 16)), HEADER)
                    
                
test_mrecarray.py https://github.com/mbentz80/jzigbeercp.git | Python | 128 lines
                    
14
                    
15import numpy as N
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
16import numpy.core.fromnumeric  as fromnumeric
                    
17from numpy.testing import NumpyTest, NumpyTestCase
                    
18from numpy.testing.utils import build_err_msg
                    
24import maskedarray.mrecords
                    
25from maskedarray.mrecords import mrecarray, fromarrays, fromtextfile, fromrecords
                    
26
                    
28#..............................................................................
                    
29class test_mrecarray(NumpyTestCase):
                    
30    "Base test class for MaskedArrays."
                    
31    def __init__(self, *args, **kwds):
                    
32        NumpyTestCase.__init__(self, *args, **kwds)
                    
33        self.setup()
                    
                
test_images.py https://github.com/eteq/astropy.git | Python | 732 lines
                    
4import pytest
                    
5import numpy as np
                    
6
                    
30        msx_header = os.path.join(cls._data_dir, 'msx_header')
                    
31        cls.msx_header = fits.Header.fromtextfile(msx_header)
                    
32
                    
33        rosat_header = os.path.join(cls._data_dir, 'rosat_header')
                    
34        cls.rosat_header = fits.Header.fromtextfile(rosat_header)
                    
35
                    
36        twoMASS_k_header = os.path.join(cls._data_dir, '2MASS_k_header')
                    
37        cls.twoMASS_k_header = fits.Header.fromtextfile(twoMASS_k_header)
                    
38
                    
39        cube_header = os.path.join(cls._data_dir, 'cube_header')
                    
40        cls.cube_header = fits.Header.fromtextfile(cube_header)
                    
41
                    
                
test_wcs.py https://github.com/keflavich/pyregion.git | Python | 43 lines
                    
8import os.path
                    
9from numpy.testing import assert_allclose
                    
10
                    
38def test_calculate_rotation_angle(region_frame, header_name, rot_angle):
                    
39    header = Header.fromtextfile(os.path.join(rootdir, header_name))
                    
40    assert_allclose(
                    
                
test_region.py https://github.com/keflavich/pyregion.git | Python | 69 lines
                    
1import os
                    
2import numpy as np
                    
3from os.path import join
                    
6from astropy.tests.helper import pytest
                    
7from numpy.testing import assert_allclose
                    
8
                    
13def header():
                    
14    return Header.fromtextfile(join(rootdir, "sample_fits01.header"))
                    
15
                    
35def test_region(ref_name, reg_name, header_name):
                    
36    header = Header.fromtextfile(join(rootdir, header_name))
                    
37    ref_region = pyregion_open(join(rootdir, ref_name)).as_imagecoord(header)
                    
                
test_rgb.py https://github.com/keflavich/aplpy.git | Python | 56 lines
                    
3
                    
4import numpy as np
                    
5from astropy.io import fits
                    
31
                    
32        header = fits.Header.fromtextfile(HEADER)
                    
33
                    
                
load_header.py https://github.com/keflavich/image_registration.git | Python | 57 lines
                    
1from astropy.io import fits
                    
2import numpy as np
                    
3import warnings
                    
21        try:
                    
22            return fits.Header().fromtextfile(header)
                    
23        except IOError:
                    
                
test_get_mask.py https://github.com/keflavich/pyregion.git | Python | 23 lines
                    
1import os
                    
2import numpy as np
                    
3from os.path import join
                    
10def demo_header():
                    
11    return Header.fromtextfile(join(rootdir, "sample_fits01.header"))
                    
12
                    
                
 

Source

Language