hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
aa28e92427a78a8fa1f58d06acb11c98fc240945fc38109725779598dd306155 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" An extensible ASCII table reader and writer.
core.py:
Core base classes and functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import copy
i... |
284f710688431b7e71a31cb3d33f3fd36259c8be05040e2173e4088303d38883 | # Licensed under a 3-clause BSD style license
"""
:Author: Simon Gibbons (simongibbons@gmail.com)
"""
from .core import DefaultSplitter
from .fixedwidth import (FixedWidth,
FixedWidthData,
FixedWidthHeader,
FixedWidthTwoLineDataSplitter)
cla... |
0c8681466463eee4a5c7ae92bd04f53619852bf5302fa439d85db387e14457e6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
fixedwidth.py:
Read or write a table with fixed width columns.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
from . import core
from... |
826b3cccfad277fdcddcd5dfa10064d25b617cdb8e363345075f6141da6dcea5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
latex.py:
Classes to read and write LaTeX tables
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from . import core
latexdi... |
e78c710827ac36d0f2059452ae690444a5275a04c55af9137fd8a16fb1225998 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ipac.py:
Classes to read IPAC table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from collections import defaultdic... |
8a61fb70c947fe9100e3fded7e748b3a5d78b66c0ff3326287b9f488a2a04dee | # Licensed under a 3-clause BSD style license
import os
from distutils.extension import Extension
ROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = [os.path.join(ROOT, 'cparser.pyx'),
os.path.join(ROOT, 'src', 'tokenizer.c')]
ascii_ext = Extension(
name... |
42906c13c69b46287899496cea6f2e87163dcf6ec4cd9d7712b40aec75dd5883 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible HTML table reader and writer.
html.py:
Classes to read and write HTML tables
`BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
must be installed to read HTML tables.
"""
import warnings
import numpy
from . import cor... |
cc3e7270f73865eb8d3cb03b2965853731aa712bca66c0952c331bb315aa0a03 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" sextractor.py:
Classes to read SExtractor table format
Built on daophot.py:
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from . import core
class SExtractorHeader(c... |
b13004418303c1fe3c633448dfc3c2c0b5bd208776c065cf9ab6eed94f7ee2fe | READ_DOCSTRING = """
Read the input ``table`` and return the table. Most of
the default behavior for various parameters is determined by the Reader
class.
See also:
- http://docs.astropy.org/en/stable/io/ascii/
- http://docs.astropy.org/en/stable/io/ascii/read.html
Parameters
-------... |
2477597fdfe2c3f89435a62cb1ab24c719ddfb0b9ec57f62c2330b7a61368506 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ui.py:
Provides the main user functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
impor... |
668fe54339c16a07b7c17c391b7ba3b754954182449ddfc9f9287010bc362f5b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import copy
from collections import OrderedDict
from . import core
from astropy.table import Table
from . import cparser
from astropy.utils import set_locale
class FastBasic(metaclass=core.MetaBaseReader):
"""
This class is intended t... |
790ffda5a08f2fd8568573522ca88cf0e0f807bdecabe7cfb7165a3e5606e762 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
An extensible ASCII table reader and writer.
Classes to read DAOphot table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
import numpy as np
import itertools as it... |
d3f91115eb98fc9b257f9a74aefda7b720d3c501daa09648d9ea6d36d063ae45 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define the Enhanced Character-Separated-Values (ECSV) which allows for reading and
writing all the meta data associated with an astropy Table object.
"""
import re
from collections import OrderedDict
import contextlib
import warnings
from . import co... |
89b11ff1464eaef2227d255ab6e83c8c54ade56ce09d6d7d53a43fd54df1c3e9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing HDF5 tables that are
not meant to be used directly, but instead are available as readers/writers in
`astropy.table`. See :ref:`table_io` for more details.
"""
import os
import warnings
import nu... |
7f83dc4466af074a941a4537dda09b38517f4462775f69d0e4002af3f4681d2f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for serializing core astropy objects via the
YAML protocol.
It provides functions `~astropy.io.misc.yaml.dump`,
`~astropy.io.misc.yaml.load`, and `~astropy.io.misc.yaml.load_all` which
call the corresponding functions in... |
62ca4f5bfa60bdf5369d99a65c4f2c5ad890006c0c68a414f1694f5cfe41129f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple input/output related functionality that is not
part of a larger framework or standard.
"""
import warnings
from astropy.utils.exceptions import AstropyDeprecationWarning, NoValue
__all__ = ['fnpickle', 'fnunpickle']
def... |
78da690951edf169cad40120038cbd68019ec0604d58fded16e0a0f9ac80f104 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
from astropy.table import Table
from astropy.nddata import CCDData
def test_table_read_help_fits():
"""
Test dynamically created documentation help via the I/O registry for 'fits'.
"""
out = StringIO()
Table.... |
d8949cb9221e5dc2c10ef57bae5e9d9422d337d87f349c49760de127ce8cc458 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from copy import copy
from io import StringIO
import pytest
import numpy as np
from astropy.io.registry import _readers, _writers, _identifiers
from astropy.io import registry as io_registry
from astropy.table import Table
from astropy import ... |
5b433bef1467c15257608345ee6618846c386f553dc61d95450dffaa3e128d27 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module handles the conversion of various VOTABLE datatypes
to/from TABLEDATA_ and BINARY_ formats.
"""
# STDLIB
import re
import sys
from struct import unpack as _struct_unpack
from struct import pack as _struct_pack
# THIRD-PARTY
import numpy ... |
9a7842ccd46edca222167c8f7068436ebf68f6b4ee83d6a93e55b43858d31e95 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from . import parse, from_table
from .tree import VOTableFile, Table as VOTable
from astropy.io import registry as io_registry
from astropy.table import Table
from astropy.table.column import BaseColumn
from astropy.units import Quantity
de... |
7da819ed01beaeee2aca37957a98c82013b8dd2dcaee631afdf9cbbb81e9dd9c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import io
import re
import sys
import gzip
import base64
import codecs
import urllib.request
import warnings
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy.io import fits
from astropy import... |
f035cfae2d9814a18cfffee98806550b45b2b91ab5ea59d8d27819e2d88d3d3a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains a contains the high-level functions to read a
VOTable file.
"""
# STDLIB
import io
import os
import sys
import textwrap
import warnings
# LOCAL
from . import exceptions
from . import tree
from astropy.utils.xml import iterparser
f... |
13df27d9c1f2694755c1f2ec1b7f5fef980c11d936559ba64a3f7d4f021c53a9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package reads and writes data formats used by the Virtual
Observatory (VO) initiative, particularly the VOTable XML format.
"""
from .table import (
parse, parse_single_table, validate, from_table, is_votable, writeto)
from .exceptions impor... |
4f652e3c96a6e8461d3e6a1f8c2c6f80846d8701d60fc37e73bafd6b86233a76 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
.. _warnings:
Warnings
--------
.. note::
Most of the following warnings indicate violations of the VOTable
specification. They should be reported to the authors of the
tools that produced the VOTable file.
T... |
7c4eae58a3cd932247985388313fd939bc983fb8751ff9a2cfda175e0f58d861 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains routines to verify the correctness of UCD strings.
"""
# STDLIB
import re
# LOCAL
from astropy.utils import data
__all__ = ['parse_ucd', 'check_ucd']
class UCDWords:
"""
Manages a list of acceptable UCD words.
Work... |
c831d1db472b06b4675d613c035902c4ac573f3776b8e313cb592038dd90dfcf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from distutils.core import Extension
from os.path import join
def get_extensions(build_type='release'):
VO_DIR = 'astropy/io/votable/src'
return [Extension(
"astropy.io.votable.tablewriter",
[join(VO_DIR, "tablewriter.c")],
... |
d5284e22a5044ff8c7844539ccef14a50405a9d353231cfd0a9cf4d891a74e92 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Various XML-related utilities
"""
# ASTROPY
from astropy.logger import log
from astropy.utils import data
from astropy.utils.xml import check as xml_check
from astropy.utils.xml import validate
# LOCAL
from .exceptions import (warn_or_raise, vo_warn... |
cbaf71413a1e0f792dbc2074c32a1bd9804c0131338d3c2218b5ce565c269045 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsheader`` is a command line script based on astropy.io.fits for printing
the header(s) of one or more FITS file(s) to the standard output in a human-
readable format.
Example uses of fitsheader:
1. Print the header of all the HDUs of a .fits fil... |
3ef1bfea493d7aa63e20be701f99bac67ed95bd789da3feb14df24d8bdc1eb82 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitscheck`` is a command line script based on astropy.io.fits for verifying
and updating the CHECKSUM and DATASUM keywords of .fits files. ``fitscheck``
can also detect and often fix other FITS standards violations. ``fitscheck``
facilitates re-wri... |
67a5e14a16a1dd164fb6675453dfcc286bc0d2157b436aa1edd847ee18b6d9cc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import logging
import optparse
import os
import sys
import textwrap
import warnings
from astropy.io import fits
from astropy.io.fits.util import fill
from astropy.utils.exceptions import AstropyDeprecationWarning
log = logging.getLogger('fit... |
fac0d995a6f440d31a0d97713b87166283c86aa4366e9ce10e229b9a7137d85c | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from .base import DTYPE2BITPIX
from .image import PrimaryHDU
from .table import _TableLikeHDU
from astropy.io.fits.column import Column, ColDefs, FITS2NUMPY
from astropy.io.fits.fitsrec import FITS_rec, FITS_record
from astro... |
76d1b0211cacd216cb3b174b8784e29b2b160c7d7fb3aea30559e60c5be0ea62 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import csv
import operator
import os
import re
import sys
import textwrap
import warnings
from contextlib import suppress
import numpy as np
from numpy import char as chararray
from .base import DELAYED, _ValidHDU, ExtensionHDU
# This ... |
c5a86b1da8fb4ada031889d418a919a27452621225144ca647b3d36431e18b84 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
from astropy.io.fits.file import _File
from .base import NonstandardExtHDU
from .hdulist import HDUList
from astropy.io.fits.header import Header, _pad_length
from astropy.io.fits.util import fileobj_name
from astropy.utils import l... |
0a81ba3d22e8197da196f6d979897df42cfa682f5f6f972dd2abf3e879cbb192 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import warnings
import numpy as np
from .base import DELAYED, _ValidHDU, ExtensionHDU, BITPIX2DTYPE, DTYPE2BITPIX
from astropy.io.fits.header import Header
from astropy.io.fits.util import _is_pseudo_unsigned, _unsigned_zero, _is_int
from astr... |
c61e54d10d2cd91aa2e62e36032606043b6260c8388a7a218a80b28bbf43b72c | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import ctypes
import gc
import itertools
import math
import re
import time
import warnings
from contextlib import suppress
import numpy as np
from .base import DELAYED, ExtensionHDU, BITPIX2DTYPE, DTYPE2BITPIX
from .image import ImageHDU
from .table impo... |
62e06611ed06e38ed05c6cb314738e8d4b665e0d4cc921bc4fed5caa22548231 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import datetime
import os
import sys
import warnings
from contextlib import suppress
from inspect import signature, Parameter
import numpy as np
from astropy.io.fits import conf
from astropy.io.fits.file import _File
from astropy.io.fits.header import ... |
dc011c2c7e845eb85503fe28093217018245d0a08656f8763b8c24d918bf2366 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import bz2
import gzip
import itertools
import os
import shutil
import sys
import warnings
import numpy as np
from . import compressed
from .base import _BaseHDU, _ValidHDU, _NonstandardHDU, ExtensionHDU
from .groups import GroupsHDU
from .image import ... |
cd6ebf1a75cc473861ecaf98e63ca7c18808a3fc5c66a0c560789d1b8c094f34 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import os
from .base import _BaseHDU, BITPIX2DTYPE
from .hdulist import HDUList
from .image import PrimaryHDU
from astropy.io.fits.file import _File
from astropy.io.fits.header import _pad_length
from astropy.io.fits.util import fileobj_name
... |
f712d951d65db0f15b915cd2e22742a49850b253c2264852cc36448bf965641f | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import copy
import gc
import pickle
import re
import pytest
import numpy as np
from numpy import char as chararray
try:
import objgraph
HAVE_OBJGRAPH = True
except ImportError:
HAVE_OBJGRAPH = False
from astropy.io import f... |
ba58910a50d77d6f5973e104c8f11e128851e4c892fc0ff6c681a17d9c1085fa | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import warnings
import pytest
import numpy as np
from .test_table import comparerecords
from astropy.io.fits.hdu.base import _ValidHDU
from astropy.io import fits
from . import FitsTestCase
class TestChecksumFunctions(FitsTestCase):
# ... |
cff5963deb04d503a846291270185005519752ac08953f0cd5c415747d3cdf0b | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
from astropy.io import fits
from . import FitsTestCase
from astropy.tests.helper import catch_warnings
class TestDivisionFunctions(FitsTestCase):
"""Test code units that rely on correct integer division."""
def test_rec_from_... |
c15948b9b5649a7d2cb8705462fe0a4abedb66aefe5532c5b7b37400a9d59747 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import time
import pytest
import numpy as np
from . import FitsTestCase
from .test_table import comparerecords
from astropy.io import fits
class TestGroupsFunctions(FitsTestCase):
def test_open(self):
with fits.open(self.data('ra... |
92968b95d5b80da1dc8fdbda6d76ba8a6f292becd4ecc11d0017ea36b769e289 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
from astropy.io import fits
from . import FitsTestCase
class TestNonstandardHdus(FitsTestCase):
def test_create_fitshdu(self):
"""
A round trip test of creating a FitsHDU, adding a FITS file to it,
writing ... |
ccb3a9e7256c9fea1a8e7e32d3979fe96326a0c414103a34d6dd68312f72caa7 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import glob
import io
import os
import platform
import sys
import copy
import subprocess
import pytest
import numpy as np
from astropy.io.fits.verify import VerifyError
from astropy.io import fits
from astropy.tests.helper import raises, catch_warnings, ... |
37c4cf072c8d387fee660f051361439bdf475418cac46a3e0d9fde7ca48c261e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from . import FitsTestCase
from astropy.io.fits.scripts import fitscheck
from astropy.io import fits
class TestFitscheck(FitsTestCase):
def test_noargs(self):
with pytest.raises(SystemExit) as e:
fitscheck.main(['-h... |
84cd66fab2cf3b6dfa7e1e67d1cffe15f329c6e8dc768eb35528c0e0010ee9a3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import os
import warnings
import pytest
import numpy as np
from astropy.io import fits
from astropy.table import Table
from astropy.io.fits import printdiff
from astropy.tests.helper import catch_warnings
from . import FitsTestCase
class TestConvenie... |
fd47e42462313c517f642019f41ed318ecb151528d2d99820833f45e0db7c0f5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import signal
import gzip
import pytest
import numpy as np
from numpy.testing import assert_equal
try:
from PIL import Image
HAS_PIL = True
except ImportError:
HAS_PIL = False
from astropy.tests.helper import catch_warnings
from ... |
58dad94dc311c4b5d715435ed38b89d1bb78dcf700d814807291fe300432f5af | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.io.fits.column import Column
from astropy.io.fits.diff import (FITSDiff, HeaderDiff, ImageDataDiff, TableDataDiff,
HDUDiff)
from astropy.io.fits.hdu import HDUList, PrimaryHDU, ImageHDU
fro... |
045680267e58153a192891eae99fda4a2d387ac81363c636d2c6c01ccd9ef6a3 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import warnings
import collections
from io import StringIO, BytesIO
import pytest
import numpy as np
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning
from astropy.tests.helper import catch_... |
1ad46864c25261b4798aee9978f61b5a333f92cf056c1701bd11daabd9b399d7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import os
from . import FitsTestCase
from astropy.io.fits.convenience import writeto
from astropy.io.fits.hdu import PrimaryHDU, hdulist
from astropy.io.fits import Header, ImageHDU, HDUList
from astropy.io.fits.scripts i... |
347ba7ce6e0aeb60d034420ede0cb510a288d6533e6d62d503592b5adc403c5a | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import sys
import numpy as np
from astropy.io import fits
from . import FitsTestCase
def compare_arrays(arr1in, arr2in, verbose=False):
"""
Compare the values field-by-field in two sets of numpy arrays or
recarrays.
"""
arr1 = arr1... |
c423549b881e1eabaf33d0d2fdb76fd08813bd6a79719f428019d13506a450b0 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import pytest
import numpy as np
from astropy.io import fits
from astropy.io.fits.compression import compress_hdu
from . import FitsTestCase
MAX_INT = np.iinfo(np.intc).max
MAX_LONG = np.iinfo(np.long).max
MAX_LONGLONG = np.iinfo(np.longlong).max
cla... |
65a2272a38ec345c3d19b19fafb6d6a5e32b86cd99ba8fdbe2782dfb814180cc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from . import FitsTestCase
from astropy.io.fits.scripts import fitsheader
class TestFITSheader_script(FitsTestCase):
def test_noargs(self):
with pytest.raises(SystemExit) as e:
fitsheader.main(['-h'])
asse... |
94dfe8d480eb547f9cc89a8454c7bf618e9b6f588cee602750002f25fbdf5690 | import os
import gc
import pathlib
import warnings
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.io.fits.column import (_parse_tdisp_format, _fortran_to_python_format,
python_to_tdisp)
from astropy.io.fits import HDUList, PrimaryHDU, BinTa... |
a2e2feadd7739bf991b3aa996e91b2d779519028b86720d1139048f73efeb19a | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import bz2
import io
import mmap
import errno
import os
import pathlib
import warnings
import zipfile
from unittest.mock import patch
import pytest
import numpy as np
from . import FitsTestCase
from astropy.io.fits.convenience import _getext... |
a89995736fe62eb86b561dcd16f429cf8e54e96b16a6e938119b8864b0805ba6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from . import FitsTestCase
from astropy.io.fits.fitstime import GLOBAL_TIME_INFO, time_to_fits, is_time_column_keyword
from astropy.coordinates import EarthLocation
from astropy.io import fits
from astropy.table import T... |
8c496a9c14cdaf24eee2ab2f91561916c50f11eec6140c2722dfcd4593b555e2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from . import FitsTestCase
from astropy.io.fits.scripts import fitsinfo
class TestFitsinfo(FitsTestCase):
def test_onefile(self, capsys):
fitsinfo.main([self.data('arange.fits')])
out, err = capsys.readouterr()
out = out.spl... |
1d9f225c127e09ba648a08d7719a779dc99defecb27336b4f23e7015617162bd | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import platform
import pytest
import numpy as np
from astropy.io import fits
from . import FitsTestCase
from astropy.tests.helper import ignore_warnings
class TestUintFunctions(FitsTestCase):
@classmethod
def setup_class(cls):
cls.utype... |
b0f19d64879b2b4a5baf1728b55e3f4876bd4246d257f88abdb96e27eee4e28f | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import math
import os
import platform
import re
import time
import warnings
import pytest
import numpy as np
from numpy.testing import assert_equal
from astropy.io import fits
from astropy.tests.helper import catch_warnings, ignore_warnings
from astropy... |
0659bbbd22eb6cd4b6495f0b8a03ddca166de5179b28286fee309fa6d67ff4cd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import functools
from io import BytesIO
from textwrap import dedent
import pytest
import numpy as np
from numpy import ma
from astropy.table import Table, MaskedColumn
from astropy.io import ascii
from astropy.io.ascii.core import ParameterEr... |
7058560f0a0b295061b5d6f63a5d547b3455ec9e6c5d3bcc8435b90ab3c39cd9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import pytest
from astropy.io import ascii
from astropy.io.ascii.core import InconsistentTableError
from .common import (assert_equal, assert_almost_equal)
def assert_equal_splitlines(arg1, arg2):
assert_equal(arg1.splitli... |
95fcc072ce38e882f3fd8c32d32f1a3ad652e2417ee1621954d891e94410b9a9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import pytest
from astropy.io.ascii.ui import read
from astropy.io.ascii.ipac import Ipac, IpacFormatError, IpacFormatErrorDBMS
from astropy.tests.helper import catch_warnings
from astropy.io import ascii
from astropy.table impo... |
07ccdbeeb4d947d32d22adc0d778d2f3dfbae9211e79b50cf55e69eb38b04451 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``HTML``
reader/writer and aims to document its functionality.
Requires `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
to be installed.
"""
from io impor... |
4a35972bbbab3b4bfe338008b397b51eb52d98e0cfd63a854f033bafebd0bfad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import pytest
import numpy as np
from astropy.io.ascii import read
ROOT = os.path.abspath(os.path.dirname(__file__))
try:
import bz2 # pylint: disable=W0611
except ImportError:
HAS_BZ2 = False
else:
HAS_BZ2 = True
tr... |
a679befd11943bcfa3ba2f64ef086e5078e66adbfc9e19f83e8a06510cc6597e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``ECSV``
reader/writer.
Requires `pyyaml <http://pyyaml.org/>`_ to be installed.
"""
import os
import copy
import sys
from io import StringIO
import pytest
import numpy as np
from astropy.table i... |
614688fd7e04447b5c3085a3945d821b4926e7e1912c05014873d93d6fbd20aa | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from io import BytesIO, open
from collections import OrderedDict
import locale
import platform
from io import StringIO
import pathlib
import pytest
import numpy as np
from astropy.io import ascii
from astropy.table imp... |
268f0180232ce2e2783159553b76db328d65ff48dfc9e0539f1fe6016703efc8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import copy
from io import StringIO
from itertools import chain
import pytest
import numpy as np
from astropy.io import ascii
from astropy import table
from astropy.table.table_helpers import simple_table
from astropy.tests.helper import cat... |
45fa3f368b08b74a8c44610442e963d470e70c42688175737b46a54f73967e31 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
from astropy.table import Table, Column
from astropy.table.table_helpers import simple_table
import numpy as np
ROOT = os.path.abspath(os.path.dirname(__file__))
files = ['data/cds.dat', 'data/ipac.dat', 'data/daophot.dat', 'd... |
caf55fa18e599a1950eef9ddbb39870196eaa90f83974891934ed2b8603d0aad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.io import ascii
from .common import (assert_equal, assert_almost_equal, has_isnan,
setup_function, teardown_function)
def read_table1(readme, data):
reader = ascii.Cds(readme)
return reader.read(data)
def read... |
73382b7d09c8049f3f0759e5f37376f395308d95a03eb56176c870a14424b927 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
from astropy.io import ascii
from .common import (assert_equal, assert_almost_equal)
def assert_equal_splitlines(arg1, arg2):
assert_equal(arg1.splitlines(), arg2.splitlines())
def test_read_normal():
"""Normal SimpleR... |
1c5c60991129fc51339ea0d78cd0a566cfcb209257c220ef0bde64341fe76b61 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import numpy as np
from astropy.io import ascii
from .common import assert_equal
def test_types_from_dat():
converters = {'a': [ascii.convert_numpy(float)],
'e': [ascii.convert_numpy(str)]}
dat = as... |
db2b54de6a1587f503a3d02f787c02a79b89101d73cdb051836ef21fb394c262 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
# This file connects ASDF to the astropy.table.Table class
import functools
from astropy.io import registry as io_registry
from astropy.table import Table
def read_table(filename, data_key=None, find_table=None, **kwargs):
"... |
a23662a131c758fe09ef48aa904ffe859f1cedfee1d6c031b8f94813f0443bf6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf.types import CustomType, ExtensionTypeMeta
__all__ = ['AstropyType', 'AstropyAsdfType']
_astropy_types = set()
_astropy_asdf_types = set()
class AstropyTypeMeta(ExtensionTypeMeta):
"""
Keeps track of `Astrop... |
ac4995c6d62b318c079fe79bd55e3e285db5eaf5c8d3f5a5914ef0e2a1bd03fb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import os
from asdf.extension import AsdfExtension, BuiltinExtension
from asdf.resolver import Resolver, DEFAULT_URL_MAPPING
from asdf.util import filepath_to_url
# Make sure that all tag implementations are imported by the time ... |
350f7ca683569388a2bc94b79d59aec1dff1ae7d93bc9afc450191173ae6c7df | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file connects the readers/writers to the astropy.table.Table class
import functools
from astropy.table import Table
import astropy.io.registry as io_registry
__all__ = ['PANDAS_FMTS']
# Astropy users normally expect to not have an index, so defa... |
344415a952da1efd75a4b39fea24cfbc32f56324fd15366aab329ea498f8f9bf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import pytest
import numpy as np
from astropy.io import ascii
from astropy.table import Table, QTable
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.io.misc.pandas import connect
# Check dep... |
a580582669823cf57a507b13637333d8f2d861fce63aaa192402dba882aecd19 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to YAML serialization.
Requires `pyyaml <http://pyyaml.org/>`_ to be installed.
"""
from io import StringIO
import pytest
import numpy as np
from astropy.coordinates import SkyCoord, EarthLocation, Ang... |
c995db60e37766e0a321091805edd4bb77daedbdd0a2ee813ae8baf5e0fcd882 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.tests.helper import catch_warnings
from astropy.table import Table, QTable, NdarrayMixin, Column
from astropy.table.table_helpers import simple_table
from astropy import units as u
from astropy.coordinates... |
6fbc8a564057662efb66c86c65c76adc068e270a67d8e8095c790cf349862cd0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.io.misc import fnpickle, fnunpickle
from astropy.tests.helper import catch_warnings
from astropy.utils.exceptions import AstropyDeprecationWarning
def test_fnpickling_simple(tmpdir):
"""
Tests the `fnpickle` and `fnup... |
1e28b65ce8673697aa94d2fd795bbe55fb813a301dc905aa9c2886ba161a0904 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
from astropy import __minimum_asdf_version__
asdf = pytest.importorskip('asdf', minversion=__minimum_asdf_version__)
from astropy.table import Table
def make_table():
a = [1, 4, 5]
b = [2.0, 5.0, 8.2]
... |
32c394bada78a65c92eaab9834eb8ffb42371867576e5080fda952a7b7efc568 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from asdf import tagged
from asdf import yamlutil
from asdf.tags.core.ndarray import NDArrayType
from astropy import table
from astropy.io.misc.asdf.types import AstropyType, AstropyAsdfType
class TableType:
... |
380c6c7da7ada074b283cd7700106e3f8542d3321cc73d5e08f5d2b8baf4bb38 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from numpy.testing import assert_array_equal
from asdf import yamlutil
from astropy import table
from astropy.io import fits
from astropy.io.misc.asdf.types import AstropyType, AstropyAsdfType
class FitsType:... |
6e90d05f42ec818c3cde118612929f594f1049bb1554b47da6925fcccbeaf62c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf import tagged, yamlutil
from astropy.modeling import mappings
from astropy.utils import minversion
from astropy.modeling import functional_models
from astropy.io.misc.asdf.types import AstropyAsdfType
__all__ = ['Trans... |
e9a25b4010c9d73167cef5d73c40fcc014acf2af999f99823f70380a8ce0c287 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from numpy.testing import assert_array_equal
from asdf import yamlutil
from astropy import modeling
from astropy import units as u
from .basic import TransformType
__all__ = ['TabularType']
class TabularType... |
f966fdd59b1f93764744a18f0a96d8151b0b87f86882182da22ab70c074557b1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf.yamlutil import custom_tree_to_tagged_tree
from astropy.time import TimeDelta
from astropy.time.tests.test_delta import (allclose_jd, allclose_jd2,
allclose_sec)
from ...types... |
a9ab290a508b7b074becb9e00b073e2c1e375fe0ed84365842138b388ab7cbac | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from numpy.testing import assert_array_equal
from asdf import yamlutil
from asdf.versioning import AsdfSpec
from astropy import time
from astropy import units as u
from astropy.units import Quantity
from astrop... |
222a1c3926faba6ed06b1442c465959268235376ef26e5b56cbff390c8adc547 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import os
import glob
from asdf import tagged
from asdf.yamlutil import custom_tree_to_tagged_tree
import astropy.units as u
import astropy.coordinates
from astropy.coordinates.baseframe import frame_transform_graph
from astropy.u... |
347cc590f4d3ae9cb8a1fde4e89950582fba8d6ff88ed61b64452de2550a3347 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from asdf.yamlutil import custom_tree_to_tagged_tree, tagged_tree_to_custom_tree
from astropy.coordinates import SkyCoord
from astropy.table.tests.test_operations import skycoord_equal
from ...types import Ast... |
f2646921367850f6527c9f26827bac5aeeb68956943b77b4fe01bc1029d10356 | from asdf.yamlutil import custom_tree_to_tagged_tree
import astropy.units as u
import astropy.coordinates.representation
from astropy.coordinates.representation import BaseRepresentationOrDifferential
from astropy.io.misc.asdf.types import AstropyType
class RepresentationType(AstropyType):
name = "coordinates/r... |
e821960f3816a5d0ed13fdc32a05f7cc193a4f9d97c9dac10f914aea1a6a8c3c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf.yamlutil import custom_tree_to_tagged_tree
from astropy.coordinates import Angle, Latitude, Longitude
from astropy.io.misc.asdf.tags.unit.quantity import QuantityType
__all__ = ['AngleType', 'LatitudeType', 'LongitudeT... |
9f46cb61dc4956635ee9eee7afe229daa1dba7dfbe0b0641df6d32296969dc4f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from asdf.yamlutil import custom_tree_to_tagged_tree
from astropy.coordinates import EarthLocation
from ...types import AstropyType
class EarthLocationType(AstropyType):
name = 'coordinates/earthlocation'
types = [Earth... |
bd9d07a53dab30efbfcb9ed15991ae050099cc6e468aec737cf1612f20187bcd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
def run_schema_example_test(organization, standard, name, version, check_func=None):
import asdf
from asdf.tests import helpers
from asdf.types import format_tag
from asdf.schema import load_sch... |
27dd55c5953528867309040d2321364fc95dbf561e2d179cbc50c3d20d018078 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from astropy.units.equivalencies import Equivalency
from astropy.units import equivalencies
from astropy.units.quantity import Quantity
from asdf.yamlutil import custom_tree_to_tagged_tree
from astropy.io.misc.asdf.types import As... |
7b225dd39b02f1b292cdadd61fbc4dd0dc70b4a73d4978ba2b72e759e9c5602e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import six
from astropy.units import Unit, UnitBase
from astropy.io.misc.asdf.types import AstropyAsdfType
class UnitType(AstropyAsdfType):
name = 'unit/unit'
types = ['astropy.units.UnitBase']
requires = ['astropy']... |
daac2728ea3262655196f57fdbf3b247b3ac85316bda3c7d203344ba7a9f3d70 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from numpy import isscalar
from astropy.units import Quantity
from asdf.yamlutil import custom_tree_to_tagged_tree
from asdf.tags.core import NDArrayType
from astropy.io.misc.asdf.types import AstropyAsdfType
from .unit import Un... |
b62effb831a1996079c71c18c072c2d15a03ca54cee6f8c8961fb935ea0ce9a4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import astropy.units as u
from astropy import table
from astropy.time import Time, TimeDelta
from astropy.coordinates import SkyCoord, EarthLocation
from astropy.table.tests.test_operations import ... |
068e54ce60d09831ed7ea61bc78f9207d1dcdfd8dd6c8ea3683d7dd0b295a007 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import os
import pytest
import numpy as np
from astropy.io import fits
from astropy import __minimum_asdf_version__
asdf = pytest.importorskip('asdf', minversion=__minimum_asdf_version__)
from asdf.tests import helpers
from ...... |
274b8451472d45f3034a713a75728a7c7866a5663c153e227165af9b142e936e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
import numpy as np
from astropy import __minimum_asdf_version__
asdf = pytest.importorskip('asdf', minversion=__minimum_asdf_version__)
from asdf import util
from asdf.tests import helpers
import astropy.units as u... |
1cdbae171a51a593e0aee2fb3ce23bb04217571da4516c1e9ab10e37d6b4dccc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
asdf = pytest.importorskip('asdf')
from asdf.tests.helpers import assert_roundtrip_tree
from astropy import units as u
from astropy.time import Time, TimeDelta
@pytest.mark.parametrize('fmt', TimeDelta.FORMATS.key... |
52bff8066fa9746f33a1a5bbebc8933366d7db0a4cde398b531d50ba349040fe | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import datetime
from collections import OrderedDict
import pytest
import numpy as np
from astropy import time
from astropy import __minimum_asdf_version__
asdf = pytest.importorskip('asdf', minversion=__minimum_asdf_version__)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.