Did I find the right examples for you? yes no

All Samples(42)  |  Call(36)  |  Derive(0)  |  Import(6)

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_uint.py   astropy(Download)
from ....io import fits
from . import FitsTestCase
from .util import ignore_warnings
from ....tests.helper import pytest
 
            hdu.scale('int{0:d}'.format(bits), '', bzero=2 ** (bits-1))
 
            with ignore_warnings():
                hdu.writeto(self.temp('tempfile.fits'), clobber=True)
 
            hdulist = fits.HDUList([hdu0,table])
 
            with ignore_warnings():
                hdulist.writeto(self.temp('tempfile.fits'), clobber=True)
 
            v = u.view(dtype=[(utype, self.utype_map[utype])])
 
            with ignore_warnings():
                fits.writeto(self.temp('tempfile2.fits'), v, clobber=True)
 

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_table.py   astropy(Download)
from ..util import decode_ascii
from . import FitsTestCase
from .util import ignore_warnings
 
 
            pri_hdu = fits.PrimaryHDU()
            hdu_list = fits.HDUList([pri_hdu, tb_hdu])
            with ignore_warnings():
                hdu_list.writeto(self.temp('toto.fits'), clobber=True)
 
        assert hdu.data[1][3] == 'F0Ib'
 
        with ignore_warnings():
            hdu.writeto(self.temp('toto.fits'), clobber=True)
 
                           names='order,name,mag,Sp')
        assert comparerecords(hdu.data, tmp)
        with ignore_warnings():
            hdu.writeto(self.temp('toto.fits'), clobber=True)
        with fits.open(self.temp('toto.fits')) as hdul:
            acol = fits.Column(name='testa', format=format_code, array=a)
            tbhdu = fits.new_table([acol])
            with ignore_warnings():
                tbhdu.writeto(self.temp('newtable.fits'), clobber=True)
            with fits.open(self.temp('newtable.fits')) as tbhdu1:

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_image.py   astropy(Download)
 
from . import FitsTestCase
from .util import ignore_warnings
 
 
        hdul = fits.open(self.data('fixed-1890.fits'))
        orig_data = hdul[0].data
        with ignore_warnings():
            hdul.writeto(self.temp('test_new.fits'), clobber=True)
        hdul.close()
        # https://trac.assembla.com/pyfits/ticket/84
        hdul = fits.open(self.data('fixed-1890.fits'))
        with ignore_warnings():
            hdul.writeto(self.temp('test_new.fits'), clobber=True)
        hdul.close()
        hdul = fits.open(self.temp('fixed-1890-z.fits'))
        orig_data = hdul[1].data
        with ignore_warnings():
            hdul.writeto(self.temp('test_new.fits'), clobber=True)
        hdul.close()
        # https://trac.assembla.com/pyfits/ticket/84
        hdul = fits.open(self.temp('fixed-1890-z.fits'))
        with ignore_warnings():
            hdul.writeto(self.temp('test_new.fits'), clobber=True)
        hdul.close()

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_header.py   astropy(Download)
 
from . import FitsTestCase
from .util import ignore_warnings
from ..card import _pad
from ..header import _pad_length, BLOCK_SIZE
        assert 'SIMPLE' in hdu.header
 
        with ignore_warnings():
            hdu.writeto(self.temp('test.fits'), output_verify='ignore',
                        clobber=True)
        # card image constructed from key/value/comment is too long
        # (non-string value)
        with ignore_warnings():
            c = fits.Card('abc', 9, 'abcde' * 20)
            assert (str(c) ==
        while len(hdu.header) < 36:
            hdu.header.append()
        with ignore_warnings():
            hdu.writeto(self.temp('test.fits'), clobber=True)
 
        assert c.field_specifier == 'NAXIS'
 
        with ignore_warnings():
            c = fits.Card('DP1.NAXIS', 'a')
        assert c.keyword == 'DP1.NAXIS'

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_hdulist.py   astropy(Download)
import numpy as np
 
from .util import ignore_warnings
from ..verify import VerifyError
from ....io import fits
            f.seek(0, os.SEEK_END)
            f.write(b'\0' * 2880)
        with ignore_warnings():
            assert info == fits.info(self.temp('temp.fits'), output=False,
                                     do_not_scale_image_data=True)
        self.copy_file('scale.fits')
 
        with ignore_warnings():
            with fits.open(self.temp('scale.fits'), mode='update',
                           save_backup=True) as hdul:
                assert (hdul1[0].data == hdul2[0].data).all()
 
        with ignore_warnings():
            with fits.open(self.temp('scale.fits'), mode='update',
                           save_backup=True) as hdul:
            assert np.all(hdul_a[0].data == arr_b)
 
        with ignore_warnings():
            test(True, True)
 

src/a/s/astropy-0.3.1/astropy/io/fits/tests/test_core.py   astropy(Download)
from ....tests.helper import pytest, raises, catch_warnings
from . import FitsTestCase
from .util import ignore_warnings
from ..convenience import _getext
from ..file import _File
 
        hdulist.writeto(self.temp('test.fits'), clobber=True)
        with ignore_warnings():
            # TODO: The warning raised by this test is actually indication of a
            # bug and should *not* be ignored. But as it is a known issue we
    def test_open_gzipped(self):
        with ignore_warnings():
            assert len(fits.open(self._make_gzip_file())) == 5
 
    def test_detect_gzipped(self):
        """Test detection of a gzip file when the extension is not .gz."""
 
        with ignore_warnings():
    def test_open_zipped(self):
        zf = self._make_zip_file()
 
        with ignore_warnings():
            assert len(fits.open(self._make_zip_file())) == 5