hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
4dcaefc2d827635b659c0b06735ab29a4a2d01d174afd2489539a07d8fcf8ceb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module's main purpose is to act as a script to create new versions
of ufunc.c when ERFA is updated (or this generator is enhanced).
`Jinja2 <http://jinja.pocoo.org/>`_ must be installed for this
module/script to function.
Note that this does *no... |
d5acab1ebdbad9d14bfdbbf869be6dd41bed4743dce35f8f4cf77dcba6fe628b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import glob
from distutils import log
from distutils.extension import Extension
from astropy_helpers import setup_helpers
from astropy_helpers.version_helpers import get_pkg_version_module
ERFAPKGDIR = os.path.relpath(os.path.dirname(__file__... |
a0fd9b239b1111b5893ec4f08aa9db90f68485603b577a77479e3bc91b2cad72 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
astropy.wcs-specific utilities for generating boilerplate in docstrings.
"""
__all__ = ['TWO_OR_MORE_ARGS', 'RETURNS', 'ORIGIN', 'RA_DEC_ORDER']
def _fix(content, indent=0):
lines = content.split('\n')
indent = '\n' + ' ' * indent
retu... |
b21f8aa38dbdca7d92a4cbeda97729e50f44925ef2382fc5cb141cc838bd4c50 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
CONTACT = "Michael Droettboom"
EMAIL = "mdroe@stsci.edu"
import io
from os.path import join
import os.path
import shutil
import sys
from distutils.core import Extension
from distutils.dep_util import newer_group
from astropy_helpers import setup_helpe... |
d5487ec59f3be8ab89f8f74fe746ba2ad01bfac28e45e4c36e911ccb9d2eda68 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import units as u
from .wcs import WCS, WCSSUB_LONGITUDE, WCSSUB_LATITUDE
__doctest_skip__ = ['wcs_to_celestial_frame', 'celestial_frame_to_wcs']
__all__ = ['add_stokes_axis_to_wcs', 'celestial_frame_to_wcs',
'wcs... |
b9586ff03d59f635a27d6a322375e64e8b1900cb3b81d4d3f1b2a4b7c936fbdb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Under the hood, there are 3 separate classes that perform different
parts of the transformation:
- `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS
functionality in `wcslib`_. (This includes TPV and TPD
polynomial distortion, b... |
bb8f14f22dcf05c37370dd69e0d57f7685c80576a31eb8eed57097313b64c731 | # -*- 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... |
bd457f9fd271892cc682959025b3306d5ff15cd022065d38ced7cbd2d2c4f6fa | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Time utilities.
In particular, routines to do basic arithmetic on numbers represented by two
doubles, using the procedure of Shewchuk, 1997, Discrete & Computational
Geometry 18(3):305-363 -- http://www.cs.berkeley.edu/~jrs/pape... |
2816736dbdd07f3efd418f7d80ba4847835dff419fe25fed18055197300fc8a4 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import fnmatch
import time
import re
import datetime
from collections import OrderedDict, defaultdict
import numpy as np
from ..utils.decorators import lazyproperty
from .. import units as u
from .. import _erfa as erfa
from .uti... |
028830a0511fb55440e2e3407093b3359e1650d18190d834f66884532f1f9cba | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ['quantity_input']
import inspect
from ..utils.decorators import wraps
from ..utils.misc import isiterable
from .core import Unit, UnitsError, add_enabled_equivalencies
from .physical import _unit_physical_mapping
def... |
1e73444fbda523ba9e4c79aa383897c5ca458321b5349d6815ab9a33ff081d10 | # -*- 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... |
e688ee26f00bc4f538d3079efb1258d3f65055c9869f8c35619c67c1ddb51c9d | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Core units classes and functions
"""
import inspect
import operator
import textwrap
import warnings
import numpy as np
from ..utils.decorators import lazyproperty
from ..utils.exceptions import AstropyWarning
from ..utils.m... |
09bf3d2decccf7aaa41bb68f61760fb564add6320756c419e1ff008c27447b10 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Miscellaneous utilities for `astropy.units`.
None of the functions in the module are meant for use outside of the
package.
"""
import numbers
import io
import re
from fractions import Fraction
import numpy as np
from numpy import finfo
_float_fi... |
e83939856bb2eef50ab5c832c08a84e93945fcb37abc24233ce6b5e39456db71 | # -*- 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... |
284d1ad1070ed67798ef078a87bfafbc253895231cfc52ab1c9dd5ffdbf4b0c8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions for retrieving solar system
ephemerides from jplephem.
"""
from urllib.parse import urlparse
from collections import OrderedDict
import numpy as np
from .sky_coordinate import SkyCoord
from ..utils.data imp... |
4bb9148c92a7708adb7adc544c5fef716ff4bf91c8788c3f9112f144e20a0bec | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for matching coordinate catalogs.
"""
import numpy as np
from .representation import UnitSphericalRepresentation
from .. import units as u
from . import Angle
__all__ = ['match_coordinates_3d', 'match_coordinates_sky'... |
84481ed28a1739aaad65a55e37d15d49b3e3097af99d38da33b716344d691d0e |
import re
import copy
import warnings
import collections
import numpy as np
from .. import _erfa as erfa
from ..utils.compat.misc import override__dir__
from ..units import Unit, IrreducibleUnit
from .. import units as u
from ..constants import c as speed_of_light
from ..wcs.utils import skycoord_to_pixel, pixel_to_... |
37eccbcb85ebff5cb7cd7537af71fab4ee870b946c6ede9094637d7ca1802258 | """
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... |
9102d5ee4794186964b72991673798f09e3e13fe6fb752b482cedc496c627266 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions for getting a coordinate object
for a named object by querying SESAME and getting the first returned result.
Note that this is intended to be a convenience, and is very simple. If you
need precise coordinates... |
394ac5fcabbf3da18d6baa2aee0a1404327470bfc6cc3f25b475eedc05c7eb90 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains a general framework for defining graphs of transformations
between coordinates, suitable for either spatial coordinates or more generalized
coordinate systems.
The fundamental idea is that each class is a node in the transformati... |
5c07bd3beab4c5a22ba3d0f8773e6f239221bc6ed1dc9456b8d20624915a5725 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the classes and utility functions for distance and
cartesian coordinates.
"""
import numpy as np
from .. import units as u
from .angles import Angle
__all__ = ['Distance']
__doctest_requires__ = {'*': ['scipy.integrate']}
c... |
e07282fa43e126bb6293ec0f82a77334ab0bc26a7a39a6a4cf6df01528a66b4e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions for coordinate-related functionality.
This is generally just wrapping around the object-oriented coordinates
framework, but it is useful for some users who are used to more functional
interfaces.
"""
impor... |
81f101322384575553c385ba3b394a5c242b94181608cde2c847609abefd1261 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Framework and base classes for coordinate frames/"low-level" coordinate
classes.
"""
# Standard library
import abc
import copy
import inspect
from collections import namedtuple, OrderedDict, defaultdict
import warnings
# Depe... |
01538f0ab7d21321d6791e3ebbf72c132dd798c539ffd9d8c5de5f003612e067 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from warnings import warn
import collections
import socket
import json
import urllib.request
import urllib.error
import urllib.parse
import numpy as np
from .. import units as u
from .. import constants as consts
from ..units.quantity import QuantityInfo... |
b0fa1ebf9630f6ac19ec139730118b43632141e7e0797ec6b1a458963e8a03a0 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the fundamental classes used for representing
coordinates in astropy.
"""
from collections import namedtuple
import numpy as np
from . import angle_utilities as util
from .. import units as u
from ..util... |
27fe05aa3638d4828d9573f5f05c6586938e7f62a77a03fd3879f08a484daac8 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Dependencies
import numpy as np
import warnings
# Project
from .. import units as u
from ..utils.exceptions import AstropyDeprecationWarning
from ..utils import OrderedDescriptor, ShapedLikeNDArray
__all__ = ['Attribute', 'Tim... |
e2030a5089f21f25e5561f8de252a9d07d9f2861e65d8e6aacaa9e7b2f4b1597 | """
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... |
8015a3c922db498f0791b2b1ce9eea59ccade3b01428c1c2b1213a638908f783 | """Implements the Astropy TestRunner which is a thin wrapper around py.test."""
import inspect
import os
import glob
import copy
import shlex
import sys
import tempfile
import warnings
import importlib
from collections import OrderedDict
from importlib.util import find_spec
from ..config.paths import set_temp_config,... |
f0f1086d9c657b3a20425c1015bfcc4004a5c6be624d679a6b5cae7d5e51641f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides the tools used to internally run the astropy test suite
from the installed astropy. It makes use of the `pytest` testing framework.
"""
import os
import sys
import types
import pickle
import warnings
import functools
import pytest... |
8b33dbfd4374575efa9cc39967454cbdceefb152c2f2a4d7ec34e2f21868e3dc | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["bls_fast", "bls_slow"]
import numpy as np
from functools import partial
from ._impl import bls_impl
def bls_slow(t, y, ivar, period, duration, oversample, use_likelihood):
"""Compute the periodogram using a brut... |
786a42d2f769c2323559dec03dbcfbeb525e216476ad4a8a9ed116c8fdc3c0c3 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
__all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"]
import numpy as np
from ...tests.helper import assert_quantity_allclose
from ... import units
from ..lombscargle.core import has_units, strip_units
from . import methods
... |
6cb62e0b022aa40041c9bc2318e74df61359c5807cb8e7f536f32d8a7c1308c7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from os.path import join
from distutils.core import Extension
BLS_ROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
ext = Extension(
"astropy.stats.bls._impl",
sources=[
join(BLS_ROOT, "... |
b314a2f2224a9137ae50b49187b31c3000b130f0ec77717a4d2815e75bb898b3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from .. import histogram, scott_bin_width, freedman_bin_width, knuth_bin_width
try:
import scipy # pylint: disable=W0611
except ImportError:
HAS_SCIPY = False
else:
... |
688c8a8e6489dad89f7c4c1af0f147ab445c4d66cd8aa6d972ae0eea10202da8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.random import randn
from numpy.testing import assert_equal, assert_allclose
try:
from scipy import stats # used in testing
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
from ..sig... |
923cfc507f050310dc805031a0ba8b4276cd8db199435c51d739a4172e958479 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.random import randn, normal
from numpy.testing import assert_allclose, assert_array_almost_equal_nulp
from ..biweight import (biweight_location, biweight_scale,
biweight_midvariance, biw... |
bca1bdda9a06543ddbf63083771c0a7a210c361b4cd4ca77d360c1d4abe5a59b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from .... import units
from ....tests.helper import assert_quantity_allclose
from .. import BoxLeastSquares
from ...lombscargle.core import has_units
@py... |
8aa4415739c4d5cb06ecbe38b0e121f4a4ebfb8efa8c3e6c4edebef17633af3f | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import gc
import sys
import copy
from io import StringIO
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ...io import fits
from ...tests.helper import (assert_fo... |
15f6940f3e3449f37fec4e5f5694806aa5a831ec47c2c84b1eef97748aed61de | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from io import StringIO
from collections import OrderedDict
from copy import deepcopy
import numpy as np
import pytest
from ... import units as u
from ... import time
from ... import coordinates
from ... import t... |
4dcc847a5c778b756c68bb1402d8e4a58e800f1156865d73d6d5b1f6384b7889 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from .test_table import SetupData
from ..bst import BST, FastRBT, FastBST
from ..sorted_array import SortedArray
from ..soco import SCEngine, HAS_SOCO
from ..table import QTable, Row, Table
from ... import units as u
from... |
49ead27bbf0466f5e112205d95b5625348336510c963b0e74a75572edc268d49 | import os
import re
from ..scripts import showtable
from ...utils.compat import NUMPY_LT_1_14
ROOT = os.path.abspath(os.path.dirname(__file__))
ASCII_ROOT = os.path.join(ROOT, '..', '..', 'io', 'ascii', 'tests')
FITS_ROOT = os.path.join(ROOT, '..', '..', 'io', 'fits', 'tests')
VOTABLE_ROOT = os.path.join(ROOT, '..', ... |
c7cc580914f7090b81fe047bf1897230111168effc9bbdc63f4efdf7f844968d | # 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, Column, QTable, table_helpers, NdarrayMixin, unique
from ...utils.exceptions import AstropyUserWarning
from ... import time
from ... import units as ... |
4a84b4991bcaa734f6c3bc6009622c615b3d2a2f4e17430d3686032120e23dfe | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test behavior related to masked tables"""
import pytest
import numpy as np
import numpy.ma as ma
from ...table import Column, MaskedColumn, Table
class SetupData:
def setup_method(self, method):
self.a = MaskedColumn(name='a', data=[1,... |
4cacf0bbe0645cdec4cc618cb9c6134a2bb8f6eaf4cc811f3254de01cc5b966e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict
import pytest
import numpy as np
from ...tests.helper import catch_warnings
from ...table import Table, QTable, TableMergeError
from ...table.operations import _get_out_class
from ... import units as u
from ...utils ... |
61d959b1041255487ea4b8d0a9577fec34ff22157b584ae3b939103b37a5bd56 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
import pytest
import numpy as np
from ...tests.helper import assert_follows_unicode_guidelines, catch_warnings
from ... import table
from ... import units as u
class TestColumn():
def test_subclass(self, C... |
af041988aa0fc1cba18c2392296755bcca71f7adf8ea7d1ae6a3d5980bed0a58 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import pytest
import numpy as np
from ... import table
from ...table import Row
from ... import units as u
from .conftest import MaskedTable
def test_masked_row_with_object_col():
"""
Numpy < 1.8 has a bug in masked array that prev... |
c112bdb974fe80e01294ecbc43bbb9ded642877837f281a2ab545224a4341c36 | # -*- 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... |
80f156d9d51feee50afc2618ec90feaa728ec2ce57c15058339604de1cc01671 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_almost_equal_nulp
from ..convolve import convolve_fft
VALID_DTYPES = []
for dtype_array in ['>f4', '<f4', '>f8', '<f8']:
for dtype_kernel in ... |
979cb4f7577f6b509211d04a7c6151170a0aafe40477fbd1d1a117e7e6cd446f | # 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... |
06cd9d704625168c80e340575dd8a32215bbb63dccc0f26b043a5476b461c831 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to test fitting routines
"""
import os.path
import pytest
import numpy as np
from numpy import linalg
from numpy.testing import assert_allclose, assert_almost_equal
from unittest import mock
from . import irafutil
from .. import models
from .... |
91a951acc9b5b5a1ce356fa5ffc43826a1ee6dc3c45d1f067cdcdbe5d5b11207 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from .. import models, InputParameterError
from ...coordinates import Angle
from .. import fitting
from ...tests.helper import catch_warnings
from ...utils.ex... |
9c8d6ebdba51eabdb481fb01c6e1e66c5ecf5970554fb67ca7cd57f29aaf8767 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to evaluating models with quantity parameters
"""
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ..core import Model
from ..models import Gaussian1D, Shift, Scale, Pix2Sky_TAN
from ... import unit... |
a22f3d34d1b76527421c3eee3c33d947aa5bf2f318738da16c7b67e4ac80a1d7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
from copy import deepcopy
import pickle
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from ...utils import minversion
from ..core import Model, ModelDefinitionError
from ..parameters impo... |
bd9048383b5f17d3704be5fd9fc2971d62e9f635a2c0e9fd5134af1d15805ff6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from math import cos, sin
import pytest
import numpy as np
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
from .. import models
from ...wcs import wcs
@pytest.mark.parame... |
04e24dfc2de52d80ac2dccc1f589093c38668795ad587aed2573aaf510273f7b | # Various tests of models not related to evaluation, fitting, or parameters
import pytest
from ...tests.helper import assert_quantity_allclose
from ... import units as u
from astropy.modeling.models import Mapping, Pix2Sky_TAN, Gaussian1D
from astropy.modeling import models
from astropy.modeling.core import _ModelMet... |
bda8cb3d5c3960310d01a8729ad7590c7389313fda2dc39d97a3de9297d2b4a6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.utils.iers package provides access to the tables provided by
the International Earth Rotation and Reference Systems Service, in
particular allowing interpolation of published UT1-UTC values for given
times. These are used in `astropy.time`... |
139147385ac92e3dc8b1de3c4e36db14246c5208f523c589599ed94c12e056bd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Some might be indirectly tested already in ``astropy.io.fits.tests``.
"""
import io
import numpy as np
import pytest
from ..diff import diff_values, report_diff_values, where_not_allclose
from ...table import Table
@pytest.mark.parametrize('a', [np... |
c0d2ce9bf1c9c44d8fc2b4a3923b4f89e92b6dbd46aaff66fa2675513be9061a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import hashlib
import os
import pathlib
import sys
import tempfile
import urllib.request
import urllib.error
import pytest
from ..data import (_get_download_cache_locs, CacheMissingWarning,
get_pkg_data_filena... |
4137fdd76d7fba3a7514a1f3eed03a944ed35d2efebd23bdb673e422f641f4ae | # 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... |
8a8f9c6df9c1580ac1a2b6e9429b93abed2f0ebc8082acdebfaed9616ed6a4a5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a collection of monkey patches and workarounds for bugs in
earlier versions of Numpy.
"""
from ...utils import minversion
__all__ = ['NUMPY_LT_1_14', 'NUMPY_LT_1_14_1', 'NUMPY_LT_1_14_2']
# TODO: It might also be nice to have aliases to thes... |
4301940c14f4599e66ed68bf5564d296b125194bc0db0837747457e8e03372c1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import urllib.request
import pytest
import numpy as np
from ....tests.helper import assert_quantity_allclose, catch_warnings
from .. import iers
from .... import units as u
from ....table import QTable
from ....time import Time, TimeDelta
from... |
fc33fc2ef1369048732a5def912006ba6983d1af3669a1c3ee425d1dabf6fb8d | # configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2014:
# (name) : (email)
# Michael Foord: fuzzyman AT voidspace DOT org DOT uk
# Nicola Larosa: nico AT tekNico DOT net
# Rob Dennis: rdennis AT gmail DOT com
# Eli Courtwright: eli AT courtwright DOT org
#... |
326a9ca9f10cb489aae403b078ae23518d34e3037cf150922f58473e61a962c7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file defines the classes used to represent a 'coordinate', which includes
axes, ticks, tick labels, and grid lines.
"""
import numpy as np
from matplotlib.ticker import Formatter
from matplotlib.transforms import Affine2D, ScaledTranslation
fr... |
944a272cb155f5347ec67cb68345101a3463a13e5e18f92ba30d1e41fcb2e8dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file defines the AngleFormatterLocator class which is a class that
# provides both a method for a formatter and one for a locator, for a given
# label spacing. The advantage of keeping the two connected is that we need to
# make sure that the form... |
a9ab36805f8a8873eebec810f2bdd3fe17efe259b6f977860bc1086a8668e41a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from functools import partial
from collections import defaultdict
import numpy as np
from matplotlib.artist import Artist
from matplotlib.axes import Axes, subplot_class_factory
from matplotlib.transforms import Affine2D, Bbox, Transform
from ...coordi... |
18cf0e0b0738a8dafd773988e9ec19875aeef8445e12892a366b1bcb1e7493f2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from ...coordinates import BaseCoordinateFrame
__all__ = ['select_step_degree', 'select_step_hour', 'select_step_scalar',
'coord_type_from_ctype', 'transform_contour_set_inplace']
def select_ste... |
40e50da81df2cf72838205ddec36cfbcf2c1bf8529cf4ae2b077fc96103d0fcc | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import pytest
try:
import matplotlib.pyplot as plt
except ImportError:
HAS_PLT = False
else:
HAS_PLT = True
from ... import units as u
from ..units import quantity_support
@pytest.mark.skipif('not HAS_PL... |
fdfaea810831d305e63759f36fb13b1141559cf9bd42f40a4030b3a47ca98036 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_almost_equal
from .... import units as u
from ..utils import (select_step_degree, select_step_hour, select_step_scalar,
coord_type_from_ctype)
from ....tests.helper import (assert_quantity_allclose ... |
ee9816f2d066b683426bf50068beeeb8ba8b36452e442584a42e3ce56dfa56fb | # 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 matplotlib import rc_context
from .... import units as u
from ....tests.helper import assert_quantity_allclose
from ....units import UnitsError
from ..formatter_locator ... |
09a0514441375ae817b38fdc7c62fdda647c0bfecb40bee2210359fce6c7f091 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..core import WCSAxes
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent
from ....wcs import WCS
from ....coordinates import FK5
from ....time import Time
from ....tests.image_tests import ignore_matplotlibrc
from .test_im... |
147ec4460ec50ec1a27646a7319c827d9c2322dfb064eb75f7eca21b86de57bf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from unittest.mock import patch
import pytest
import matplotlib.pyplot as plt
from astropy.wcs import WCS
from astropy.io import fits
from ..core import WCSAxes
from .... import units as u
from ....tests.image_tests import ignore_matplotlibrc
... |
9269a6501ce76c419a93537788e9d6cb186bdb947e070353aaf327f0bb3f0276 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, Rectangle
from matplotlib import rc_context
from .... import units as u
from ....io import fits
from ....wcs import WCS
from ....coordinate... |
96ac115746212aea77877f563fb206d476276159cf94023eaf6fae21b1a521d2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the base CCDData class.
import textwrap
import numpy as np
import pytest
from ...io import fits
from ..nduncertainty import StdDevUncertainty, MissingDataAssociationException
from ... import units as u
from ... import log
from .... |
9585260b1877ec05268bb340c976d262e03ad70d6ae1b9e88b1c2f24f8dbfd83 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ...tests.helper import assert_quantity_allclose
from ..utils import (extract_array, add_array, subpixel_indices,
block_reduce, block_replicate,
... |
3b53f407c153880fdc620053797306c79c046cf586057705713d30d629c8fd0b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import pytest
import numpy as np
from ...tests.helper import catch_warnings
from ...utils.exceptions import AstropyUserWarning
from ... import units as u
from ..nddata import NDData
from ..decorators import support_nddata
class CCDData... |
640d05c1cbeddfa74509ab2e8571c69cac9b04e0ee69305c195dcc815e711d75 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from .. import core as erfa
from ...tests.helper import catch_warnings
def test_erfa_wrapper():
"""
Runs a set of tests that mostly make sure vectorization is
working as expected
"""
jd = np.linspace(2456855.5, 24... |
f39e6e66fa54928c698a27994eb6b798de86f0ac2129a42ff875fb36e6ae5853 | # 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... |
a770919d6c73e90178c9b788b0ea2056d6085f11a57808f34743dded04dbb3a2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
import warnings
from datetime import datetime
import pytest
import numpy as np
from numpy.testing import (
assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp,
assert_array_equal)
from ...tests.helper i... |
53a868e65ef27abc94b332511daf313f8354b4c49f4218b01cae0513a19ebec9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import subprocess
import sys
import pytest
def test_wcsapi_extension(tmpdir):
# Test that we can build a simple C extension with the astropy.wcs C API
build_dir = tmpdir.mkdir('build').strpath
install_dir = tmpdir.mkdir('install... |
9e254521084bab2ed1b5fdefc512caf0d639c59b9a32ab7a6039f8c56a20b8e3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import itertools
import numpy as np
import operator
import pytest
from datetime import timedelta
from .. import (Time, TimeDelta, OperandTypeError, ScaleValueError,
TIME_SCALES, STANDARD_TIME_SCALES, TIME_DELTA_SCALES)
f... |
2917e0423dc7307a430925cbc8d3fd70d977b2fc36cfca88ed957569742620b8 | # 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,... |
6d3ce12cc6d2e5266b777d7f9b9ed6fafec4d36bd4aebed20d166e98f285e9ae | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import pytest
import numpy as np
from .. import Time, TimeDelta
from ... import units as u
from ...table import Column
allclose_sec = functools.partial(np.allclose, rtol=2. ** -52,
atol=2. ** -52 * 24 * ... |
0fb1e6448296fac01b85a8e99e674d8e4adfdb1f0c558fe23a94fb6180424541 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
import pytest
import numpy as np
from .. import Time, TimeDelta
class TestTimeComparisons():
"""Test Comparisons of Time and TimeDelta classes"""
def setup(self):
self.t1 = Time(np.arange(49995, 50005), format='mjd', s... |
87b7fc74a9a473ef661dd757d3b51d9f466611a9ff17507531f8c2db03a67c00 | # coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test utilities for `astropy.units`.
"""
import numpy as np
from numpy import finfo
from ...units.utils import sanitize_scale
from ...units.utils import quantity_asanyarray
from ...units.quantity import Quantity
_float_finfo = finfo... |
262a417e55354a6c13990fecb8b3a6dcb028ecb031c4e01b8c02d74e36d75bff | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from ... import units as u # pylint: disable=W0611
@pytest.mark.parametrize("solarx_unit,solary_unit", [
(u.arcsec, u.arcsec),
('angle', 'angle')])
def test_args3(... |
12f0a73f04afb445a85c7dd7f1717dbf21b3a0e873c494fbf07c9e831b295cb4 | # The purpose of these tests are to ensure that calling quantities using
# array methods returns quantities with the right units, or raises exceptions.
import pytest
import numpy as np
from ... import units as u
class TestQuantityArrayCopy:
"""
Test whether arrays are properly copied/used in place
"""
... |
9c9c03b9194351bf5857ba8bb8fe0bd6e6c982d929443dce43588062f33f5605 | """
Test ``allclose`` and ``isclose``.
``allclose`` was ``quantity_allclose`` in ``astropy.tests.helper``.
"""
import numpy as np
import pytest
from ... import units as u
@pytest.mark.parametrize(
('a', 'b'),
[([1, 2], [1, 2]),
([1, 2] * u.m, [100, 200] * u.cm),
(1 * u.s, 1000 * u.ms)])
def test_al... |
4302a2702bac138e753912037042acc441c56bec6c1b34963c77c5810e562ca4 | # coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Quantity class and related.
"""
import copy
import pickle
import decimal
from fractions import Fraction
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_array_equal,
... |
356cef4cba0422d7ad68cb562b512f722fe35a1f732549d2a2480d4b61142990 | # 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... |
5ef4da387f275c281837c2fd2bfea627fe815b06dfe67d6f0b080e68a9fdb6e3 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from ... import units as u
# list of pairs (target unit/physical type, input unit)
x_inputs = [(u.arcsec, u.deg), ('angle', u.deg),
(u.kpc/u.Myr, u.km/u.s), ('speed', u.km/u.s),
([u.arcsec, u... |
131e41fb57bac0e6f60a7bc08fdd3508bd96bf511e205cb11f97ae182c0a4bfb | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Function Units and Quantities."""
from abc import ABCMeta, abstractmethod
import numpy as np
from .. import (Unit, UnitBase, UnitsError, UnitTypeError,
dimensionless_unscaled, Quantity)
__all__ = ['FunctionUni... |
30873f4b7a3d556a6975f81b4d375a192bc35801166c254a2546ae877ecbb425 | # -*- 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... |
b762e36222d3fa5844c841a57ea53bccaf341684946d609ec3fccc9a572e2d03 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions/values used repeatedly in different modules of
the ``builtin_frames`` package.
"""
import warnings
import numpy as np
from ... import units as u
from ... import _erfa as erfa
from ...time import... |
ce752ed44a7fbe64b64a315e81bd350cbe1ecf7c695ce06216c4b084d7a7b338 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains the transformation functions for getting from ICRS/HCRS to CIRS and
anything in between (currently that means GCRS)
"""
import numpy as np
from ... import units as u
from ..baseframe import frame_transform_graph
from ... |
1d7dd67d0762e3be60b9ec1d646995a715ef9ebb758bb3666990720175412845 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains the transformation functions for getting to "observed" systems from CIRS.
Currently that just means AltAz.
"""
import numpy as np
from ... import units as u
from ..baseframe import frame_transform_graph
from ..transfo... |
19403cc64932a45a1611785e7fbd99d60fec6b1ea34b31c38c32a36cdaf41494 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ... import units as u
from ...utils.decorators import format_doc
from .. import representation as r
from ..baseframe import BaseCoordinateFrame, RepresentationMapping, base_doc
from ..attributes import (Att... |
cf08b64008c1c08315c4897b7b8ffa7443a8517921c8f97f82864aa7328ec591 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from ... import units as u
from ...tests.helper import (catch_warnings, pytest,
assert_quantity_allclose as assert_allclose)
from ...utils import OrderedDe... |
7bf58e0ef6a69e62e530f3d58d151e14c5a2f1ed8a3a576a68150bb464058c80 |
import pytest
import numpy as np
from ...time import Time
from ... import units as u
from ...constants import c
from ..builtin_frames import GCRS
from ..earth import EarthLocation
from ..sky_coordinate import SkyCoord
from ..solar_system import (get_body, get_moon, BODY_NAME_TO_KERNEL_SPEC,
... |
2c0de110584393908a3849582afb0e8ff4dd752d24b024e7bd96122ad4028ddf | # -*- 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 ... |
74564e32b9a30291c1b1e7e300c3e29feff211d0c0a8f543c6c7c4de43232550 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from ..builtin_frames import ICRS, Galactic, Galactocentric
from .. import builtin_frames as bf
from ...units import allclose as quantity_allclose
from ..errors import C... |
f1873ccc08f827dd78ab115a4a26fb7280b63e8c447e07522b070976b6b1e043 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ... import units as u
from ..distances import Distance
from ..builtin_frames import (ICRS, FK5, FK4, FK4NoETerms, Galactic,
Supergalactic, Galactocentric, HCRS, G... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.