hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
38ae7662ddbdff9e7820a18503b21979bd2f7e1ac6762043d684ee48500b836d | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module includes files automatically generated from ply (these end in
# _lextab.py and _parsetab.py). To generate these files, remove them from this
# folder, then build astropy and run the tests in-place:
#
# python setup.... |
43ba89e40c6bca095b6c9262a8c302021de543c0d5f4154877f965d2ecc698d9 | # 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... |
bccb41060d5e30af2018e274d8c88dd535af3cae4738f513e520a97ec5b7490a | # 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 warnings
import numpy as np
from astropy import units as u
from astropy.utils.exceptions import AstropyWarning
from .angles import Angle
__al... |
db848bd12384f057f0f31a84ddf75a664065db0e94d70a898f5db254fda86f78 | # 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.
"""
import... |
6c6aa3fe609463788a17065d32806fb850c2a45fb924d655fdc0fe8ff65754a4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
from collections.abc import Sequence
import inspect
import numpy as np
from astropy.units import Unit, IrreducibleUnit
from astropy import units as u
from .baseframe import (BaseCoordinateFrame, frame_transform_graph,
... |
097a79b1ea4c6173bed004bf0312dc10b4d138316038dab61d8ce7c384c186be | # -*- 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... |
e79088e6ae91f8d2382720f94e019f4f719b173159a3c341240a8b4490768a42 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions implementing some of the
algorithms contained within Jean Meeus, 'Astronomical Algorithms',
second edition, 1998, Willmann-Bell.
"""
import numpy as np
from numpy.polynomial.polynomial import polyval
from as... |
0d3720a65408aeef412369981a76046f2f0d312bb73a0f538347214c2909f029 | # 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 astropy import units as u
from astropy import constants as consts
from astropy.units.quantity imp... |
32c2d0b2e9df00977ed66752ec60680f1d3a7e3b325f630e2a4f10316f977b2c | # -*- 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 astropy import units as u
from a... |
7584869baa1610710a2814f9a66ed9aa0c6394c5c84d314abdf3f5e65735564e | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Dependencies
import numpy as np
import warnings
# Project
from astropy import units as u
from astropy.utils.exceptions import AstropyDeprecationWarning
from astropy.utils import OrderedDescriptor, ShapedLikeNDArray
__all__ = [... |
d615d3ce2b12dade0024a426fe9544f7fc9f77e72231b78b36d1fd608e904839 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# Standard library
import re
import textwrap
import warnings
from datetime import datetime
from urllib.request import urlopen
# Third-party
from astropy import time as atime
from astropy.utils.console import color_print, _color_t... |
8885352bc5619f8d46669ee832c51cc7be9fb0458cfe64455d0ae5afd67e2829 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains standard functions for earth orientation, such as
precession and nutation.
This module is (currently) not intended to be part of the public API, but
is instead primarily for internal use in `coordinates`
"""
import numpy as np
... |
35024ac8379c4fb6b98fbbe25ce4807cad9de2401f0b4fa9333af654f69d84ee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import contextlib
import pathlib
import re
import sys
import inspect
import os
from collections import OrderedDict
from operator import itemgetter
import numpy as np
__all__ = ['register_reader', 'register_writer', 'register_identifier',
'... |
888ac6a464458ded64229e052d9efc8a5c9e30c1f76c6962af89e632fc5ae27c | """
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... |
44b37769adb1e0dd10a613f344eb573a8714544ae15d9935a2fd12519c87bbb3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import importlib
import sys
import warnings
import pytest
from .helper import catch_warnings
from astropy import log
from astropy.logger import LoggingError, conf
from astropy.utils.exceptions import AstropyWarning, AstropyUserWarning
# Save original... |
184bd51daf99db34fd34c06a649931a1d7248bd860dad2bccd4d411f1790b1b2 | """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 functools import wraps
from astropy.co... |
0f3c1dcf4f7d3cdac627c8b5dcb464309560ead8a1b50ff952aa32ee964b2791 | # 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... |
8a23eaf7dc84e8c5e6467d2ecdb8761553659a686d12ae3bca3b900821493149 | import matplotlib
from matplotlib import pyplot as plt
from astropy.utils.decorators import wraps
MPL_VERSION = matplotlib.__version__
ROOT = "http://{server}/testing/astropy/2018-10-24T12:38:34.134556/{mpl_version}/"
IMAGE_REFERENCE_DIR = (ROOT.format(server='data.astropy.org', mpl_version=MPL_VERSION[:3] + '.x') +... |
ebed5b2fa26c77c439001699bb88077063f218f052f8aca3deedbf7791713430 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is retained only for backwards compatibility. Affiliated packages
should no longer import ``disable_internet`` from ``astropy.tests``. It is
now available from ``pytest_remotedata``. However, this is not the
recommended mechanism for controlling a... |
5d3b1c4f6aeaba3a915df4a728641b69420bdffb74f774b4abc5c8d969390aa6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from astropy.table import groups, QTable, Table
from astropy.time import Time, TimeDelta
from astropy import units as u
from astropy.units import Quantity
from astropy.timeseries.core import BaseTimeSeries, ... |
973f9d047289fd739784f3f213edf30677538e76bcfa5ba93ef230d77dd026d0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy import units as u
from astropy.utils.exceptions import AstropyUserWarning
from astropy.timeseries.sampled import TimeSeries
from astropy.timeseries.binned import BinnedTimeSeries
__all__ = ['aggregate_dow... |
423e7c7730cf4e9586b1bf2b9444aa85746f642d729c50323799f38dd9c59605 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from types import FunctionType
from contextlib import contextmanager
from functools import wraps
from astropy.table import QTable
__all__ = ['BaseTimeSeries', 'autocheck_required_columns']
COLUMN_RELATED_METHODS = ['add_column',
... |
a8964f8e34e91fa9e0e969725bce04f4790207ce8c853bf0a950f34ee8e4122c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import numpy as np
from astropy.table import groups, Table, QTable
from astropy.time import Time, TimeDelta
from astropy import units as u
from astropy.units import Quantity
from astropy.utils.misc import InheritDocstrings
fro... |
0b76356da658dd45d5ca28757b0800984a3b7a8ed4ca543e6b5d2338c3911ba2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains astronomical and physical constants for use in Astropy or other
places.
A typical use case might be::
>>> from astropy.constants import c, m_e
>>> # ... define the mass of something you want the rest energy of as m ...
>>> m = m_... |
bd0aa72b93a18e9ef0afb415867b17d511f44735033d85da7d51c821be648a0c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
import types
import warnings
import numpy as np
from astropy.units.core import Unit, UnitsError
from astropy.units.quantity import Quantity
from astropy.utils import lazyproperty
from astropy.utils.exceptions import AstropyUserWarning
fr... |
7fea54c7d2e8cdac3eab6643fe9a57b156cd122abc49b7e9924adec572c8e4ee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
from math import acos, sin, cos, sqrt, pi, exp, log, floor
from abc import ABCMeta, abstractmethod
from inspect import signature
import numpy as np
from . import scalar_inv_efuncs
from astropy import constants as const
from astropy import u... |
c765672ded1a41363f1337546713e90ee37396b5bf940652beb624d850e5ab9d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Convenience functions for `astropy.cosmology`.
"""
import warnings
import numpy as np
from .core import CosmologyError
from astropy.units import Quantity
__all__ = ['z_at_value']
__doctest_requires__ = {'*': ['scipy.integrate']}
def z_at_value(fu... |
a07beb2e850d0a0798b98527e160f4f1eb450b1efe1fa16ee58053efedeb1400 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose
try:
import scipy # pylint: disable=W0611
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
from astropy.stats.jackknife import jackknife_r... |
6de3caae112baaa808eebcafbcc0b4bdd4d9287f645ec5973f39645eda8bbca0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats import (histogram, calculate_bin_edges,
scott_bin_width, freedman_bin_width, knuth_bin_width)
try:
import scipy # pylint: disable=W0611
ex... |
dbeef5d058393cbebd6d4808686cfc2c65d22ee3e7d3f51a3dab58d2ed84d44f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
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 astropy import units as u
from astro... |
c78b36e2131d12f784ba3b0548251dfee520ec789b0f46dc35e01321d456f4ef |
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose
from astropy import units as u
try:
import scipy.stats
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
from astropy.stats.circstats import _length, circmean, circvar, circmoment, circcorrcoef
from astr... |
2d56091a9752859180dc8c6bd7810d77ace40c9b81046d56f10c92deafbfa3b5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats import bayesian_blocks, RegularEvents
def test_single_change_point(rseed=0):
rng = np.random.RandomState(rseed)
x = np.concatenate([rng.rand(100),
... |
c9760f23538e1418d2690cdc41fc5b70ec75e8162430feeb9bf62910656da6bd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose
try:
import scipy # pylint: disable=W0611
except ImportError:
HAS_SCIPY = False
else:
HAS_SCIPY = True
try:
import mpmath # pylint: disable=W0611... |
d7b0618f9a7054462a58070e3e5caef2e319dab97ef13d83211d671d841dd924 | # 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_almost_equal_nulp
from astropy.stats.biweight import (biweight_location, biweight_scale,
biweight_midvariance, biweight_midcovariance,
... |
10344bd4057d97369293867de164d6c3aacb7b561986672d9d012a1507098caf | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.table.sorted_array import SortedArray
from astropy.table.table import Table
@pytest.fixture
def array():
# composite index
col0 = np.array([x % 2 for x in range(1, 11)])
col1 = np.array([x for x... |
e1377ac9f9db499cf4e398ab0bd70dc163ed18c3a23a6b3f073e836350e93369 | import numpy as np
from astropy.table import np_utils
def test_common_dtype():
"""
Test that allowed combinations are those expected.
"""
dtype = [(str('int'), int),
(str('uint8'), np.uint8),
(str('float32'), np.float32),
(str('float64'), np.float64),
... |
b5a7c9744ae8826cdf4f7dcf07156ea9214652b94151af4a05358be06f635f6e | # -*- 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, assert_array_equal
from astropy.io import fits
from astropy.... |
0178ab3e600963a02dfdbc402524ae4b0174e6c71495b0547c138e0909d1bab3 | # -*- 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 astropy import units as u
from astropy import time
from astropy import coordinates
from ... |
2d5441e4d91b203ad36c07f714e1737aba7b46f754559bc546e929b96a1f6fd2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from .test_table import SetupData
from astropy.table.bst import BST, FastRBT, FastBST
from astropy.table.sorted_array import SortedArray
from astropy.table.soco import SCEngine, HAS_SOCO
from astropy.table.table import QT... |
7b9d9dffa6aa09f7522e20b0f6fbbd127a2c56df2bc917c3aaaad6ec1260c8a2 | from os.path import abspath, dirname, join
import textwrap
import pytest
from astropy.table.table import Table
from astropy import extern
try:
import bleach # noqa
HAS_BLEACH = True
except ImportError:
HAS_BLEACH = False
try:
import IPython # pylint: disable=W0611
except ImportError:
HAS_IPYTH... |
7f5e44153a9f883f6ce72de98ec312b071f8bdd50fa92bbec28c7ff2cdc8ade9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict, UserDict
from collections.abc import Mapping
import pytest
import numpy as np
from astropy.table import Column, TableColumns
class TestTableColumnsInit():
def test_init(self):
"""Test initialisation wit... |
c913a1455de4331f3ecc444860d838a56c1aeb83b51832301f0c097f4d2f7f8f | import os
import re
from astropy.table.scripts import showtable
from astropy.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.... |
0a5c82cccb99490f701d27b0d9790a5ca4e56aeb83072de0b7689189374a5eea | # 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, Column, QTable, table_helpers, NdarrayMixin, unique
from astropy.utils.exceptions import AstropyUserWarning
from astropy import time
from a... |
d4d63f142f532825360bad552e6875fd96139178e22a882f77198f990c30e37d | # 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 astropy.table import Column, MaskedColumn, Table
class SetupData:
def setup_method(self, method):
self.a = MaskedColumn(name='a', dat... |
2f74d4bd3864fa0e7a681461101a8c450ac371081026b659665b13460520aeab |
import numpy as np
import pickle
from astropy.table import Table, Column, MaskedColumn, QTable
from astropy.table.table_helpers import simple_table
from astropy.units import Quantity, deg
from astropy.time import Time
from astropy.coordinates import SkyCoord
def test_pickle_column(protocol):
c = Column(data=[1,... |
6a7634a703a3b973d1c50c88ea888358057407437994d80367342b30eaa44f71 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
All of the py.test fixtures used by astropy.table are defined here.
The fixtures can not be defined in the modules that use them, because
those modules are imported twice: once with `from __future__ import
unicode_literals` and once without. py.test... |
71fb5b503c0843e380c44eda724bbe91f69f245046413a8903dac9ccdcfc8c21 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict
import pytest
import numpy as np
from astropy.tests.helper import catch_warnings
from astropy.table import Table, QTable, TableMergeError
from astropy.table.operations import _get_out_class
from astropy import units ... |
916a00b2971ec9816c5c939e1cdff7c369ae207f423cf9f1ada6b023ede4b04e | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
import pytest
import numpy as np
from astropy.tests.helper import assert_follows_unicode_guidelines, catch_warnings
from astropy import table
from astropy import units as u
class TestColumn():
def test_sub... |
e472a7bff8e05c2d1a1ee287c300755ac42ff9737237ce2d4de6342f3d3cea22 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import pytest
import numpy as np
from astropy import table
from astropy.table import Row
from astropy import units as u
from .conftest import MaskedTable
def test_masked_row_with_object_col():
"""
Numpy < 1.8 has a bug in masked ar... |
06daac30e58c6d74140d770841992222684cd2fb85c174eff7776542af0e5a89 | # -*- 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... |
858468764a1876e888166ed1fc6b9a911df0b4aa47bcda5770e768eb8804104b | # This Python file uses the following encoding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy import table
from astropy.table import Table, QTable
from astropy.table.table_helpers import simple_table
from astropy import units as u
from astropy.uti... |
ddba00e4e9c286ea532e364ee7f6f92e92f5e5c69357f3010a932fa0ca7a6a46 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.table.bst import BST
def get_tree(TreeType):
b = TreeType([], [])
for val in [5, 2, 9, 3, 4, 1, 6, 10, 8, 7]:
b.add(val)
return b
@pytest.fixture
def tree():
return get_tree(BST)
r'''
5
... |
0ff41ffa80e315f0040eb6ee474e1303866f4626b0f69aa14f901c1cf558efe0 | # 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 astropy.convolution.convolve import convolve_fft, convolve
from astropy.utils.exceptions import AstropyUserWarning
VALID_D... |
df8fd539620b378c48433494a89b47576f33d871906c8689570bf777d93f0e44 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy import convolution as conv
from astropy.tests.helper import pickle_protocol, check_pickling_recovery # noqa
@pytest.mark.parametrize(("name", "args", "kwargs", "xfail"),
[(conv.Cus... |
ab33071e8b73df005ab5bba49014ddb73f27f4cf484d1f93ea9c0b7a9a34e3b2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import Gaussian2DKernel
from astropy.nddata import NDData
def test_basic_nddata():
arr = np.zeros((11, 11))
arr[5,... |
3d4d7b36f956efb25047bfdbc6f785b388ceb4647febdbd7d17ad73ff108f550 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import Gaussian2DKernel, Box2DKernel, Tophat2DKernel
from as... |
618d82552631e6fa7c9f57e88c223e7b09e63f6c3af60900272033eac5405cc2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import pytest
import numpy as np
from numpy.testing import assert_almost_equal, assert_allclose
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import (
Gaussian1DKernel, Gaussian2DKe... |
a9d56a3c4e62479316bedf1b6b618f42e29c24a8264b948b926f30f7dab85239 | # 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
from astropy.convolution.utils import discretize_model
from astropy.modeling.functional_models import (
Gaussian1D, Box1D, MexicanHat1D, Gaussian2D, Box2D, M... |
efb1bb7081942fcc208413fe88cd7166f7eba9f165206f845f31940c2a8ee397 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
import numpy.ma as ma
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import Gaussian2DKernel
from astropy.utils.exceptions import AstropyUserWarning
from numpy.testing im... |
80ca7e5d2f38dbeaad27ba5b5553b4c683ee50c065a387d1a4cbd4627f3abee4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import numpy as np
import pytest
from astropy.convolution.convolve import convolve, convolve_fft, convolve_models
from astropy.modeling import models, fitting
from astropy.utils.misc import NumpyRNGContext
from numpy.testing import assert_all... |
37fe265a617b78473dbeb5531df305b116b0379fc79ad1401f2fc239f6042c5e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import timeit
import numpy as np # pylint: disable=W0611
# largest image size to use for "linear" and fft convolutions
max_exponents_linear = {1: 15, 2: 7, 3: 5}
max_exponents_fft = {1: 15, 2: 10, 3: 7}
if __name__ == "__main__":
for ndims in [1,... |
0956f7da0f21f84dc12b0ae93c5945593963d95ea2619a83a987348930eb5821 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import subprocess
import pytest
from astropy.tests.helper import catch_warnings
from astropy.utils.data import get_pkg_data_filename
from astropy.config import configuration
from astropy.config import paths... |
9671822ba805b790c35c9982a1e0dbe68f1b4d9f91e6b399267959190ae35931 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
import numpy as np
from astropy import units as u
from astropy.uncertainty.core import Distribution
from astropy.uncertainty import distributions as ds
from astropy.utils import NumpyRNGCo... |
5039f90ce3e00c0361e6bc217036839c001c2f2aff0351f8b5bc5261f1305926 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test sky projections defined in WCS Paper II"""
import os
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
from astropy.modeling import projections
from astropy.modeling.parameters import InputParameter... |
e1ad408727495c6e2a700484f46b9ec5972d02a1c1e7b8a9c34d22930dae2b5c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides functions to help with testing against iraf tasks
"""
from astropy.logger import log
import numpy as np
iraf_models_map = {1.: 'Chebyshev',
2.: 'Legendre',
3.: 'Spline3',
... |
be0d5fc5c7209932d4901314b7fc6be695ab30b70181a15740714c8c7e398015 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for blackbody model and functions."""
import pytest
import numpy as np
from astropy.modeling.blackbody import BlackBody1D, blackbody_nu, blackbody_lambda, FNU
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.tests.helper import... |
ca251c3c5844911398e043d86415ae8c59b6ab3353204bc5acf3e41fc2ca1403 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Here are all the test parameters and values for the each
`~astropy.modeling.FittableModel` defined. There is a dictionary for 1D and a
dictionary for 2D models.
Explanation of keywords of the dictionaries:
"parameters" : list or dict
Model parame... |
55c52f98ab6fe185e95b28740823c4c63e6f5b3849850efb7c619e1b84bbe480 | # 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 astropy.modeling import... |
b080b797090c3a296540dadfe2a0ae42c8d1733a3e89f9aa4c3e2d5b7eb1272d | # 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 astropy.modeling import models, InputParameterError
from astropy.coordinates import Angle
from astropy.modeling import fitting
from astropy.tests.helper ... |
1c0b1fa30d091f9772ee2cda9690d0211b55f1599e334efee372d5c9ecaf5de4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
import numpy as np
from astropy.modeling.utils import ExpressionTree as ET, ellipse_extent
from astropy.modeling.models import Ellipse2D
def test_traverse_postorder_duplicate_subtrees():
"""
Regression test for a bug in `Expre... |
8f3b0647fa5abb4cc25750f2e84a88c00f2b8484f55335cbb7fd7b3f56063f9e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for model evaluation.
Compare the results of some models with other programs.
"""
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_equal
from .example_models import models_1D, models_2D
from astropy.modeling ... |
c3dacaf22e5b4ad5f010f981da919a2235ae7bb4f4b8b464b4fdeb1bc002a465 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests model set evaluation for some common use cases.
"""
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.modeling.models import Polynomial1D, Polynomial2D
from astropy.modeling.fitting import Linear... |
2401097dc23a91917ac8a9c54e0ea06767c9a239c67cbeb7463b6418f30ca041 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.wcs import wcs
from astropy.modeling import models
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
@pytest.mark.parametriz... |
0afc331ab97f0363031f0e6b3070d11759244bca8326cc429a1950a315fe11c2 | # 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 astropy.modeling.core import Model
from astropy.modeling.models import Gaussian1D, Shift, Scale, Pi... |
570f7d79f225883b8b848d61ca3bd801c9b0220bdcf6412898a4f172a6b53161 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to fitting models with quantity parameters
"""
import numpy as np
import pytest
from astropy.modeling import models
from astropy import units as u
from astropy.units import UnitsError
from astropy.tests.helper import assert_quantit... |
c66e6d3c24da616ab477805cc2d1c0112123e3c1d1e5afeb76bc2d9018894ede | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests fitting and model evaluation with various inputs
"""
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.modeling import models
from astropy.modeling import fitting
from astropy.modeling.core impo... |
cb37b625ea81347b75cc45fd30de96f2aa8cdef948117b12893e7182862c2a4e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to using quantities/units on parameters of models.
"""
import numpy as np
import pytest
from astropy.modeling.core import Model, Fittable1DModel, InputParameterError
from astropy.modeling.parameters import Parameter, ParameterDefi... |
1fea0bace251ba13ee32f4cb3c119de35ab78c4f24c8dab05c2d625976811bad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for polynomial models."""
import os
from itertools import product
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.modeling import fitting
from astropy import wcs
from astropy.io import fits
from astrop... |
8359d493a9b5945a419a249d640cfa9a15d9e502c0c49e6c98ef01e09e19f0e1 | # 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 astropy.utils import minversion
from astropy.modeling.core import Model, ModelDefinitionError
fr... |
77e027cbad87c074079b07d74a669178eeb25cc86423e0a77d321a551888bc58 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from inspect import signature
from numpy.testing import assert_allclose
from astropy.modeling.core import Model, custom_model
from astropy.modeling.parameters import Parameter
from astropy.modeling import models
class N... |
b784d83813471446c044a5292ef49afce573dfe89c0e67d27832abbe8d33c6e2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test separability of models.
"""
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.modeling import models
from astropy.modeling.models import Mapping
from astropy.modeling.separable import (_coord_matrix, is_sepa... |
9fd76ca6be10b43f1ea77183035fae07f57347e60e600c4a73515f052d1d869b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import contextlib
import warnings
from astropy.tests.helper import catch_warnings
@contextlib.contextmanager
def ignore_non_integer_warning():
# We need to ignore this warning on Scipy < 0.14.
# When our minimum version ... |
8a844f9f18d275c6c4fcd9beaafdc2c509459007cfd77bdf2dfbc5de14827ae6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests models.parameters
"""
import itertools
import pytest
import numpy as np
from numpy.testing import (assert_allclose, assert_equal, assert_array_equal,
assert_almost_equal)
from . import irafutil
from astropy.modeling ... |
038f4c343deb1f6a9f73363151c98fa6d6cf69284f3ae35c7cd6decbf76a0f40 | # 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 astropy.modeling import models
from astropy.wcs import wcs
... |
0c3a5a58f750400bbe4e2cd40fa40367b0537ba2135760dbe91f5a99c55f5c03 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import types
import pytest
import numpy as np
from numpy.testing import assert_allclose
from numpy.random import RandomState
from astropy.modeling.core import Fittable1DModel
from astropy.modeling.parameters import Parameter
from astropy.modeling import... |
0e7e2c92d06cdb2b82f15feabed31dc024c19a95258cab17744a8adf50454f65 | # 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 astropy.modeling.fitting import LevMarLSQFitter
from astropy.modeling.models import Shift, Rotation2D, Gaussian1D, Identity, Mapping
from astropy.utils im... |
b78a6cb95b15b24a5e2a80abeb55904be34ede4248279071de2d0e52707f82bb | # Various tests of models not related to evaluation, fitting, or parameters
import pytest
from astropy.tests.helper import assert_quantity_allclose
from astropy import units as u
from astropy.modeling.models import Mapping, Pix2Sky_TAN, Gaussian1D
from astropy.modeling import models
from astropy.modeling.core import ... |
3cb3ebba204ec06a2c387b2264fde63617fe3e6700d1eafefb5217e2a147ab5c | from collections import OrderedDict
import pytest
import numpy as np
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from astropy.modeling.functional_models import (Gaussian1D,
Sersic1D, Sine1D, Linear1D,
Loren... |
7c56bb503f27d15487c751545e127f6a63648801159f3488c55a0403f39b5faf | """
Test the web profile using Python classes that have been adapted to act like a
web client. We can only put a single test here because only one hub can run
with the web profile active, and the user might want to run the tests in
parallel.
"""
import os
import threading
import tempfile
from urllib.request import Req... |
0fea967d94aeba28dc27f2e73b82d258d7c5236e4108dc7d3523fc0f25ad2ae5 | import os
import time
import pickle
import random
import string
from astropy.samp import SAMP_STATUS_OK
TEST_REPLY = {"samp.status": SAMP_STATUS_OK,
"samp.result": {"txt": "test"}}
def write_output(mtype, private_key, sender_id, params):
filename = params['verification_file']
f = open(filename... |
03b052f4c0f682df1472d603b65c9ecc0d410f82f3bcb7e0399a0139234dc045 | import time
import threading
import xmlrpc.client as xmlrpc
from astropy.samp.hub import WebProfileDialog
from astropy.samp.hub_proxy import SAMPHubProxy
from astropy.samp.client import SAMPClient
from astropy.samp.integrated_client import SAMPIntegratedClient
from astropy.samp.utils import ServerProxyPool
from astrop... |
3d3f8fd67043ee833b644105942533d7133bcba8dfedb545c14e88ec7f8deaf1 | # 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`... |
298425e6c7ecb848548716cf97d2cebde19128f8a87f4a2ca5fbae62a2a2d049 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains a class that makes it simple to stream out well-formed and
nicely-indented XML.
"""
# STDLIB
import contextlib
import textwrap
try:
from . import _iterparser
except ImportError:
def xml_escape_cdata(s):
"""
Escapes &,... |
aec8c8ff472704fb8e279af444b4fe8ea81a50af593c83680d441437ff55c72a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from distutils.core import Extension
from os.path import join
import sys
from astropy_helpers import setup_helpers
def get_external_libraries():
return ['expat']
def get_extensions(build_type='release'):
XML_DIR = 'astropy/utils/xml/src'
... |
162c64d21ce98ca1607ce22f2427c240ee7d69f1c67c247ba93b89c8c0269969 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module includes a fast iterator-based XML parser.
"""
# STDLIB
import contextlib
import io
import sys
# ASTROPY
from astropy.utils import data
__all__ = ['get_xml_iterator', 'get_xml_encoding', 'xml_readlines']
@contextlib.contextmanager
def... |
05cbf68a06ac5f7c91bf1d0691aeb005ae2c7faaa944c27d42a1f6252895941e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions to do XML schema and DTD validation. At the moment, this
makes a subprocess call to xmllint. This could use a Python-based
library at some point in the future, if something appropriate could be
found.
"""
import os
import subprocess
de... |
98bedc1f2dfc90b6609723f665313136da223d39d0f5229a5f9c50f714479fed | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import json
import os
from datetime import datetime
import locale
import pytest
import numpy as np
from astropy.utils import data, misc
def test_isiterable():
assert misc.isiterable(2) is False
assert misc.isiterable([2]) is True
assert mi... |
c0d105ce4debff7f04e4cc207235785db9eabd191d3d982971de5ac09494ae98 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test `astropy.utils.timer`.
.. note::
The tests only compare rough estimates as
performance is machine-dependent.
"""
# STDLIB
import time
# THIRD-PARTY
import pytest
import numpy as np
# LOCAL
from astropy.utils.exceptions import AstropyU... |
45b660fd93764989ee0d5896d5a458ddbc1fadcce07a9f9ed1214ca9cce97b8d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import pytest
from astropy.utils.xml import check, unescaper, writer
try:
import bleach # noqa
HAS_BLEACH = True
except ImportError:
HAS_BLEACH = False
def test_writer():
fh = io.StringIO()
w = writer.XMLWriter(fh)
... |
d953ebfd939a56257c66c7c339865ad54de9061d4cc96184f36e4652d0d7222e | # 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 astropy.utils.diff import diff_values, report_diff_values, where_not_allclose
from astropy.table import Table
@pytest.mark.par... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.