hash
stringlengths
64
64
content
stringlengths
0
1.51M
a763b9e765b942027e6f2a84bb714ccfe85e8524f90a1ab4a4c3417f5b1bdaa0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements classes (called Fitters) which combine optimization algorithms (typically from `scipy.optimize`) with statistic functions to perform fitting. Fitters are implemented as callable classes. In addition to the data to fit, the ``__c...
7720767677710091c7ef4cb6d3e478decb1afc6db12a7bd60be9948bf7aa8b9d
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name """ This module defines classes that deal with parameters. It is unlikely users will need to work with these classes directly, unless they define their own models. """ import functools import numbers import operator impo...
807b9b662c1656310d3702a65944004fb3080e063328fa3e185b80cbfd9adf2d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines base classes for all models. The base class of all models is `~astropy.modeling.Model`. `~astropy.modeling.FittableModel` is the base class for all fittable models. Fittable models can be linear or nonlinear in a regression analys...
8d7f21a178d9240d59e3801757e97162b90be06414429ec520ebb486241a93f4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Spline models and fitters.""" # pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name import abc import functools import warnings import numpy as np from astropy.utils import isiterable from astropy.utils.exceptions import ...
c8c4531e408914d3de22a7030a5e1820a4219e7a50f21957ea905a0516c023be
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Implements rotations, including spherical rotations as defined in WCS Paper II [1]_. `RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in WCS Paper II to rotate to/from a native sphere and the celestial sphere. The implement...
03dda8d824b67e1f72701807830fbbd18636f77f54cec4fbb1625903f38ad52d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides utility functions for the models package. """ import warnings # pylint: disable=invalid-name from collections import UserDict from inspect import signature import numpy as np from astropy import units as u from astropy.utils.de...
763455a2eb1ea201135dcba585cba383d24c298a0e2ff13e37f921b8dc036b71
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Mathematical models.""" # pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name import warnings import numpy as np from astropy import units as u from astropy.units import Quantity, UnitsError from astropy.utils.compat.optio...
1240f9c1279a88a23c1820f4bcbbf8f7259e59ffd3fe4f4084560e5b84f5fff4
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name """ Implements projections--particularly sky projections defined in WCS Paper II [1]_. All angles are set and and displayed in degrees but internally computations are performed in radians. All functions expect inputs and out...
0b28dfe2e702282c84fb0e751da0856e9a7d1684d70e4f87219361da76815872
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains models representing polynomials and polynomial series. """ # pylint: disable=invalid-name from math import comb import numpy as np from astropy.utils import check_broadcast, indent from .core import FittableModel, Model from .f...
bc69742f78966e8cba11b9e15979d427aa00f2295219932147fdbb0e58a6aa28
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Models that have physical origins. """ # pylint: disable=invalid-name, no-member import warnings import numpy as np from astropy import constants as const from astropy import units as u from astropy.utils.exceptions import AstropyUserWarning from ....
c70b88229a4b555a17242e466cd1c59f451b46e8446f0f37d831f94d33435645
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Power law model variants. """ # pylint: disable=invalid-name import numpy as np from astropy.units import Magnitude, Quantity, UnitsError, dimensionless_unscaled, mag from .core import Fittable1DModel from .parameters import InputParameterError, Para...
77354657f28927c2822ced09527fc7eb1e99ac8d824b776b151e40268bbc0556
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utilities for console input and output. """ import codecs import locale import math import multiprocessing import os import re import struct import sys import threading import time # concurrent.futures imports moved inside functions using them to avo...
b2f939614fac52acb7b3b98dc70c94f61cfe02d15acab7486239b25d610c8513
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Functions for accessing, downloading, and caching data files.""" import atexit import contextlib import errno import fnmatch import ftplib import functools import hashlib import io import os import re import shutil # import ssl moved inside functions...
db8e0dc6d22499c5f5bb56139e3be2a8a3f2a6654d3042c1c0efd13744928c98
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ A "grab bag" of relatively small general-purpose utilities that don't have a clear module/package to live in. """ import contextlib import difflib import inspect import json import locale import os import re import signal import sys import threading i...
0d1e2d2c9e2c985cc8eddc06398964afa8e45e241cd6c7293859922866c90c02
# Licensed under a 3-clause BSD style license - see LICENSE.rst import weakref from abc import ABCMeta, abstractmethod from copy import deepcopy import numpy as np # from astropy.utils.compat import ignored from astropy import log from astropy.units import Quantity, Unit, UnitConversionError __all__ = [ "Missin...
7089e2af3df65fcd0ea4cd5a2105d4c716478b4e9ff1ee77195f503b76f90f98
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This module implements the base NDData class. from copy import deepcopy import numpy as np from astropy import log from astropy.units import Quantity, Unit from astropy.utils.masked import Masked, MaskedNDArray from astropy.utils.metadata import Meta...
28dcb4e6d150498dfad7a5707aa2df09dbffc6fcb6ed6ce67fbf2b09d53e248f
""" A module that provides functions for manipulating bit masks and data quality (DQ) arrays. """ import numbers import warnings from collections import OrderedDict import numpy as np __all__ = [ "bitfield_to_boolean_mask", "interpret_bit_flags", "BitFlagNameMap", "extend_bit_flag_map", "InvalidB...
29a9bdb07488853df051bb92e8161161b8ebec927c1fcea1d2b0db9de2e516be
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module implements the base CCDData class.""" import itertools import numpy as np from astropy import log from astropy import units as u from astropy.io import fits, registry from astropy.utils.decorators import sharedmethod from astropy.wcs impo...
a2d625c3624a8f38bef851643a7b346b7af558d30b455ed6543c33662d6a2127
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import numpy as np import astropy.units as u from astropy.coordinates import ITRS, CartesianRepresentation, SphericalRepresentation from astropy.utils import unbroadcast from .wcs import WCS, WCSSUB_LATITUDE, WCSSUB_LONGITUDE __doctest_ski...
2b5c3c48b90f033058d221490dd3c8e142a49e40b58f1f1d6687470fb1c3a3b1
# 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 astronomy. """ import copy ...
af1b9e3a13d945c4cb839b1c9dc826f1ed4961db2e26b640733f9b5f68fbd272
# Licensed under a 3-clause BSD style license - see LICENSE.rst import datetime import fnmatch import re import time import warnings from collections import OrderedDict, defaultdict from decimal import Decimal import erfa import numpy as np import astropy.units as u from astropy.utils.decorators import classproperty,...
81bf37dee8e7e354cbe60af963701de156fc9de91cf666702add65283fbca93e
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ["quantity_input"] import inspect import typing as T from collections.abc import Sequence from functools import wraps from numbers import Number import numpy as np from .core import ( Unit, UnitBase, UnitsError, add_enabled_eq...
c6560816485385322463f5ec5e5589cb1644d6d97c10fa4ed829beb9f150633d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines units used in the CDS format, both the units defined in `Centre de Données astronomiques de Strasbourg <https://cds.unistra.fr/>`_ `Standards for Astronomical Catalogues 2.0 <https://vizier.unistra.fr/vizier/doc/catstd-3.2.htx>`_ ...
873fb5756220db420f3a7c16c7e740cdc8dc9b4d209d3823c622e1d297379310
# 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 astropy.utils.decorators import lazyproperty from astropy.utils.exceptions import AstropyWarning from astropy.utils.misc i...
449feb1859d7760eb7800946ae9dbb91d658d735d50cb60a531851d775e0a28b
# 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 io import re from fractions import Fraction import numpy as np from numpy import finfo _float_finfo = finfo(float)...
c13be6a6cb160765dc808dc7f0359ba7aa62cb2120c96527c1bcc12d90fdd581
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines structured units and quantities. """ from __future__ import annotations # For python < 3.10 # Standard library import operator import numpy as np from .core import UNITY, Unit, UnitBase __all__ = ["StructuredUnit"] DTYPE_OBJ...
cb75e8c9e1bac2c809f18a25aad2610f528708c4667da2503a8fa274d73910ce
# 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. """ # STDLIB import numbers import operator i...
fe84b4760c16d5eba175367b32ca496f8a3d391b848c382d54952d7698d3a1b5
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains convenience functions for retrieving solar system ephemerides from jplephem. """ import os.path import re from urllib.parse import urlparse import erfa import numpy as np from astropy import units as u from astropy.constants imp...
c97804866fa142f4972c09b5c283421050bad0628d08daf1b0715dd79c820be2
# 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.py build_ext --inplace #...
e89d176bdab9b0c7c5e4f7cc05b2ff84defd07bdabb1117fc1ef036e386350f5
from contextlib import contextmanager from typing import Dict, NamedTuple import numpy as np from astropy.utils import unbroadcast from astropy.utils.data_info import MixinInfo from astropy.utils.shapes import ShapedLikeNDArray __all__ = ["StokesCoord", "custom_stokes_symbol_mapping", "StokesSymbol"] class StokesS...
08d609db67ccadcb1e50540160c80d25cb932466a6d48dde52d77c09bccd1e70
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This subpackage contains classes and functions for celestial coordinates of astronomical objects. It also contains a framework for conversions between coordinate systems. """ from .angle_utilities import * from .angles import * from .attributes impor...
68db35392bc5a3e3ae5eca5ef2a761fc10353eb513d8c94be1585d4512e40a72
import copy import operator import re import warnings import erfa import numpy as np from astropy import units as u from astropy.constants import c as speed_of_light from astropy.table import QTable from astropy.time import Time from astropy.utils import ShapedLikeNDArray from astropy.utils.data_info import MixinInfo...
3b0928026f7382732efdf30496ca7d1fea2da2e4bb51f81d0b2ead4afcbe17ac
import numpy as np from astropy.units import Unit, si from astropy.units import equivalencies as eq from astropy.units.decorators import quantity_input from astropy.units.quantity import Quantity, SpecificTypeQuantity __all__ = ["SpectralQuantity"] # We don't want to run doctests in the docstrings we inherit from Qu...
d3d858c87f518aa1cf5f8c698f71882c490c2d36482a78e27e319f59cbdc4f3b
# 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...
a24a0ac045de7e3347f1dde5026d3073f92b28cb054aed58c550ef328ac15731
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains utility functions for working with angles. These are both used internally in astropy.coordinates.angles, and of possible. """ __all__ = [ "angular_separation", "position_angle", "offset_by", "golden_spiral_grid", ...
9cfebda62c43f5fd076ec00b7205478d240e20b349f1182069b174c730fac5a4
# 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...
e4e0d758b81a2cfe3c0909a56ba933d7a26e40efed89ec1edcae5c22e8c33f2d
# 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...
d5044ac7d590f50edd0f5e6c1ac29f8521e2e788268bd1c34e18d2432fc578a8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re from collections.abc import Sequence import numpy as np from astropy import units as u from astropy.units import IrreducibleUnit, Unit from .baseframe import ( BaseCoordinateFrame, _get_diff_cls, _get_repr_cls, frame_transform...
94d1293624af2ba7836cd127d8e157157fa3afc6af0c916ea198bd15f173c1b2
# 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 copy import warnings from collections import defaultdict, namedtuple # Dependencies import numpy as np from astropy import units as u fro...
7ed59c442585d2293b6d4ee31e487686cdab2e8ea5db47501ef70e7a885417c4
# Licensed under a 3-clause BSD style license - see LICENSE.rst import collections import json import socket import urllib.error import urllib.parse import urllib.request from warnings import warn import numpy as np from astropy import constants as consts from astropy import units as u from astropy.units.quantity im...
2343f3184180316c9174d7753a48b1c768d628ab66692e40a347f95716898395
""" Module for parsing astronomical object names to extract embedded coordinates eg: '2MASS J06495091-0737408'. """ import re import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord RA_REGEX = r"()([0-2]\d)([0-5]\d)([0-5]\d)\.?(\d{0,3})" DEC_REGEX = r"([+-])(\d{1,2})([0-5]\d)([0-5]\d)\...
5c6751a3e9c23bcf4073818046f56cfc1efde7a1587421af1f8bbe014a7da502
# 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 pickle import pytest from astropy.units import allclose as quantity_allclo...
0b268bfe6439bd7485249e9ce253eb6322ac97d69702078aac66881b41865241
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np from astropy import units as u from astropy.table import QTable, Table, groups from astropy.time import Time, TimeDelta from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns from astr...
93d53949561ffb0790035598f47f0eef0f33d142bc995422b876024713fbb43e
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np from astropy import units as u from astropy.table import QTable, Table, groups from astropy.time import Time, TimeDelta from astropy.timeseries.core import BaseTimeSeries, autocheck_required_columns from astr...
0b22e7d4d6666fc666f9e825eef4be940dbabe826a4a1efcdb4023f8e173c501
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import annotations import abc import inspect from typing import TYPE_CHECKING, Any, TypeVar import numpy as np from astropy.io.registry import UnifiedReadWriteMethod from astropy.utils.decorators import classproperty from astropy.utils....
0ab925cc7eb7342b29bf06d120689b2ecbf9ff6e53ae70a5b58cbab4b8d11ac4
# 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 example...
be3563a2f7012bf48ac62e33419fd4f2eade1ec892121d3683ca1713cfe78edb
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools from numbers import Number import numpy as np from astropy.units import Quantity from . import units as cu __all__ = [] # nothing is publicly scoped def vectorize_redshift_method(func=None, nin=1): """Vectorize a method of reds...
ad728ba9366053fa37a2269fadeae79ae3a43a50cf373143211eaba89a01860f
# 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", # redshift equival...
46ed7be7bab4a732719137d922f9c4c0e4b7c5f710d4309847042c9e7d71cf95
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import pathlib import sys from typing import Optional, Union # LOCAL from astropy.utils.data import get_pkg_data_path from astropy.utils.decorators import deprecated from astropy.utils.state import ScienceState from . import _io # Ensure IO me...
e5c3a49977e90ba98189cde5835905a6530bd2c8bc5e9a2c6e34fd8900c79a50
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest 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(list(ran...
fe23664c9c15cc42b4263a8b5b37daf91ea719de2a276ded6c315a88b5c99b40
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import gc import os import pathlib import pickle import sys from collections import OrderedDict from io import StringIO import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from astropy import table ...
39e721f19bfe04f42efdfd4dfd6be28ae6ce44c7d26e734729b61d6ab8c4c4db
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import numpy as np import pytest from astropy import units as u from astropy.table import Column, QTable, Row, Table, hstack from astropy.table.bst import BST from astropy.table.column import BaseColumn from astropy.table.index import Sl...
4e7f614f7afd8f9ba8e813c68d0ceea598068bf29575eb28dcd8360b20f35742
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy import coordinates, time from astropy import units as u from astropy.table import Column, NdarrayMixin, QTable, Table, table_helpers, unique from astropy.time import Time from astropy.utils.compat import NUMP...
313fedf227e503621544005aab354758e2aae96f21f8fa2653130748edd99a44
# 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...
cf89d0d7aab7127dc8609bdcf00023f3d619e8d2b59b6e897722065ed173e360
# Licensed under a 3-clause BSD style license - see LICENSE.rst from collections import OrderedDict from contextlib import nullcontext import numpy as np import pytest from astropy import table from astropy import units as u from astropy.coordinates import ( BaseRepresentationOrDifferential, CartesianReprese...
7a0f0a837e049260b54f6ce71345fc11fa0eacd43b42dfca60715fd056239383
# Licensed under a 3-clause BSD style license - see LICENSE.rst import sys import numpy as np import pytest from astropy import table from astropy import units as u from astropy.table import Row from .conftest import MaskedTable def test_masked_row_with_object_col(): """ Numpy < 1.8 has a bug in masked ar...
8c1660df56bf5dac0b900ec1ed1af03bb332c2773a993450513a5bae143f2501
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import pickle from io import StringIO import numpy as np import pytest from astropy import coordinates, time from astropy import units as u from astropy.coordinates import EarthLocation, SkyCoord from astropy.coordinates.tests.helper import...
22379d278b70453be56f30ac600f7f8097e90443af87def830461613c62e8257
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import numpy as np import pytest from numpy.testing import assert_allclose, assert_almost_equal from astropy.convolution.convolve import convolve, convolve_fft from astropy.convolution.kernels import ( AiryDisk2DKernel, Box1DKer...
aa1a86683b98cfe201ca1d9fca6184e1da5c3bbf83b0115db375f364eb977813
# Licensed under a 3-clause BSD style license - see LICENSE.rst import itertools import numpy as np import pytest from numpy.testing import assert_allclose from astropy.convolution.utils import discretize_model from astropy.modeling.functional_models import ( Box1D, Box2D, Gaussian1D, Gaussian2D, ...
6ae212d7f6d6f3fa964fece2817dfe8cd0b22492e5eec1ee82ddf0f977b162c3
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import os import subprocess import sys import pytest from astropy.config import configuration, create_config_file, paths, set_temp_config from astropy.utils.data import get_pkg_data_filename from astropy.utils.exceptions import AstropyDeprecat...
9e30c0a107468f5cca30317054464600844ffee4e98184087b3a724d036a5b8f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import operator import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.coordinates import Angle from astropy.tests.helper import assert_quantity_allclose from astropy.uncertainty import d...
ac1cdf68309729cbe51164367fc68d94c90039d6b123587568b03ae111fa42f9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Module to test fitting routines """ # pylint: disable=invalid-name import os.path import unittest.mock as mk from importlib.metadata import EntryPoint from itertools import combinations from unittest import mock import numpy as np import pytest from n...
044ff4e69518a6505938e9eeb798f54618a7983addffe5971af175e01cea362d
# 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 unittest.mock as mk import numpy as np # pylint: disable=invalid-name, no-member import pytest from numpy.testing import assert_allclose, assert_equal i...
0f52182a58503670a7bb5d34d512a0bc910a5cad62149c726d03470cf3471b0d
"""Tests that models are picklable.""" from pickle import dumps, loads import numpy as np from numpy.testing import assert_allclose import pytest from astropy import units as u from astropy.utils.compat.optional_deps import HAS_SCIPY from astropy.modeling import functional_models from astropy.modeling import mappin...
d9197ad30044948f61d8d330598bd336975fce08a43daa5fc3ffc7152474b59c
# 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 import coordinates as coord from astropy import units as u from astropy.modeling.core import Fittable1DModel, InputParameterError f...
bb3358b3d1377ffce68356bbce1e06ca31e2b4aa2144b48727255392f3ed40d9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for polynomial models.""" # pylint: disable=invalid-name import os import unittest.mock as mk import warnings from itertools import product import numpy as np import pytest from numpy.testing import assert_allclose from astropy import conf, wcs...
cc1f7e3fd671b279335e43fad1d642c5581560ae359cbbd3a9a1337479fdb51e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import unittest.mock as mk import numpy as np import pytest import astropy.units as u from astropy.coordinates import SpectralCoord from astropy.modeling.bounding_box import ( CompoundBoundingBox, ModelBoundingBox, _BaseInterval, _BaseSel...
d9968608a44a124459ebdc940c2af5c8693b75f42475398165596305f5fafe5a
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name, pointless-statement import pickle import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal import astropy.units as u from astropy.modeling.core import CompoundModel, Model, ModelDefin...
4adeff667950936a4d7da836d2ba0951aac9bc9f5c0f4a622d89f624d5a859f1
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name import os import subprocess import sys import unittest.mock as mk from inspect import signature import numpy as np import pytest from numpy.testing import assert_allclose, assert_equal import astropy import astropy.modeling...
e985d4f8ee3a200c540e03ed389f862f5cecb185ee32f827c5731674c47da6c6
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests models.parameters """ # pylint: disable=invalid-name import functools import itertools import unittest.mock as mk import numpy as np import pytest from astropy import units as u from astropy.modeling import fitting, models from astropy.modelin...
658d5b3785ae577ca62908d64dcaef5eef2208e17cc9e840793bf00f035f8f08
# Licensed under a 3-clause BSD style license - see LICENSE.rst import json import locale import os import urllib.error from datetime import datetime import numpy as np import pytest from astropy.io import fits from astropy.utils import data, misc from astropy.utils.exceptions import AstropyDeprecationWarning def ...
527506d43d0af781f2c202b3882a95676513d9546bc327634d14954ee65a3541
# Licensed under a 3-clause BSD style license - see LICENSE.rst import base64 import contextlib import errno import hashlib import io import itertools import os import pathlib import platform import random import shutil import stat import sys import tempfile import urllib.error import urllib.parse import urllib.reques...
3a257b7e1494a5f3e13bfdf08f882ff4529248bb43197f683ece59f56f93c169
# Licensed under a 3-clause BSD style license - see LICENSE.rst import concurrent.futures import inspect import pickle import pytest from astropy.utils.decorators import ( classproperty, deprecated, deprecated_attribute, deprecated_renamed_argument, format_doc, lazyproperty, sharedmethod,...
8ecb93b205bcb16e6e222fc1470a09abdc047f4ec4cb2f2804e7b0b0c9907173
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Built-in mask mixin class. The design uses `Masked` as a factory class which automatically generates new subclasses for any data class that is itself a subclass of a predefined masked class, with `MaskedNDArray` providing such a predefined class for `...
13047deea28e3de481256f4298588fbc664c6ce95f39cf08e938c728288f9d8d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Checks for optional dependencies using lazy import from `PEP 562 <https://www.python.org/dev/peps/pep-0562/>`_. """ import importlib import warnings # First, the top-level packages: # TODO: This list is a duplicate of the dependencies in setup.cfg "all...
b3716b2cfbb444a58394ca83c506f888686964214693480e7ff3b6ff73ccc1f2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Simple utility functions and bug fixes for compatibility with all supported versions of Python. This module should generally not be used directly, as everything in `__all__` will be imported into `astropy.utils.compat` and can be accessed from there. ...
292e0325fc4fbc94bb93f8c1a32d4cab7bf927488396ddba261a95e9c218a384
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test masked class initialization, methods, and operators. Functions, including ufuncs, are tested in test_functions.py """ import operator import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u fr...
7874713260493b702ad8263e5a9b2822c95efaa56c71acba14b4754423589b4a
# 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 warnings import numpy as np from matplotlib import rcParams from matplotlib.patches import PathPatch from matplotlib....
7406c8d9e4192a42c597745cbb659ea7ea30b7ecbbcb263539f716d483e83236
# 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...
e764a5c819278f7183d2c43535ad8840919a18cf7157bca9df926a1360e2e7b4
# Licensed under a 3-clause BSD style license - see LICENSE.rst from collections import defaultdict from functools import partial import numpy as np from matplotlib import rcParams from matplotlib.artist import Artist from matplotlib.axes import Axes, subplot_class_factory from matplotlib.transforms import Affine2D, ...
6a70ef736fd3d5f554096858df864f7a6740db83749926215dc291841cf32126
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings from textwrap import dedent import matplotlib.pyplot as plt import numpy as np import pytest from matplotlib.transforms import Affine2D, IdentityTransform from astropy import units as u from astropy.coordinates import SkyCoord from astro...
280016b051efb4323ab5689b6f3e0abf029353c7956168b22a072e3ed57b5523
# Licensed under a 3-clause BSD style license - see LICENSE.rst import matplotlib.lines import matplotlib.text import matplotlib.pyplot as plt import numpy as np import pytest from matplotlib import rc_context from matplotlib.figure import Figure from matplotlib.patches import Circle, Rectangle from astropy import uni...
0c540934c1376767a093946ebef969e9588a488c9dcccdd2adaea27e476c972f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pickle import textwrap from collections import OrderedDict from itertools import chain, permutations import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.nddata import NDDataAr...
a9712d6d787f9b5bd5954a481f866554230cf11c419e8c212dc0233842254cd3
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.nddata import NDData, NDSlicingMixin from astropy.nddata import _testing as nd_testing from astropy.nddata.nduncertainty import ( ...
6ca5a40ef32899aa4580dfa3dee8bb408c12a274cf75ae40c6a13a1448e07686
# Licensed under a 3-clause BSD style license - see LICENSE.rst import importlib import numpy as np __all__ = ["deserialize_class", "wcs_info_str"] def deserialize_class(tpl, construct=True): """ Deserialize classes recursively. """ if not isinstance(tpl, tuple) or len(tpl) != 3: raise Valu...
e452463d901ce44cb1367a581e2829cd87d1a40b89c3287a9a65a116ef2ee725
import abc from collections import OrderedDict, defaultdict import numpy as np from .utils import deserialize_class __all__ = ["BaseHighLevelWCS", "HighLevelWCSMixin"] def rec_getattr(obj, att): for a in att.split("."): obj = getattr(obj, a) return obj def default_order(components): order = [...
ccc9051bee04e064aa2dea2c316860621538713e87d64d57eb20b9a6816050a4
# This file includes the definition of a mix-in class that provides the low- # and high-level WCS API to the astropy.wcs.WCS object. We keep this code # isolated in this mix-in class to avoid making the main wcs.py file too # long. import warnings import numpy as np from astropy import units as u from astropy.consta...
652e1de73f97cef70981c5d93df827fa36c843ed68f596522227da4a4e65e13f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import os from contextlib import nullcontext from datetime import datetime import numpy as np import pytest from numpy.testing import ( assert_allclose, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_array_equ...
9ee1f6cf49de8a085849fcb455b047be2b2f48a1fcf57bae0df09c2eec02ee98
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np import pytest from packaging.version import Version from astropy import wcs from astropy.io import fits from astropy.utils.data import get_pkg_data_filename from astropy.wcs import _wcs from .helper import Si...
3204afded05b92a2385f6961cd0c2b36879da369793e52640ebd77eb3f416b84
# Note that we test the main astropy.wcs.WCS class directly rather than testing # the mix-in class on its own (since it's not functional without being used as # a mix-in) import warnings from itertools import product import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal, asser...
1aaf60094ad51c907af050b9964e18c626a35e8cbfe5679ec71e89f3b2784f64
import warnings import numpy as np import pytest from numpy.testing import assert_allclose, assert_equal import astropy.units as u from astropy.coordinates import ICRS, Galactic, SkyCoord from astropy.io.fits import Header from astropy.io.fits.verify import VerifyWarning from astropy.time import Time from astropy.uni...
01acb7d967eb038a305776a5028e0b1dec556e1bbee36cb2baec0de27336951f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import datetime import functools import os from copy import deepcopy from decimal import Decimal, localcontext from io import StringIO import erfa import numpy as np import pytest from erfa import ErfaWarning from numpy.testing import assert_...
39f56d654c240c86489799445ab1e906f121d1dd0658015fae49aa1476fe1e13
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import numpy as np import pytest from astropy import units as u from astropy.table import Column from astropy.time import Time, TimeDelta allclose_sec = functools.partial( np.allclose, rtol=2.0**-52, atol=2.0**-52 * 24 * 3600 ) # 2...
a7e5844dc77f7d792254aa1706039bcb072460fd01ba697060efcaa4b83f397b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import operator import numpy as np import pytest import astropy.units as u from astropy.time import Time, TimeDelta class TestTimeComparisons: """Test Comparisons of Time and TimeDelta classes""" def setup_method(self): self.t1 = Time...
d6f5ab1c0d5353890b7e5c21af58fb659dec000a5be9c395ec4f0f9b00c00b0b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import numpy as np import pytest from astropy import units as u from astropy.table import Table from astropy.time import Time from astropy.utils import iers from astropy.utils.compat import PYTHON_LT_3_11 from astropy.utils.compat.optio...
d8c6057fdf371d2314345a29cf1e431c5a741227fcbea35839b608b61f1cdfb9
# Licensed under a 3-clause BSD style license - see LICNSE.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.py build_ext --inplace # ...
8ec757d89766477a1db5f42b3a5a77c9449b27af3b909f3bf21f6d4f35e98693
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "VOUnit" unit format. """ import copy import keyword import re import warnings from . import core, generic, utils class VOUnit(generic.Generic): """ The IVOA standard for units used by the VO. This is an implementation of ...
10d62bb96deec05f8b46a1bcc0f524e04a62f6f233d0732a8aa36c016581558f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Quantity helpers for the ERFA ufuncs.""" # Tests for these are in coordinates, not in units. from erfa import dt_eraASTROM, dt_eraLDBODY, dt_pv from erfa import ufunc as erfa_ufunc from astropy.units.core import UnitsError, UnitTypeError, dimensionles...
e56c54fce00c50d9b7953599344c2bde8820a95fba7a7689d61d7ba390c4ebdc
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Separate tests specifically for equivalencies.""" import numpy as np # THIRD-PARTY import pytest from numpy.testing import assert_allclose # LOCAL from astropy import constants from astropy import units as u from astropy.tests.helper import assert_qu...
e13f86f5d1ade8c40af890a70c2c1613a186202b9e8f9e70c17d2369ec26b768
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Regression tests for the units.format package """ import warnings from contextlib import nullcontext from fractions import Fraction import numpy as np import pytest from numpy.testing import assert_allclose from astropy import units as u from astropy...