hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
37a7f66818ba204421179375452a66cf407ae32a0f470acfad52151de98cfbca | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file was automatically generated from ply. To re-generate this file,
# remove it from this folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
# pytest astropy/coordinates
#
# Y... |
239ed5d4dda1b28507dc79048a61e525d61e98749eaa57f4b2ed76e9fea61fcf | # 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
... |
a968b26d0a0e06991f74d359255af0ac35715ce2d2a152ce4cbe0de5fd4c0c5c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains modules and packages for interpreting data storage
formats used by and in astropy.
"""
|
6bd1e09b154a60e342c88e4d9fd6c5f48ff690cc8d1aaf410d8b736d0a56bb30 | """Implements the wrapper for the Astropy test runner.
This is for backward-compatibility for other downstream packages and can be removed
once astropy-helpers has reached end-of-life.
"""
import os
import stat
import shutil
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from setu... |
2b59e0119fb8f8adfd927a7c41ebb087bd83c2b16094cf91dbbf31f12ad290b7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains utilities to run the astropy test suite, tools
for writing tests, and general tests that are not associated with a
particular package.
"""
|
91be0b50ef01b2b1f50df86f57c9cb3a94ed090b06e95754bc51d5c8ffeb939d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import importlib
import sys
import warnings
import logging
import locale
import pytest
from astropy import log
from astropy.logger import LoggingError, conf
from astropy.utils.exceptions import AstropyWarning, AstropyUserWarning
# Save original values ... |
37a904785c61f3ef9f4983912e9f8ddb4a69743c4e2554bd6dd88b6d8eddeb8e | """Implements the Astropy TestRunner which is a thin wrapper around pytest."""
import inspect
import os
import glob
import copy
import shlex
import sys
import tempfile
import warnings
from collections import OrderedDict
from importlib.util import find_spec
from functools import wraps
from astropy.config.paths import ... |
47e68b1aa399c1e3e480e17b71dc4fe632d7b7f5080d651467debbdaa5ead040 | # 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 pickle
import warnings
import functools
import pytest
from astr... |
61ac8618a15f3dc44e8d41f6b4501cb542a1afe23047c365409c8eac538b1b9d | try:
import matplotlib
from matplotlib import pyplot as plt # noqa
except ImportError:
MPL_VERSION = ''
ROOT = ''
IMAGE_REFERENCE_DIR = ''
else:
MPL_VERSION = matplotlib.__version__
# The developer versions of the form 3.2.x+... contain changes that will only
# be included in the 3.3.x... |
cc9a8f29c81275c0cdced6a240e39ba56d3721558de33f28ec25178f86a30e0f | # 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, UnitsError
from astropy.utils.decorators import depr... |
bf843887ca0c193e67ffdabd2f19f4e5c4d085ecdcd0884fc82c3d6e3af2caf9 | # 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.time import Time, TimeDelta
from astropy.utils.exceptions import AstropyUserWarning
from astropy.timeseries.sampled import TimeSeries
from astropy.timeseries.binned import Bi... |
13de87d77c2a63ef0c771caad73a501c24e16d083e7d0290b6991dce1634b291 | # 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',
... |
12bafefa90c79474248dd9aa46b3f10a322499a8d87d943825115af1595d43c6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for work with time series.
"""
from astropy.timeseries.core import * # noqa
from astropy.timeseries.sampled import * # noqa
from astropy.timeseries.binned import * # noqa
from astropy.timeseries impor... |
a01017aa601ac8d7d297ab2b3f1618ba9d01c07cf322db3fdf9e6ddeccaaa711 | # 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.timeseries.core import BaseTimeSeries, ... |
2b052e76622356a4fb1d7bb817a70f3191e445a7cb445f94d90ea01556079572 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import numpy as np
from .constant import Constant
# ASTRONOMICAL CONSTANTS
class IAU2012(Constant):
defau... |
962480a7a67d3204612f2c04dc495749b714fd32724ba9c8beea205bcbff4961 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import numpy as np
from .constant import Constant, EMConstant
# PHYSICAL CONSTANTS
class CODATA2014(Constant):... |
089651864317bba25e07875b72e9a461233662cb29a69224b2a40a6609639bb8 | # 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_... |
fd79b52eba117c7394745dc90764d9b527072abba1fd56f786b1d32527a232af | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import numpy as np
from .constant import Constant, EMConstant
# PHYSICAL CONSTANTS
class CODATA2010(Constant):... |
b0178bb8388a3015d0974ce61b2fe5bf201adea6495584ade50f10ab30540c78 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants for Astropy v1.3 and earlier.
See :mod:`astropy.constants` for a complete listing of constants
defined in Astropy.
"""
from astropy.utils import find_current_module
from . import codata2010, iau2012
from . import uti... |
b039f90e668a1e39fdf5c494c7274c2beefaa71499ee7dd66f7d5b051d0a1a6c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import numpy as np
from .config import codata
from .constant import Constant
# ASTRONOMICAL CONSTANTS
class I... |
9a3dea90e2172c28bbc5a2eb2695408d7594a87f2a3dea949b2c21eda17b3926 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Configures the codata and iaudata used, possibly using user configuration.
"""
# Note: doing this in __init__ causes import problems with units,
# as si.py and cgs.py have to import the result.
import importlib
import astropy
phys_version = astropy.p... |
88f385a7cb4c00df5cd822b50da19f8f261818590511e060e06009f3e48221a5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants for Astropy v2.0.
See :mod:`astropy.constants` for a complete listing of constants defined
in Astropy.
"""
import warnings
from astropy.utils import find_current_module
from . import codata2014, iau2015
from . impor... |
185b5aa991e83f454530c0e08b0d3349a67b22157b508e9098d1d0d3bd834749 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Utility functions for ``constants`` sub-package."""
import itertools
__all__ = []
def _get_c(codata, iaudata, module, not_in_module_only=True):
"""
Generator to return a Constant object.
Parameters
----------
codata, iaudata : ob... |
72b4dd0198b2a91b998465ebd1f7f7dd57e2724af501ee3fe91131f0fab930ac | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in cgs units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import itertools
from .config import codata, iaudata
from .constant import Constant
for _nm, _c in itertools.ch... |
9be6c25ddb4036b8127c2a045df1fb9f648f769af80e0c0b357549445ca6d986 | # 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
... |
bcbc46772575b503a3faf8cbff3d5bbcff77ca65a48021cb1c36552ae5ab0373 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants for Astropy v4.0.
See :mod:`astropy.constants` for a complete listing of constants defined
in Astropy.
"""
import warnings
from astropy.utils import find_current_module
from . import codata2018, iau2015
from . impor... |
976ff12fa11e050043c7801f3a4cb51982819dfaa6e5ba50cab1302bf7277924 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import itertools
from .config import codata, iaudata
from .constant import Constant
for _nm, _c in itertools.cha... |
00c41d4824c990c4eb4e3ce78c573bb001c0835bddee0dfd3c55fbcbe31883c3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astronomical and physics constants in SI units. See :mod:`astropy.constants`
for a complete listing of constants defined in Astropy.
"""
import math
from .constant import Constant, EMConstant
# PHYSICAL CONSTANTS
# https://en.wikipedia.org/wiki/2019... |
e49231749ad552e062197ebbba862da1c031a01008ec76d5c0a6af792afaf50b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module contains dictionaries with sets of parameters for a
given cosmology.
Each cosmology has the following parameters defined:
========== =====================================
Oc0 Omega cold dark matter at z=0
Ob0 O... |
c6905a0e821ad74b5c19dfa4118df045377ec4aa77fb30132794e045e895edbe | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import warnings
from astropy.cosmology import units as cu
from astropy.io import registry as io_registry
from astropy.units import add_enabled_units
from astropy.utils.exceptions import AstropyUserWarning
__all__ = ["CosmologyRead", "Cosmolo... |
af167934d42107f854842b239855a5ae9899fd37e66c52fbcfb05dca24a053ff | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
import functools
import inspect
from types import FunctionType, MappingProxyType
import numpy as np
import astropy.units as u
from astropy.io.registry import UnifiedReadWriteMethod
from astropy.utils.decorators import classproperty
from astro... |
74bcdc4e801627cb6d98839998bf856bb6c6b1a556cdab7315493169e132d998 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" astropy.cosmology contains classes and functions for cosmological
distance measures and other cosmology-related calculations.
See the `Astropy documentation
<https://docs.astropy.org/en/latest/cosmology/index.html>`_ for more
detailed usage examples a... |
359ff16a32d960f853bcbe1012d4994b8646a21467e97ff1d3d089707f5331a1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import astropy.units as u
from astropy.utils.decorators import classproperty
__all__ = ["Parameter"]
class Parameter:
r"""Cosmological parameter (descriptor).
Should only be used with a :class:`~astropy.cosmology.Cosmology` subclass.
Para... |
a563c44ea373606c2aa93c54655c2c69444c59dea5b4678d57d02e363f4b431e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from abc import abstractmethod
from math import acos, cos, exp, floor, inf, log, pi, sin, sqrt
from numbers import Number
import numpy as np
import astropy.constants as const
import astropy.units as u
from astropy.utils.compat.optional_d... |
6c5f2c742ebd1b3237e201af83be58da5518b507dd607abe6ae185575e72ad98 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Convenience functions for `astropy.cosmology`.
"""
import warnings
import numpy as np
from astropy.units import Quantity
from astropy.utils.exceptions import AstropyUserWarning
from . import units as cu
from .core import CosmologyError
__all__ = [... |
0cf697f9e13d46cb19ec2fcefcaeb5fa9783a44383a4a3f6f84010f6b5a099dd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import functools
from math import inf
from numbers import Number
import numpy as np
from astropy.units import Quantity
from astropy.utils import isiterable
from astropy.utils.decorators import deprecated
from . import units as cu
__all__ = [] # nothi... |
725c8903b83c94a766cea2c7f666157b3547c8eac417ec10d93a757730166298 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Cosmological units and equivalencies.
""" # (newline needed for unit summary)
import astropy.units as u
from astropy.units.utils import generate_unit_summary as _generate_unit_summary
__all__ = ["littleh", "redshift",
... |
5a6310e2fe97f6e9a446fe4f52ca0b538260e9689927ed6104d3a303a1406145 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import pathlib
import sys
# LOCAL
from astropy.utils.data import get_pkg_data_path
from astropy.utils.decorators import deprecated
from astropy.utils.state import ScienceState
from .core import Cosmology
_COSMOLOGY_DATA_DIR = pathlib.Path(get... |
514102f67ad180e9699b39d6f8add53c60d3ee4554f60ab206496631196ceafd | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# The BoxLeastSquares periodogram functionality has been moved to
# astropy.timeseries.periodograms.bls. The purpose of this file is to provide backward-
# compatibility during a transition phase. We can't emit a deprecation warning
# simply on import of ... |
73a59d0ed5fc2aa8d418f9e75ac2bd38c165e4667d13b691f758fbf1bb5fe407 | # 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
from astropy.stats.jackknife import jackknife_resampling, jackknife_stats
from astropy.utils.compat.optional_deps import HAS_SCIPY # noqa
def test_jackknife_resam... |
fcb5764e3a3d85257b1b137fe077eaa0f6ecf350306a43f4add1ea95952a69ac | # 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)
from astropy.utils.compat.optional_deps... |
cfbe2601a1de4d1c658b9073f5d00fbe2f2def10b56698a76e024da2735edfbb | # 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
from astropy import units as u
from astropy.stats import mad_std
from astropy.stats.sigma_clipping import sigma_clip, SigmaClip, sigma_clipped_stats
from astropy.uti... |
41213e9cd2f22587c3bf27b492db0abc3895a3a558f1270cca8754005db02dae |
from numpy.testing import assert_allclose
from astropy.stats.info_theory import bayesian_info_criterion, bayesian_info_criterion_lsq
from astropy.stats.info_theory import akaike_info_criterion, akaike_info_criterion_lsq
def test_bayesian_info_criterion():
# This test is from an example presented in Ref [1]
... |
8b0b2c4401fc4fae30ee0fd4cf71caf5c25592ac5957fbd100472aac62f400c0 |
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose
from astropy import units as u
from astropy.utils.compat.optional_deps import HAS_SCIPY # noqa
from astropy.stats.circstats import _length, circmean, circvar, circmoment, circcorrcoef
from astropy.stats.circstats import raylei... |
56d1cb02a9ae285bbf1fecd1d170cfed6deaf54e5b5f9054681de948222968ee |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from astropy.stats.spatial import RipleysKEstimator
from astropy.utils.misc import NumpyRNGContext
a = np.array([[1, 4], [2, 5], [3, 6]])
b = np.array([[-1, 1], [-2, 2], [-3, 3]])
@pytest.mark.parametrize("points, x_min, x_max", [(a, 0, 1... |
9937fbc01eaaca89a3907899100c4a19fb12ce6fb50217087aef94400afb12a5 | # 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.default_rng(rseed)
x = np.concatenate([rng.random(100),
... |
5dfeb4887e8fd6d64bd4edba9f58a07fa6695d0c40528cac55d1ffce67e11365 | # 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
from astropy.utils.compat.optional_deps import HAS_SCIPY, HAS_MPMATH # noqa
from astropy.stats import funcs
from astropy import units as u
from astropy.utils.misc... |
5684871d4fce7dc0b09f7528cae83dfbd156218b2532e1d5760f78caba70490a | # 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,
assert_equal)
from astropy.stats.biweight import (biweight_location, biweight_scale,
... |
c14351a9fc91175cdad57b0701412290cf8816e390eedbd74eddffb961eb9ed8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# The LombScargle periodogram functionality has been moved to
# astropy.timeseries.periodograms.bls. The purpose of this file is to provide backward-
# compatibility during a transition phase. We can't emit a deprecation warning
# simply on import of this... |
1c43909c8e64e3e580cd93fb86e01dc25122c2132b3298a50e094a45cd591803 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``showtable`` is a command-line script based on ``astropy.io`` and
``astropy.table`` for printing ASCII, FITS, HDF5 or VOTable files(s) to the
standard output.
Example usage of ``showtable``:
1. FITS::
$ showtable astropy/io/fits/tests/data/tabl... |
6bc2342181e44242e550b724cafd64e2d3deb626ed6b9dbee2f6317e99718065 | # This module handles the definition of mixin 'handlers' which are functions
# that given an arbitrary object (e.g. a dask array) will return an object that
# can be used as a mixin column. This is useful because it means that users can
# then add objects to tables that are not formally mixin columns and where
# adding... |
5f95512de18bcf2239352ddf7760a24d8b4cd125d0e4d44b0db51168b278a497 | import dask.array as da
from astropy.utils.data_info import ParentDtypeInfo
__all__ = ['as_dask_column']
class DaskInfo(ParentDtypeInfo):
@staticmethod
def default_format(val):
return f'{val.compute()}'
class DaskColumn(da.Array):
info = DaskInfo()
def copy(self):
# Array hard-co... |
969d0da04193d9c32c29b29bcde93729bb6ee698205c8ae647abd95efe3168de | # 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... |
28e50191a49c18434d0a66e36dde536586378c04b8c1babf11bb5b62eedd4cd2 | import numpy as np
from astropy.table import np_utils
def test_common_dtype():
"""
Test that allowed combinations are those expected.
"""
dtype = [('int', int),
('uint8', np.uint8),
('float32', np.float32),
('float64', np.float64),
('str', 'S2'),
... |
9ce51b0e86f9483dff26196b5eb35a2e50541e4a000c986dffabaec88036df9b | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.utils.tests.test_metadata import MetaBaseTest
import gc
import sys
import copy
from io import StringIO
from collections import OrderedDict
import pickle
import pytest
import numpy as np
from numpy.testing import asser... |
c7018b8f6ebbb185af110b66a309586130a827030fdccc4c1aa1d35eb7db4250 | # -*- 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 ... |
fbc03c98dcf79a81fa53868c189dadc6cd5ea3bb9dad33b652d8d352f7f231a1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
import numpy as np
from .test_table import SetupData
from astropy.table.bst import BST
from astropy.table.sorted_array import SortedArray
from astropy.table.soco import SCEngine
from astropy.table import QTable, Row, Table,... |
3994814cf4403b97d67b83c4f1dcba5f76bbb146d24d083888667175570dbc17 | from os.path import abspath, dirname, join
import textwrap
import pytest
from astropy.coordinates import SkyCoord
from astropy.time import Time
from astropy.table.table import Table
from astropy import extern
from astropy.utils.compat.optional_deps import HAS_BLEACH, HAS_IPYTHON # noqa
from astropy.utils.misc impo... |
748aaddb9faff2cba63c7923bc334e9bbdbcc54291357f31b42122baa1a627c6 | # 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, Table, MaskedColumn
import astropy.units as u
class DictLike(Mapping):
"""A minimal ... |
24fc704dcc5c0bdf8c554bf570c146738a16355a93055cfcb4ef6792a168d9aa | import os
import re
import pytest
from astropy.table.scripts import showtable
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, '..', '..', 'io', 'vot... |
19f176ef230bdee9bff7bba6da6cd7536557ae2f232d4eefb7ac2425568849d4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from astropy.table import Table, Column, QTable, table_helpers, NdarrayMixin, unique
from astropy.utils.compat import NUMPY_LT_1_22, NUMPY_LT_1_22_1
from astropy.utils.exceptions import AstropyUserWarning
from astropy imp... |
e7f41e4eb64df325591e837ca818667c5d2f57bd5457dacbdcd30dda5c842840 | # 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, QTable
from astropy.table.column import BaseColumn
from astropy.time import Time
from astropy.utils... |
ea1dbfd0aacf254431687a9b0e63c34bb15e975dde27fb81d74b3b68a8951d32 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" Verify item access API in:
https://github.com/astropy/astropy/wiki/Table-item-access-definition
"""
import pytest
import numpy as np
@pytest.mark.usefixtures('table_data')
class BaseTestItems():
pass
@pytest.mark.usefixtures('table_data')
cl... |
e77e257a06b33ea0318ffee9ec485d32697ab8d805cb7941e4ac2a727cfcff17 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy import table
from astropy.table import pprint
class MyRow(table.Row):
def __str__(self):
return str(self.as_void())
class MyColumn(table.Column):
pass
class MyMaskedColumn(table.MaskedColumn):
... |
c573ce0b4db783370fcec29f2bcbf5b6190a5496ab2edabe2291dacf7f1e05b6 |
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,... |
9453be608bcd0db8b03419ed0e7119dfcfe6a4709826aa819ed46b7515494438 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
All of the pytest fixtures used by astropy.table are defined here.
`conftest.py` is a "special" module name for pytest that is always
imported, but is not looked in for tests, and it is the recommended
place to put fixtures that are shared between mod... |
1515117c5f72525c2d39136332b308f73f01e828f9cfb0d13bc3dddc93af518a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.table.table_helpers import ArrayWrapper
from astropy.coordinates.earth import EarthLocation
from astropy.units.quantity import Quantity
from collections import OrderedDict
from contextlib import nullcontext
import pytest
import numpy as np
... |
eded84ad1d8fc05cf89aa0e4735b1653ce3d29f246611ce89713b5c83bb6b331 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.utils.tests.test_metadata import MetaBaseTest
import operator
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from astropy.tests.helper import assert_follows_unicode_guidelines
from astr... |
f5fea9038e891581ed8b1ed56bdc6e546bf44a5a3489de4bdb74511d9febda15 | # 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 arr... |
ce6ab8a6ad50fe969cd4aa30362534fbaf5568b7bab4cf3e8f22016cc9659265 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import pickle
from io import StringIO
import pytest
import numpy as np
from astropy.table.serialize import represent_mixins_as_columns
from astropy.utils.data_info import ParentDtypeInfo
from astropy.table.table_help... |
1de438ce74d6d9d94e14cf4dd8bcc979544ea5c60581b871aef565167cddbc65 | # 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 io import StringIO
from astropy import table
from astropy.io import ascii
from astropy.table import Table, QTable
from astropy.table.table_helpers import simple_... |
78a7645fdca679f77212e4057ec6c029b9b6017d05e9498790cce9cbeaa386f6 | # 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
... |
1dda95479473a5dd293203e776da4ec36c5897559bd7552c0b29447c1616d29d | from copy import copy
from unittest.mock import MagicMock
import pytest
import numpy as np
from numpy.testing import assert_equal
from astropy.table import Table
from astropy.table.table_helpers import ArrayWrapper
from astropy.table.mixins.registry import (_handlers, register_mixin_handler,
... |
188cc03c7713dce758d1fd1152392baaf7b16fcab78833b8cfb7fe577f9ee9ef | import pytest
import numpy as np
from numpy.testing import assert_equal
from astropy.table import Table
da = pytest.importorskip('dask.array')
class TestDaskHandler:
def setup_method(self, method):
self.t = Table()
self.t['a'] = da.arange(10)
def test_add_row(self):
self.t.add_row(... |
40fb09dc07340f84460bc091ade1e6d3902dc71530444ab87cb61c8fae347168 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
from contextlib import nullcontext
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_almost_equal_nulp, assert_array_equal
from astropy import units as u
from astropy.convolution.convolve import c... |
08fe0510cca566e2742e382d50aabc30e7b6aeed264f9f6ae9501f656e0211dc | # 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 check_pickling_recovery, pickle_protocol # noqa
@pytest.mark.parametrize(("name", "args", "kwargs", "xfail"),
[(conv.Cu... |
363a37bb36e4fcba28f73d9729bce3d18eb1191398086da56d352616a121e5c2 | # 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... |
a4333a786787291fa3df3dd978b7cdb832e5bb980dbbb60aa0f8f1918e5c6aea | # 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_almost_equal
from astropy import units as u
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import (Box... |
1afb6c448764e7e12c2c9d8e984da28248e6ec680679de78bf697ad2789c8154 | # 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_almost_equal
from astropy.convolution.convolve import convolve, convolve_fft
from astropy.convolution.kernels import (AiryDisk2DKernel, Box1DKernel, Box... |
22322aa96ee8b0a080322f37165c6c2f76c9900cfb2066180b7a5ccc91ee87da | # 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 (Box1D, Box2D, Gaussian1D, Gaussian2D,
... |
57c49064726c210c5f9649c3f8f2f3991a71f97f3a9b56c99fe16d9347f4aa9b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
from contextlib import nullcontext
import pytest
import numpy as np
import numpy.ma as ma
from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp
from astropy import units as u
from astropy.... |
71167bf445d94478e88a024dcf193a8bf678c87ba483e4370d39c0996881af35 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
from astropy.convolution.convolve import convolve, convolve_fft, convolve_models
from astropy.modeling import fitting, models
from astropy.utils... |
c96771313e5df05cc30d4ccb89708d4c24376f1bc65b98044eb0a4cef3ea2b88 | # 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, ... |
234ae0c5d937ad37acbe0f796d2d7c16a9861afe5c2ed22ffe34813a627186ee | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import os
import sys
import subprocess
import pytest
from astropy.config import (configuration, set_temp_config, paths,
create_config_file)
from astropy.utils.data import get_pkg_data_filenam... |
430ed5da429a7e8b4083361653c32f9a84b10b51d9068557440e138bd8013f89 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy.testing import assert_array_equal
import pytest
from astropy import units as u
from astropy.coordinates import Angle
from astropy.uncertainty.core import Distribution
from astropy.uncertainty import distributions as ds
from ... |
e2297945c013874f92544f5b60a26ba3cd7f1d7b2920ece3038074eeb9f4b21a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to test statistic functions
"""
# pylint: disable=invalid-name
import pytest
import numpy as np
from numpy.testing import assert_almost_equal
from astropy.modeling.models import Identity, Mapping
from astropy.modeling.fitting import LinearLSQF... |
74f0acd46516ff5d828aea00ec13a5e4f04a078fa27e52d6f6b47650758da0d6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test sky projections defined in WCS Paper II"""
# pylint: disable=invalid-name, no-member
import os
import pytest
import numpy as np
import unittest.mock as mk
from numpy.testing import assert_allclose, assert_almost_equal
from astropy.modeling impor... |
87d8ac553334cf548bf24909bd94fdb055b80bdc8ffb780bbfae888919d47311 | # 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',
... |
fb00c1b993a05f57e023cd4b8967038cd2c472e0dd0477dbb00abcd8b49b797f | # 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... |
fd857ada0fd26e96966ed5171cf85e8a2ca5c1dc8976c3d3a924bf6a15deedb0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to test fitting routines
"""
# pylint: disable=invalid-name
import os.path
import warnings
from unittest import mock
from importlib.metadata import EntryPoint
import pytest
import numpy as np
import unittest.mock as mk
from numpy import linalg
... |
51289dbb8573aace421e08e79a55decfd5a2a17a531b3f0bf0940064f34413a9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal, assert_array_less
from astropy import units as u
from astropy.modeling import models, InputParameterError
from astropy.coordina... |
939da877ce0b261d7d939ac2c6d12d7e2ed9778759c70b5cefbba68498e488d5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
import pytest
import numpy as np
from inspect import Parameter
from astropy.modeling.utils import (poly_map_domain, _validate_domain_window,
get_inputs_and_params, _SpecialOperatorsDict)
... |
1a35a079596d588a1b284adcf2930b6db8f735cfc53603e5ba46636c47b9a2ba | # Licensed under a 3-clause BSD style license - see LICENSE.rst:
"""
Tests for model evaluation.
Compare the results of some models with other programs.
"""
# pylint: disable=invalid-name, no-member
import pytest
import numpy as np
import unittest.mock as mk
import astropy.modeling.tabular as tabular_models
from nump... |
d6da02f65576a7c301621dc1cb4968ac3d7ab44dda0bf8cef2a9bfc2749d6445 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests model set evaluation and fitting for some common use cases.
"""
# pylint: disable=invalid-name
import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.modeling.models import (Polynomial1D, Polynomial2D... |
addb61bc691884e38671a2e472ab0e7f9f34314a7e921e567d9ac4c25bdccb79 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name, no-member
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_qu... |
c7f9f88ebde84bf953c7e5cef3c16d82f3be802cbd55c447da5ea35e581fd9a6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to evaluating models with quantity parameters
"""
# pylint: disable=invalid-name, no-member
import numpy as np
import pytest
from numpy.testing import assert_allclose
from astropy.modeling.core import Model
from astropy.modeling.mo... |
fe54f71a7770137edefa8f366810bfb554843c2a242fcd0a2b091a410df8d5c3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to fitting models with quantity parameters
"""
# pylint: disable=invalid-name, no-member
import numpy as np
import pytest
from astropy import units as u
from astropy.units import UnitsError
from astropy.tests.helper import assert_qua... |
bd4e019e18d9e95083e2bb81e38174f863fdf781c0d984fe2a6fa1ac78efa8ef | # 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... |
7374892302f3ed3075b08687c73b9da49b0f4d9aac08b7d3a1633d9cd2c9e6a2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to using quantities/units on parameters of models.
"""
# pylint: disable=invalid-name, no-member
import numpy as np
import pytest
from astropy.modeling.core import Fittable1DModel, InputParameterError
from astropy.modeling.paramete... |
4695b412d6e02a065487268bf4390a3d755bbbc90800a3b056d3cbc64e1d7082 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Tests for polynomial models."""
# pylint: disable=invalid-name
import os
import warnings
from itertools import product
import pytest
import numpy as np
import unittest.mock as mk
from numpy.testing import assert_allclose
from astropy.modeling impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.