hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
ab49b60ac9ac5d15975e0959403157ad595d44e0673080d444fd25551185c50d | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is the APE5 coordinates API document re-written to work as a series of test
functions.
Note that new tests for coordinates functionality should generally *not* be
added to this file - instead, add them to other appropriat... |
15c0c2fe0e7734a74b0e8dbafe0ac3d5a73798f3b77924dfacc0e7f7a6b139e4 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for putting velocity differentials into SkyCoord objects.
Note: the skyoffset velocity tests are in a different file, in
test_skyoffset_transformations.py
"""
import pytest
import numpy as np
from ... import units as ... |
931c27a6730454baed3c07554164db95430b9966b41938c8f482f76b19bfb6a6 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy import testing as npt
from ... import units as u
from ...time import Time
from ..builtin_frames import ICRS, AltAz
from ..builtin_frames.utils import get_jd12
from .. import EarthLocati... |
ad8700436fec1b0326e6a5c5ae0db8afc1769405477ca726d490103b461be25c | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Regression tests for coordinates-related bugs that don't have an obvious other
place to live
"""
import io
import pytest
import numpy as np
from ... import units as u
from .. import (AltAz, EarthLocation, SkyCoord, get_sun,... |
f60bdb4e58d83ed086a1b1c3edf80b7dab02a6551d8323973abeb698d38f1048 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy import testing as npt
from ...tests.helper import assert_quantity_allclose as assert_allclose
from ... import units as u
from ...utils import minversion
from .. import matching
"""
Th... |
73955cc34d94799b0cdc862e62c6047efe686caebbc1e79733b7544c5ae7e241 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ... import units as u
from ...tests.helper import (assert_quantity_allclose as
... |
d75d7d59a3e15e246d9911f387ee8fd4043122c90f414c244c1d5c4eefecba6d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Accuracy tests for GCRS coordinate transformations, primarily to/from AltAz.
"""
import pytest
import numpy as np
from ... import units as u
from ...tests.helper import (assert_quantity_allclose as assert_allclose)
from ...time import Time
from .. im... |
e4aabb07017518d790b71155c2b97bf0843292413225c7f969a35b20dc286066 |
import pytest
from ...tests.helper import assert_quantity_allclose
from ...units import allclose as quantity_allclose
from ... import units as u
from .. import Longitude, Latitude, EarthLocation
from ..sites import get_builtin_sites, get_downloaded_sites, SiteRegistry
def test_builtin_sites():
reg = get_builtin... |
7fb30b11685f269e29c9397a601d8ad67e7f209b8831979ae5c16801e2b6c33d | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the SkyCoord class. Note that there are also SkyCoord tests in
test_api_ape5.py
"""
import copy
import pytest
import numpy as np
import numpy.testing as npt
from ... import units as u
from ...tests.helper import (... |
fedc1a643574572f5215ca67954ddc93b40bdb5ffe1b0c13c5b03365484f6d3e | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This includes tests for the Distance class and related calculations
"""
import pytest
import numpy as np
from numpy import testing as npt
from ... import units as u
from ...units import allclose as quantity_allclose
from .. ... |
93808c9e3e4c62157e66513121a56b84bf90471de1b2a12687cc7e896f658a5f | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test initialization of angles not already covered by the API tests"""
import pickle
import pytest
import numpy as np
from ..earth import EarthLocation, ELLIPSOIDS
from ..angles import Longitude, Latitude
from ...units import ... |
3e53e5e077304ae091a04bf968c7670887426e33b18fef9e9e4cfa475b17cabb | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ...units import allclose as quantity_allclose
from ... import units as u
from ... import constants
from ...time import Time
from ..builtin_frames import ICRS, AltAz, LSR, GCRS, Galactic, FK5
... |
c77a772476a550b596419c9c6bd493c26634f762ce8a6b95fe5c7fc3606d0d23 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Accuracy tests for Ecliptic coordinate systems.
"""
import numpy as np
from ....units import allclose as quantity_allclose
from .... import units as u
from ... import SkyCoord
from ...builtin_frames import FK5, ICRS, GCRS, GeocentricTrueEcliptic, Bar... |
ca32663bccc7fca78acc350976e06e6ae8bd0431ec4195a5811c13fd4dc701a6 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import bz2
import gzip
import http.client
import mmap
import operator
import pathlib
import io
import os
import sys
import tempfile
import warnings
import zipfile
import re
from functools import reduce
import numpy as np
from .util import (isreadable, ... |
098096d418e40f6daeed64a99f089c06c5a102b126f24632f10aa06360c1e1c2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import warnings
from collections import OrderedDict
from .. import registry as io_registry
from ... import units as u
from ...table import Table, serialize, meta, Column, MaskedColumn
from ...table.table import has_info_class
from ..... |
4a35e43f97e9dabfddc37f416913df6e778a023869e1c8cdbce65dc1074d30a3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Facilities for diffing two FITS files. Includes objects for diffing entire
FITS files, individual HDUs, FITS headers, or just FITS data.
Used to implement the fitsdiff program.
"""
import fnmatch
import glob
import io
import operator
import os.path
i... |
49740f7e4f0ebe4b68106ddafa3349a64637f634bba09f039ff335c8ec4cba35 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import operator
import re
import sys
import warnings
import weakref
import numbers
from functools import reduce
from collections import OrderedDict
from contextlib import suppress
import numpy as np
from numpy import char as chararray
from .... |
65f5a5b4337e78884dcddef85a8c7b05dced2df6f526be7896f8394aa9d14a5b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import warnings
from collections import defaultdict, OrderedDict
import numpy as np
from . import Header, Card
from ... import units as u
from ...coordinates import EarthLocation
from ...table import Column
from ...time import Time, TimeDelta... |
6527992eefeebef8303a0b11a83ee4678bf0b2ffc8b7fc58479026b3a831b393 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
"""
Convenience functions
=====================
The functions in this module provide shortcuts for some of the most basic
operations on FITS files, such as reading and updating the header. They are
included directly in the 'astropy.io.fits' namespace so ... |
28052441aa130f41181955867b240fa09b45f862139bde4e08a3d3f7081da488 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import itertools
import io
import mmap
import operator
import os
import platform
import signal
import sys
import tempfile
import textwrap
import threading
import warnings
import weakref
from contextlib import contextmanager, suppress
from ...u... |
3b474889e6c4aa31fb0f6d17fa8403416b198533e4f150851bb4ed68bb7f643d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
basic.py:
Basic table read / write functionality for simple character
delimited files with various options for column header definition.
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author:... |
311e97bd4dc5b39842228e7b5795f54d6de63401255f80816324967a89dc5b0f | # 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... |
6ab59c668c3b450b128464894e6b7a59d6f2fa557d826af541bedadacc79abef | # 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... |
d0b22c00caf37717b97e2c07b49f036be3775a56fb63acdb9d4bfe36c1dfe312 | # 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... |
072cda05af02e6c9920f2a621e3ceaa109620e0ddd49a650a2c38b1b4fc4b992 | # 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... |
b7e35d105ca380f650ced8d304afb2661b2a3671b6701bc71a0f45a353dfff35 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import copy
from collections import OrderedDict
from . import core
from ...table import Table
from . import cparser
from ...utils import set_locale
class FastBasic(metaclass=core.MetaBaseReader):
"""
This class is intended to handle t... |
75205fde145a17f26c22a643a8f1d73dce1680ad8807a2c5292e618f6429cad3 | """A Collection of useful miscellaneous functions.
misc.py:
Collection of useful miscellaneous functions.
:Author: Hannes Breytenbach (hannes@saao.ac.za)
"""
import collections.abc
import itertools
import operator
def first_true_index(iterable, pred=None, default=None):
"""find the first index position for... |
a693b5081017f1c7d54e7aa896fa87fe29ea562e702f9f921b565a772799cba2 | # 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... |
bc45fa9b025683a7ab9f746d522279abd4e3b69f00b73823901e790c92e4a5e1 | # 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... |
c468f1a6595ed9fc126c8dda16c02dc64f55fc16f732e9726fed6618fb06aaa4 | # 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... |
bbf2461a53f1d0d9c8b35cbc3cebc8fb7af7eb006c909a723933151483df5406 | # 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 ..registry import _readers, _writers, _identifiers
from .. import registry as io_registry
from ...table import Table
from ... import units as u
_READERS_ORIGI... |
eb07b1014a8e4620fbbd8894db2c0d7a83aeb2036f8c2278b3ee5ed286652a17 | # 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 ... import fits
from ..util import fill
from ....utils.exceptions import AstropyDeprecationWarning
log = logging.getLogger('fitsdiff')
USAGE = """
Com... |
437391e7335dea297de9e3a08159f8bb560330d9b3d2d34f08a4d90652a7d94b | # 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 ... |
1e675c6bd2b3d756fefc209ab2df1fcaac0eb8188cfdc90e63597bc6f55d390b | # 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 ... |
462ab7c685e62a2f9602ef9381f2859f1bb5591b633b72104f09851a4ee0d30e | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import glob
import io
import os
import platform
import sys
import copy
import pytest
import numpy as np
from ..verify import VerifyError
from ....io import fits
from ....tests.helper import raises, catch_warnings, ignore_warnings
from ....utils.exception... |
b6b8e3800810002d9b9c7164bb7743b3dcec0ab49310b53752d6cf5cd6debc3b | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import os
import warnings
import pytest
import numpy as np
from ....io import fits
from ....table import Table
from .. import printdiff
from ....tests.helper import catch_warnings
from . import FitsTestCase
class TestConvenience(FitsTestCase):
d... |
f6e7edf1b6e3551ddc993b4fad2ab32d6346df730813fe5ff176a97c28de688f | # 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 ....tests.helper import catch_warnings
from .. i... |
01f5dc11f351f5386e5d54e34d158106e50f5b5826e78b1e60ef99f56a3049a7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ..column import Column
from ..diff import (FITSDiff, HeaderDiff, ImageDataDiff, TableDataDiff,
HDUDiff)
from ..hdu import HDUList, PrimaryHDU, ImageHDU
from ..hdu.table import BinTableHDU
from ..he... |
16fcdd66b35bb7aa4d3e879d85cd4f67f4a21ad5e2719fff9ddbc87dd290bd5b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
import os
from . import FitsTestCase
from ..convenience import writeto
from ..hdu import PrimaryHDU, hdulist
from .. import Header, ImageHDU, HDUList
from ..scripts import fitsdiff
from ....tests.helper import catch_warni... |
68ecbbdf965acf35aa8202128c4ba5ac91e6e65090f5df08433607b07c0a9e89 | import os
import gc
import pathlib
import warnings
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ..column import _parse_tdisp_format, _fortran_to_python_format, \
python_to_tdisp
from .. import HDUList, PrimaryHDU, BinTableHDU
from ... import fits
from .... import units as u
f... |
256ce6d504fe72357aaebc2928b0d9c7ba07ce65647ba8a27dba000f1ced3327 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import bz2
import io
import mmap
import os
import pathlib
import warnings
import zipfile
import pytest
import numpy as np
from . import FitsTestCase
from ..convenience import _getext
from ..diff import FITSDiff
from ..file import _File, GZIP... |
332fccf230a031c9b57f544f2c9a19dae0fbcd5d6808df09784c3b5deaac8da6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
import numpy as np
from . import FitsTestCase
from ..fitstime import GLOBAL_TIME_INFO, time_to_fits, is_time_column_keyword
from ....coordinates import EarthLocation
from ....io import fits
from ....table import Table, QTable
fro... |
9376575bb37f68b55147bef2ad64a900fbfd7f7dd8168ffd9b4c553c426d7277 | # 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 ....io import fits
from ....utils.exceptions import AstropyPendingDeprecationWarning
from ....tests.... |
256fc7ed98ace2412ebe3d17e4aa96d1af01fe85e29b9a124be4238422aab946 | # 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 ....table import Table, MaskedColumn
from ... import ascii
from ...ascii.core import ParameterError, FastOptionsErr... |
23067c5bca277cc0a2a9527a512f5b4148bf06c410b629d9b158041c7e51cf3e | # 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 ....table impor... |
cdad2bd64be02bbb07721e64a9b3f85e0fc29017c36405c7f07a86152f52df2b | # -*- 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 ... import ascii
from ....table import Table
f... |
70f7eaec7174c3f698f5f0e62beefb5925216ee89ecee7cc729f6ca863b7b674 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
The **asdf** subpackage contains code that is used to serialize astropy types
so that they can be represented and stored using the Advanced Scientific Data
Format (ASDF). This subpackage defines classes, referred to as **tags**,... |
052f33541476c5f910087804d230b716b560a0bfd2277bffc682a21450c92cdf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ....tests.helper import catch_warnings
from ....table import Table, QTable, NdarrayMixin, Column
from ....table.table_helpers import simple_table
from .... import units as u
from ....coordinates import SkyCoord, L... |
1993c93f6b152162c42fcef08b83034cf8b501be6eb5f0a5922a137d4c46ba2e | # 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
import astropy.units as u
from astropy import modeling
from .basic import TransformType
from . import _parameter_to_value
__all__ = ['Shif... |
cdb36ba7a8820f4d0fc812ec6e31391f506bae115e8208d25141302dbb585266 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
import numpy as np
from astropy import table
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf.tests import helpers
def test_table(tmpdir):
data_rows = [(1, 2.0, 'x'),
(4, 5... |
26a2ef4602cb5792b3e1c5e59b9f6f459348c53387bdde2e7cefd4bbbede69b3 | # 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
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf.tests import helpers
def test_complex_structure(tmpdir):
with fits.open(os.path.j... |
e3e7e8295f907fd19b7e7ba5c61e072e0ff85660c942b48c5bd86e9837b38b37 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
import numpy as np
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf import util
from asdf.tests import helpers
import astropy.units as u
from astropy.modeling import models as astmodels
test_mo... |
bce1c610df4b8c262dbc10ab8d1e5923150c1989a227d230272583c6d5eaa58a | # 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
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf import AsdfFile, yamlutil, tagged
from asdf.tes... |
83098a639cda53e09093381364f250ccfcbe052e46fd55528f0ab16fd5e0aac2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import pytest
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf.tests.helpers import assert_roundtrip_tree
from astropy import units
from astropy.coordinates import ICRS, FK5, Longitude, Latitude, Angle
from ... |
f9bfaaefef442ae457ddc23823e3885f98a15b874c18e3719fd22dd0e30439d9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import io
import pytest
from astropy import units as u
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf.tests import helpers
# TODO: Implement defunit
def test_unit():
yaml = """
unit: !unit/unit-1.0.0... |
e2539b2fd74092cdd97199dd945059adc13b932aac95de36724ee9456255fb6e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import io
import pytest
from astropy import units
asdf = pytest.importorskip('asdf', minversion='2.0.0.dev0')
from asdf.tests import helpers
def roundtrip_quantity(yaml, quantity):
buff = helpers.yaml_to_asdf(yaml)
with... |
a6d20f4a2b4a77e19a4b12045cf415ba8d14eb6131e64949c0bb16fb56d2fc0e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This plugin provides customization of the header displayed by pytest for
reporting purposes.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import sys
import datetime
import l... |
12b5a0a0864c28d45febcca8bd8eb19053b226e56d7b8101fd5bebddba711c1a | from ... import units as u
from ..helper import assert_quantity_allclose, pytest
def test_assert_quantity_allclose():
assert_quantity_allclose([1, 2], [1, 2])
assert_quantity_allclose([1, 2] * u.m, [100, 200] * u.cm)
assert_quantity_allclose([1, 2] * u.m, [101, 201] * u.cm, atol=2 * u.cm)
with py... |
de29ee883391ae1440adce55ce09b0fb525e67fd2e36042a858d8b6aa7148e55 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
import pytest
import numpy as np
from .. import core, funcs
from ...units import allclose
from ...utils.compat import NUMPY_LT_1_14
from ... import units as u
try:
import scipy # pylint: disable=W0611
except ImportError:
... |
0f06bdc342e48479d6b6de2653c290d9e022246c930b22373eacc3e4729f8d24 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... |
e7462b2b9c5de44c2871988760fdc3b764e491d4bad46eb35c3bfbfb23a6b6ee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .index import TableIndices, TableLoc, TableILoc, TableLocIndices
import re
import sys
from collections import OrderedDict, Mapping
import warnings
from copy import deepcopy
import numpy as np
from numpy import ma
from .. import log
from ..io import... |
3dfa9973f12831b2c55d1beed185594e5a2c03484079793035241442f4a20a2e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from functools import partial
from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION
from ..utils.exceptions import AstropyUserWarning
from ..utils.console import human_file_size
from ..utils.decorators impor... |
9cae7efe58334edd1db3002b05edb69be746815fbcf65d5a8be5810cd877165f | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions related to Python runtime introspection."""
import inspect
import types
import importlib
from distutils.version import LooseVersion
__all__ = ['resolve_name', 'minversion', 'find_current_module',
'isinsta... |
13129e7119cf6c0fdef981ea9247cac790f7e63f81e098da9c86fc69af2e0788 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module includes helper functions for array operations.
"""
from copy import deepcopy
import numpy as np
from .decorators import support_nddata
from .. import units as u
from ..coordinates import SkyCoord
from ..utils import lazyproperty
from ..w... |
3c973852924095d6630d55813cbfb6a5bc0f56762aaf29a1441d6de758b53eb4 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.time package provides functionality for manipulating times and
dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI,
UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in
astr... |
d7085731c27893e89dca5c8b60f08804c682930b8200b7641925c7aa076135a7 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# The idea for this module (but no code) was borrowed from the
# quantities (http://pythonhosted.org/quantities/) package.
"""Helper functions for Quantity.
In particular, this implements the logic that determines scaling and resul... |
4e54158302f498d168dc179040b825846ee3d360875146fab41a55133fcef20a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines the `Quantity` object, which represents a number with some
associated units. `Quantity` objects support operations like ordinary numbers,
but will deal with unit conversions internally.
"""
# Standard libra... |
baf168833e49a6c17c624f67ed1dd05d9679cfe7d8c71cb1ff5ec820f4ccc1f8 | """
In this module, we define the coordinate representation classes, which are
used to represent low-level cartesian, spherical, cylindrical, and other
coordinates.
"""
import abc
import functools
import operator
from collections import OrderedDict
import inspect
import warnings
import numpy as np
import astropy.uni... |
a4a64ee3ffe012a896b3f591e969c7221f6b44ba44b7444c21fa31f4bd09e557 | """
Implements the wrapper for the Astropy test runner in the form of the
``./setup.py test`` distutils command.
"""
import os
import stat
import shutil
import subprocess
import sys
import tempfile
from distutils import log
from contextlib import contextmanager
from setuptools import Command
@contextmanager
def _s... |
ae502a9d1a649a63cce0d35da0dc426f90beb272cfeedf887d7b5703d844cb68 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
try:
import h5py # pylint: disable=W0611
except ImportError:
HAS_H5PY = False
else:
HAS_H5PY = True
try:
import yaml # pylint: disable=W0611
HAS_YAML = True
except ImportError:
HAS_YAML = False
import co... |
804d46dd8535ff2d09d67a08def6b8d05c8931b62df52f5eefd9789d5caaadd6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
import numpy.ma as ma
from ..convolve import convolve, convolve_fft
from numpy.testing import assert_array_almost_equal_nulp, assert_array_almost_equal
import itertools
VALID_DTYPES = ('>f4', '<f4', '>f8', '<f8')
VALID... |
3f30ac5c58e3afafa44a40bc61491b8ef7f5cb939fe2c9df7731c0c185a2846a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# namedtuple is needed for find_mod_objs so it can have a non-local module
from collections import namedtuple
import pytest
from .. import introspection
from ..introspection import (find_current_module, find_mod_objs,
isinst... |
783d7e485e201db228e2a35c036ec4c613d4045596220959c0c5ea563f583f7f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from numpy.testing import assert_allclose
from ...utils.data import get_pkg_data_contents, get_pkg_data_filename
from ...time import Time
from ... import units as u
from ..w... |
8578ecf18a4bb45e4881013661f7434b850acf29d1877055533bf13c357c9206 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import functools
import datetime
from copy import deepcopy
import numpy as np
from numpy.testing import assert_allclose
from ...tests.helper import catch_warnings, pytest
from ...utils import isiterable
from .. import Time, ScaleValueError,... |
07fbaab7a6092730263a76347a14a8f29861d33edee22178ee912442df3bad06 | # The purpose of these tests are to ensure that calling ufuncs with quantities
# returns quantities with the right units, or raises exceptions.
import warnings
from collections import namedtuple
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ... import units as u
from .. import quant... |
9c7df46d16153dde31322f8a18b487e83f27689b5c611eb2bf3e0537f30bc6f1 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains the coordinate frames actually implemented by astropy.
Users shouldn't use this module directly, but rather import from the
`astropy.coordinates` module. While it is likely to exist for the long-term,
the... |
dd4dd96cc4767e02aff7c16b92fa796f8cb737fdfde185dc9ac998f87f763384 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from ... import units as u
from .. import transformations as t
from ..builtin_frames import ICRS, FK5, FK4, FK4NoETerms, Galactic, AltAz
from .. import representation as r
from ..baseframe import ... |
f53b8cd258a22a5d07d74b2a03838f013afd21085c78b56c727066c022cef6e6 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the SkyCoord class. Note that there are also SkyCoord tests in
test_api_ape5.py
"""
import copy
import pytest
import numpy as np
import numpy.testing as npt
from ... import units as u
from ...tests.helper import (... |
325e3559f223e2bcc8d885057d3619e697dada7593446791c7de80e369e4852c | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This includes tests for the Distance class and related calculations
"""
import pytest
import numpy as np
from numpy import testing as npt
from ... import units as u
from ...units import allclose as quantity_allclose
from .. ... |
ab317a364fb9bcfaa39d571f0f2a2ce5b5cb73a9357953171ff27d31122a09b6 | # 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 ... |
d9b074bbabc4299b1a0a871b0bbcf3f998bc4c86bd4d7ae30998a7db213c9e16 | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# NOTE: The configuration for the package, including the name, version, and
# other information are set in the setup.cfg file. Here we mainly set up
# setup_requires and install_requires since these are determined
# programmatically.... |
e14506425551af91ac54eb0b17d607671b58d42e684faa43dfcd78f7fa6234de | # Licensed under a 3-clause BSD style license - see LICENSE.rst
pytest_plugins = [
'astropy.tests.plugins.display',
]
|
c45cdb74c430295950cb963d72e651567f253a209e656e20a3d0c003212fdf38 | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... |
9865434d1425084f297d2c6555ab9fc7714caa4fcaf6f39beb6a824d1b76c945 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
"""
# Prior to... |
6a5915e27350c7ca954cdc6874c8e312eee72c66a149ca3714bbb29bbbf99922 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains pytest configuration settings that are astropy-specific
(i.e. those that would not necessarily be shared by affiliated packages
making use of astropy's test runner).
"""
import builtins
from importlib.util import find_spec
import a... |
ff67c10efd90ec239e3c9e298ce6b08bd485783c61743fccde71458d1fa4ec19 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import glob
def get_package_data():
# Find all files in data/ sub-directories since this is a standard location
# for data files. We then need to adjust the paths to be relative to here
# (otherwise glob will be evaluated relative... |
ebd49c7d81d339b50f75d3a5b1e7534d532fffab2aaad30138f4dde8f9a0556b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... |
76ccb979de8392d41954608296fc6533b2c672ffffe7ae02f12acb50c50aee43 | # -*- coding: utf-8 -*-
"""
================================================================
Convert a radial velocity to the Galactic Standard of Rest (GSR)
================================================================
Radial or line-of-sight velocities of sources are often reported in a
Heliocentric or Solar-syst... |
019e420395fbf330f840b0aa2490b39e51da8c36a1b01a06c6f648fd9ed4f031 | # -*- coding: utf-8 -*-
"""
==========================================================
Create a new coordinate class (for the Sagittarius stream)
==========================================================
This document describes in detail how to subclass and define a custom spherical
coordinate frame, as discussed in ... |
41467f9a1ba7bfa2fe8df1f554f512fa51bcf63ace7facfeeb8ca61b35fd821f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy.utils import isiterable
from astropy.utils.decorators import deprecated_renamed_argument
from astropy.utils.exceptions import AstropyUserWarning
try:
import bottleneck # pylint: disable=W0611
HA... |
b39f1fe3914ebc6692cd0efc451826e5f74f0ed0807b1ebe8e0b07eb9066011e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Bayesian Blocks for Time Series Analysis
========================================
Dynamic programming algorithm for solving a piecewise-constant model for
various datasets. This is based on the algorithm presented in Scargle
et al 2012 [1]_. This cod... |
440649fdf63a372dee076e0080ae4c4becff790c28800338fe92f6dd569c68f4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements functions and classes for spatial statistics.
"""
import numpy as np
import math
class RipleysKEstimator:
"""
Estimators for Ripley's K function for two-dimensional spatial data.
See [1]_, [2]_, [3]_, [4]_, [5]_ f... |
95c51e7d88d26e440e1461e6df9fbd4032c5c4520c79f9a61e845b8b5bcb4527 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple statistical algorithms that are
straightforwardly implemented as a single python function (or family of
functions).
This module should generally not be used directly. Everything in
`__all__` is imported into `astropy.stats... |
67a6e45653402e70e5ec0fce50ec43b9aa97f806ecf166e72c7de0bd3b9431f0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple functions for model selection.
"""
import numpy as np
__all__ = ['bayesian_info_criterion', 'bayesian_info_criterion_lsq',
'akaike_info_criterion', 'akaike_info_criterion_lsq']
__doctest_requires__ = {'bayesia... |
58eafad7dd30f2632b69c0b434b36b142119a88eae6136d6e54a55de700bbad2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for computing robust statistics using
Tukey's biweight function.
"""
import numpy as np
from .funcs import median_absolute_deviation
from astropy.utils.decorators import deprecated_renamed_argument
__all__ = ['biweig... |
76a2b6331991af366e4eb1c04a416f54e32e2dc0bee53ad152a10cf23f66d269 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Methods for selecting the bin width of histograms
Ported from the astroML project: http://astroML.org/
"""
import numpy as np
from . import bayesian_blocks
__all__ = ['histogram', 'scott_bin_width', 'freedman_bin_width',
'knuth_bin_width... |
ef9c70afb62e372946297cef23fa45edafc7d6858990e198d1a92aea37dcdd2d | """
Table property for providing information about table.
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import os
from contextlib import contextmanager
from inspect import isclass
import numpy as np
from astropy.utils.data_info import DataInfo
__all__ = ['table_info', 'TableInfo', 'se... |
0918b18005fa476cdb6a3b52c458fb64126c4840a042494455e61832df317b10 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... |
9bb698f01d1a7179cc8308f65d7c470b35ebe6c6ef835e02b76267f80d5ce319 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from os.path import abspath, dirname, join
from .table import Table
from astropy.io import registry as io_registry
from astropy import config as _config
from astropy import extern
class Conf(_config.ConfigNamespace):
"""
Configuration paramete... |
f75f3589f18427c6e099d3e64a315c451d9995ae7b9fe4d74f784da6bc5fe599 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.io import registry
from .info import serialize_method_as
__doctest_skip__ = ['TableRead', 'TableWrite']
class TableRead(registry.UnifiedReadWrite):
"""Read and parse a data table and return as a Table.
This function provides the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.