hash
stringlengths
64
64
content
stringlengths
0
1.51M
2400b0d781cdb8fbc8fb677ca43a6cf86c70ea95a3dd445c72a6a7f5c33046e3
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import os import pytest from astropy import cosmology from astropy.cosmology import Cosmology, w0wzCDM from astropy.cosmology.connect import readwrite_registry from astropy.cosmology.io.tests import ( test_cosmology, test_ecsv, ...
a452155d2815e68ed66f0a085ee524754087b8ec80f6e691ccf22cd7d69d258b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.core`.""" ############################################################################## # IMPORTS # STDLIB import abc import inspect import pickle # THIRD PARTY import numpy as np import pytest # LOCAL import astrop...
455821f6d63c20510ca5cd5248f6456057e6d1e0382213049d9f60b353ed6576
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides the tools used to internally run the cosmology test suite from the installed astropy. It makes use of the `pytest`_ testing framework. """ ############################################################################## # IMPORTS ...
43414ab07f3f7e3030f0e01df5e12c87242c76ea280735c4e73155384dc6bc75
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Stand-alone overall systems tests for :mod:`astropy.cosmology`.""" from io import StringIO import numpy as np import pytest import astropy.constants as const import astropy.units as u from astropy.cosmology import flrw from astropy.cosmology.realiza...
f38455243fd63639e15e1ba8f02c55656210dc94b2461e8b69f5880a2d347c54
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Astropy FLRW classes.""" from . import base, lambdacdm, w0cdm, w0wacdm, w0wzcdm, wpwazpcdm from .base import * from .lambdacdm import * from .w0cdm import * from .w0wacdm import * from .w0wzcdm import * from .wpwazpcdm import * __all__ = ( base.__...
1b47aea94495d3f5ad42d0f7118400bfef54074be7442d7a21d25e58c2484e1c
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy import exp import astropy.units as u from astropy.cosmology.parameter import Parameter from astropy.cosmology.utils import aszarr from . import scalar_inv_efuncs from .base import FLRW __all__ = ["w0wzCDM"] __doctest_requires__ = {"*": ["sc...
dd7c06d8f21fa6bc3c2c970cd166a75c44328b0f68e9145870de1444a9027578
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import annotations import warnings from abc import abstractmethod from math import exp, floor, log, pi, sqrt from numbers import Number from typing import Any, Mapping, TypeVar import numpy as np from numpy import inf, sin import astrop...
19d29a3125646ffce889d24e9baf76889c2f340f2090d02f213e98f615a5b65a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from numpy import sqrt import astropy.units as u from astropy.cosmology.parameter import Parameter from astropy.cosmology.utils import aszarr from . import scalar_inv_efuncs from .base import FLRW, FlatFLRWMixin __all__ = ["wCDM", "F...
73bc7bdc4a96065d27fdb802f70f9ef472c4f8e8c915b5ffa5e9cfed4f61ab95
# Licensed under a 3-clause BSD style license - see LICENSE.rst from math import acos, cos, inf, sin, sqrt from numbers import Number import numpy as np from numpy import log import astropy.units as u from astropy.cosmology.utils import aszarr from astropy.utils.compat.optional_deps import HAS_SCIPY from . import s...
c06065ecf3ecf05e7e42dad82a784bb8c416cc96a8538f1ebec8930515cb3b57
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy import exp import astropy.units as u from astropy.cosmology import units as cu from astropy.cosmology.parameter import Parameter from astropy.cosmology.utils import aszarr from . import scalar_inv_efuncs from .base import FLRW __all__ = ["wp...
deb3bac06ffb43ec8502d3b4bf015025df355e92d26e67df513216193a1a499d
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy import exp import astropy.units as u from astropy.cosmology.parameter import Parameter from astropy.cosmology.utils import aszarr from . import scalar_inv_efuncs from .base import FLRW, FlatFLRWMixin __all__ = ["w0waCDM", "Flatw0waCDM"] __d...
93add7146afeecc247afc459062d7f428c0c035aafca463f896973ad1fea4093
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for :mod:`astropy.cosmology.comparison`""" import re import numpy as np import pytest from astropy.cosmology import Cosmology, FlatCosmologyMixin, Planck18, cosmology_equal from astropy.cosmology.connect import convert_registry from astropy.co...
80226a2ccd83f11c85340cb0ee87d913ffbdfb0080b7412f9468cd290dba44b0
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import sys from io import StringIO import numpy as np import pytest from astropy import units as u from astropy.cosmology import core, flrw from astropy.cosmology.funcs import _z_at_scalar_value, z_at_value from astropy.cosmology.realizat...
a3e2fc909a824afd7988bca7b1c32ac52de1f983a68d6dc27ec081d6d2aa582a
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import inspect import random # THIRD PARTY import numpy as np import pytest # LOCAL from astropy.cosmology.core import Cosmology from astropy.cosmology.io.model import _CosmologyModel, from_model, to_model from astropy.cosmology.tests.helper im...
7628fcd4c03a08253787c7a188ff5d00ff3b785df3e1f77246d7cb678e660e9c
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import inspect from collections import OrderedDict # THIRD PARTY import numpy as np import pytest # LOCAL from astropy.cosmology import Cosmology from astropy.cosmology.io.mapping import from_mapping, to_mapping from .base import ToFromDirectT...
0aab044c5bc34ac14365281e17b97a2bb47f32fa75dacb95a8fe99ac3beb8e6d
# Licensed under a 3-clause BSD style license - see LICENSE.rst # THIRD PARTY import pytest # LOCAL from astropy.cosmology import Cosmology from astropy.cosmology.core import _COSMOLOGY_CLASSES from astropy.cosmology.io.table import from_table, to_table from astropy.table import QTable, Table, vstack from .base impo...
520ce51cef29b1ff646a16a73d88d0d6ee42aa6a491ee3c8802e60a819c78f0f
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import Cosmology, FlatLambdaCDM, Planck18 from astropy.cosmology import units as cu from astropy.cosmology.io.yaml import ( from_yaml, to_yaml, yam...
1a680db519d81f8b07718c370d8cb63311eadcce6fe05df2fa0eb67a66741163
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test that all expected methods are present, before I/O tests import. This file is weirdly named so that it's the first test of I/O. """ from astropy.cosmology.connect import convert_registry, readwrite_registry def test_expected_readwrite_io(): ...
14193a76190f6e75c6c964e6f533eb450919913def03eae0356bc5fb33dd5c21
# Licensed under a 3-clause BSD style license - see LICENSE.rst # THIRD PARTY import pytest import astropy.units as u from astropy.cosmology.io.html import _FORMAT_TABLE, read_html_table, write_html_table from astropy.cosmology.parameter import Parameter from astropy.table import QTable, Table, vstack from astropy.un...
017a5d0240b6ed9a0d847f9c7dd48becd68b19766d5c078794a5b4e60bf81b91
# Licensed under a 3-clause BSD style license - see LICENSE.rst # THIRD PARTY import pytest # LOCAL from astropy.cosmology.core import _COSMOLOGY_CLASSES from astropy.cosmology.io.ecsv import read_ecsv, write_ecsv from astropy.table import QTable, Table, vstack from .base import ReadWriteDirectTestBase, ReadWriteTes...
faeb8a095203305a4ccfd85401baf11e9a791ee02de2e6c79bb9dec955fa0a93
# Licensed under a 3-clause BSD style license - see LICENSE.rst # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import Cosmology, Parameter, realizations from astropy.cosmology import units as cu from astropy.cosmology.core import _COSMOLOGY_CLASSES from astropy.cosmology.realizat...
9dfbd1e822a4cd8ccaab8a342e76165f2ab1031cd522a0ad28d1bc57b1086d60
# Licensed under a 3-clause BSD style license - see LICENSE.rst # THIRD PARTY import pytest # LOCAL from astropy.cosmology.core import _COSMOLOGY_CLASSES, Cosmology from astropy.cosmology.io.row import from_row, to_row from astropy.table import Row from .base import ToFromDirectTestBase, ToFromTestMixinBase #######...
99c793c14478505d3cff69e602a2f1397ff3f31b4133237cb9c4700507d0de24
# Licensed under a 3-clause BSD style license - see LICENSE.rst # STDLIB import json import os # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import units as cu from astropy.cosmology.connect import readwrite_registry from astropy.cosmology.core import Cosmology from .base impo...
bd21fd7e2836f7e2acfb95feceec5f60a25b5cc1b78b4724a619d0bdc5c9bde5
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.wpwazpcdm`.""" ############################################################################## # IMPORTS # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.cosmology.units as cu import astropy.units as u...
bc3a74f3b0264552e9c89419d20b48889840851799ca51ef4055e05d457b1332
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.lambdacdm`.""" ############################################################################## # IMPORTS # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import FlatLa...
065deff241cfd642fd8530da6cee59781f432b8bd9208fcf03d957562c6a8dbf
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.base`.""" ############################################################################## # IMPORTS # STDLIB import abc import copy # THIRD PARTY import numpy as np import pytest import astropy.constants as const...
6d651da67c2034e79c364cca9716e24845492ea89b21b2ca9cd4481335de4901
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.w0wzcdm`.""" ############################################################################## # IMPORTS # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import w0wzCDM ...
04bd4685b9cb96da5e9101431b6bb62cf402d37d0b7034405d8dcd667c9583b7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.w0wacdm`.""" ############################################################################## # IMPORTS # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import Flatw0wa...
60b5b4120a5a222cc28f401e81fc7dda96ff988e3b1920f63ae7712548b4cb10
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.flrw.w0cdm`.""" ############################################################################## # IMPORTS # STDLIB # THIRD PARTY import pytest # LOCAL import astropy.units as u from astropy.cosmology import FlatwCDM, ...
1c1393c7a86432e1baa46897a71533657e0b72558fc29df4fbe7725d8c7b1d6a
# Load the WCS information from a fits header, and use it # to convert pixel coordinates to world coordinates. import sys import numpy as np from astropy import wcs from astropy.io import fits def load_wcs_from_file(filename): # Load the FITS hdulist using astropy.io.fits hdulist = fits.open(filename) ...
56ddfcf82c7380e47d96c92ebf0959f8cc7684c406db53c2e8dbed03315efcb3
# Set the WCS information manually by setting properties of the WCS # object. import numpy as np from astropy import wcs from astropy.io import fits # Create a new WCS object. The number of axes must be set # from the start w = wcs.WCS(naxis=2) # Set up an "Airy's zenithal" projection # Vector properties may be se...
9720a3e158d751a575c771fb7f5288e768e75c6a937139a6891d5948cad4564f
# Define the astropy.wcs.WCS object using a Python dictionary as input import astropy.wcs wcs_dict = { 'CTYPE1': 'WAVE ', 'CUNIT1': 'Angstrom', 'CDELT1': 0.2, 'CRPIX1': 0, 'CRVAL1': 10, 'NAXIS1': 5, 'CTYPE2': 'HPLT-TAN', 'CUNIT2': 'deg', 'CDELT2': 0.5, 'CRPIX2': 2, 'CRVAL2': 0.5, 'NAXIS2': 4, 'CTYPE3': 'HPLN-TAN',...
2989b4abae9030d1e08f908e8f879dc54b48e7e3f523fb57969adf57b29240ab
# NOTE: this hook should be added to # https://github.com/pyinstaller/pyinstaller-hooks-contrib # once that repository is ready for pull requests from PyInstaller.utils.hooks import collect_data_files datas = collect_data_files("skyfield")
a323ad380ce9a299ad15e31b99c9f4575e2a09a926be16c63e2a09c8b6c7c832
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file is the main file used when running tests with pytest directly, # in particular if running e.g. ``pytest docs/``. import os import tempfile import hypothesis from astropy import __version__ try: from pytest_astropy_header.display import...
25e2dd1f73ff41502ce92cae2b7fbd46e4f9352638b02e3082e807ffac947278
# Licensed under a 3-clause BSD style license - see LICENSE.rst # # Astropy documentation build configuration file. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this file. # # All configuration values have a default...
0607dc3a62a97899e8b17121e20f37d1e64a3beef7407c200ed9f48c855c0327
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains simple statistical algorithms that are straightforwardly implemented as a single python function (or family of functions). This module should generally not be used directly. Everything in `__all__` is imported into `astropy.stats...
b3d3099daa074b79bc170ac404d888159297f43d57a47f09e143ed7a993856db
# Licensed under a 3-clause BSD style license - see LICENSE.rst import fnmatch import os import re import sys import numpy as np from astropy import log from astropy.utils.console import Getch, color_print, conf, terminal_size from astropy.utils.data_info import dtype_info_name __all__ = [] def default_format_fun...
9bdd4be53b4f55857cd4a306a9c2dd5c8c7225b5a747295e61be7b8fa99d1353
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions to determine where configuration and data/cache files used by Astropy should be placed. """ import os import shutil import sys from functools import wraps __all__ = ["get_config_dir", "get_cache_dir", "set_temp_config",...
de49f31d7e443fea5156487bb78b8d99a0b0e7e1e367392a207f9470d230c48e
# 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...
24edb7921cc9d5ac9fdda777c0fc7976fe8c0cc64f0107add564502a4995db74
# 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...
99009f355f2d57b5c007362ca5aa6b13230d8f96f544d1b428c0c67a0ebb43bf
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Sundry function and class decorators.""" import functools import inspect import textwrap import threading import types import warnings from inspect import signature from .exceptions import ( AstropyDeprecationWarning, AstropyPendingDeprecatio...
0e6bd6825806263cb4a38f112e556e7b04ead3cc22706ffa0fa039dc0e6bfa53
# 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...
aa23a78c03598f86bf2c8467c3424d3d9fb5f9f0aed3e89cc0e9b22b7ba6aa5f
# 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...
fe927ab18385261d020a2b56c16a501a78608bbd86685ad1d92737256376b60d
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Under the hood, there are 3 separate classes that perform different # parts of the transformation: # # - `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS # functionality in `wcslib`_. (This includes TPV and TPD # polynomial disto...
d01159f4fafbfd6ad4bad65fde7959afadd19353923fc72e8058449305014884
# 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 ...
ec6e09c4344d1c6689a295720eab1f7f780c8eff2389963539aacb3defc24018
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines colloquially used Imperial units. They are available in the `astropy.units.imperial` namespace, but not in the top-level `astropy.units` namespace, e.g.:: >>> import astropy.units as u >>> mph = u.imperial.mile / u.hour ...
775b8f8807f60cf26888809778d50303c6921a7a3ef1c19dbe72395d52ab8da6
# 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 <http://cds.u-strasbg.fr/>`_ `Standards for Astronomical Catalogues 2.0 <http://vizier.u-strasbg.fr/vizier/doc/catstd-3.2.htx>`...
ab1218fe4130b172023e47f4fad601432891ed221fbb460e7954357ea1a395b7
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines magnitude zero points and related photometric quantities. The corresponding magnitudes are given in the description of each unit (the actual definitions are in `~astropy.units.function.logarithmic`). """ import numpy as _numpy ...
1cae8b2f58e14a5e62aa5a56c1fc1997fa5cf7ce2b48c5d25aa915dc25e83c4d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines SI prefixed units that are required by the VOUnit standard but that are rarely used in practice and liable to lead to confusion (such as ``msolMass`` for milli-solar mass). They are in a separate module from `astropy.units.deprecat...
59347f4a2b8bfe48fe103ff042fc1caffcaed9cf7acf3df2fa7cc37edab9830c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the astrophysics-specific units. They are also available in the `astropy.units` namespace. """ from astropy.constants import si as _si from . import si from .core import UnitBase, def_unit, set_enabled_units # To ensure si un...
0ec4b20598641c64aa48607c95cca61c536bb4abde7b1864defee7baacb4d9e0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Defines the physical types that correspond to different units.""" import numbers import warnings from astropy.utils.exceptions import AstropyDeprecationWarning from . import imperial # for bkwd compat #11975 and #11977 # noqa: F401 from . import a...
a7e381517a21bf8ea663fafe707fdada04a2b1c4435df26b47969a06cc997171
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the CGS units. They are also available in the top-level `astropy.units` namespace. """ from fractions import Fraction from . import si from .core import UnitBase, def_unit _ns = globals() def_unit(["cm", "centimeter"], si.cm,...
639df830d052207eaea08e4062c471d214918a2df2164f528b518bef148c40d9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines deprecated units. These units are not available in the top-level `astropy.units` namespace. To use these units, you must import the `astropy.units.deprecated` module:: >>> from astropy.units import deprecated >>> q = 10. ...
5fec495b1ecc64129e4bebbc683af7406e0d4f138d29eceb7bf3d983ea6eb19b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines the SI units. They are also available in the `astropy.units` namespace. """ import numpy as _numpy from astropy.constants import si as _si from .core import Unit, UnitBase, def_unit _ns = globals() #########################...
a165b3951e7a5ea498753b860316e349c0ea7dc6eec12d91a2fc0f61de29a719
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines miscellaneous units. They are also available in the `astropy.units` namespace. """ from astropy.constants import si as _si from . import si from .core import UnitBase, binary_prefixes, def_unit, set_enabled_units, si_prefixes ...
9ecafac840928f9150eeefd5dc428b08c68e73e680fcaf64460bbb0877a0517c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """A set of standard astronomical equivalencies.""" import warnings from collections import UserList # THIRD-PARTY import numpy as np # LOCAL from astropy.constants import si as _si from astropy.utils.exceptions import AstropyDeprecationWarning from ast...
4b12e7711b687b65538b89c1ee740c0db5b779d6430720f92f59f1523f1ac18f
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...
8e23ca29cae1e674268ccb534875360f861dc73400e0f77b0b5fcb9107870da2
""" In this module, we define the coordinate representation classes, which are used to represent low-level cartesian, spherical, cylindrical, and other coordinates. """ import abc import functools import inspect import operator import warnings import numpy as np from erfa import ufunc as erfa_ufunc import astropy.un...
34f1cb182218a3aa3ca92a1fec55e6bc8e00a9fef3f009e34f89f0c7cca60c93
# 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", ...
2f90d8459710938d3d3e9dac2b986bbed8d77f7d361f0128da9faffb62c1233f
# 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...
56320420f981e2052df1b31eee13c26e882a659d413c74cc1ae1b44dfa96e3e2
# 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 inspect import warnings from collections import defaultdict, namedtuple # Dependencies import numpy as np from astropy import...
8281597376892d0fb8efc9a5c39c6eb3cd50ea92fd33c5511e41a63765937ff0
# 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 erfa import numpy as np from astropy import constants as consts from astropy import units as u from astropy.units...
53b1ab956a985f6ecf4e87bb5b53c86fbb96da677c932214b5738475d133e86e
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the fundamental classes used for representing coordinates in astropy. """ import functools from collections import namedtuple import numpy as np from astropy import units as u from astropy.utils import isiterable from . import...
2101a39c2b97a665eecf7044e7b7520f32b6e726191fd38af4f9096cb9e2d430
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Dependencies import numpy as np # Project from astropy import units as u from astropy.utils import ShapedLikeNDArray __all__ = [ "Attribute", "TimeAttribute", "QuantityAttribute", "EarthLocationAttribute", "CoordinateAttribute", ...
b4a66c9a8c3a0b55ef692945b809e3c9f87b5a966907d5d7a1bd5d2b1d929843
# 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 ...
4a0b8f5e2d95199085229e81105e9c0ce9d7e7acc107dbba0e0021cf898423b9
# 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...
1b14f29d9a48874bee75673d6646a3b1a6d6e11f960890955d023c6418617e34
# Licensed under a 3-clause BSD style license - see LICENSE.rst import operator import warnings import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import table, time from astropy import units as u from astropy.tests.helper import assert_follows_unicode_guidelines from astropy....
67b505bde189cec46106f8f0ed65e3c9931457adac046cde2666cd320747e9bd
# 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...
99f052829d5d271a90add8ae9b8ec467bff45be57cf6e85e90eb902a7d10228d
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Helpers for letting numpy functions interact with Masked arrays. The module supplies helper routines for numpy functions that propagate masks appropriately., for use in the ``__array_function__`` implementation of `~astropy.utils.masked.MaskedNDArray`....
f773e131f3ba01cf54b72f22457716cb6b24f234c37854c2733fc46f234a3f13
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This is a collection of monkey patches and workarounds for bugs in earlier versions of Numpy. """ import numpy as np from astropy.utils import minversion __all__ = [ "NUMPY_LT_1_21_1", "NUMPY_LT_1_22", "NUMPY_LT_1_22_1", "NUMPY_LT_1_...
1da1c02e839d922829728f81558da3f1978f36ec0bf83b14ea717bd466058e52
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test all functions covered by __array_function__. Here, run through all functions, with simple tests just to check the helpers. More complicated tests of functionality, including with subclasses, are done in test_functions. TODO: finish full coverage ...
c7ecac58bf9dd381c3a11f523785db6fd6fc508e18048f762d34f65c8d85a44f
# 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....
222e5178ffbebaa3f7483fa4d4f08aba6bc44924f81a0be78edfb5bce13e5530
# Licensed under a 3-clause BSD style license - see LICENSE.rst import matplotlib.lines 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 units as u from astropy.co...
cd232a6fd2b18440bc6b94f8459293260ee047bf3e176b841d4b528c64096f01
# 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_...
6a45b68a20704a52fe738cd76ab6316f2d62763518bf8035dddd4597bb66e4df
# 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...
6717ab08fbd0d9ee2749f190d23b26bb6f8146e8d5bca975a3aafc4d687e93f2
# Licensed under a 3-clause BSD style license. See LICENSE.rst except # for parts explicitly labelled as being (largely) copies of numpy # implementations; for those, see licenses/NUMPY_LICENSE.rst. """Helpers for overriding numpy functions. We override numpy functions in `~astropy.units.Quantity.__array_function__`. ...
811f3645dd3a6fa46bf183467787a351f82a815c5d251410c36d8d7ab7c4d9d6
# 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...
bc67b4d4e4ac2d8718789a9700b8516297560f01edf22339e5068b01415c369a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Regression tests for the units package.""" import pickle from fractions import Fraction import numpy as np import pytest from numpy.testing import assert_allclose from astropy import constants as c from astropy import units as u from astropy.units imp...
549bb55cb9286c6f249e3b1a505e25272d4704107eec37db871540b2350a2989
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import itertools import numpy as np import numpy.lib.recfunctions as rfn import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.units.quantity_helper.function_helpers import ( ARRAY_FUNCT...
156d5f6f2066064261759f812efec6eb9249721a64178f11da94418bfed55c67
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numbers import numpy as np from astropy.units import ( CompositeUnit, Unit, UnitConversionError, UnitsError, UnitTypeError, dimensionless_unscaled, photometric, ) from .core import FunctionQuantity, FunctionUnitBase fr...
7407e61683cb22ac667755daa5f694b66887249d2d3e6a48f8edcd0876645934
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Function Units and Quantities.""" from abc import ABCMeta, abstractmethod import numpy as np from astropy.units import ( Quantity, Unit, UnitBase, UnitConversionError, UnitsError, UnitTypeError, dimensionless_unscaled, ) ...
dbdf028420344eed861bece2d6bb9c6c666f9137e87ef2b8949b69c38be57fc6
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package defines units that can also be used as functions of other units. If called, their arguments are used to initialize the corresponding function unit (e.g., ``u.mag(u.ct/u.s)``). Note that the prefixed versions cannot be called, as it would ...
633912434436c57e9dd33f29053f10e405a0d2f477e73887f0d6391a652ca27e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy from collections.abc import MappingView from types import MappingProxyType import numpy as np from astropy import units as u from astropy.coordinates import representation as r from astropy.coordinates.angles import Angle from astropy.coordi...
1f19fb31c20ee22a4f5ac94de004c4401c4d921b58703fdd85415d4d8cb65d24
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains the coordinate frames implemented by astropy. Users shouldn't use this module directly, but rather import from the `astropy.coordinates` module. While it is likely to exist for the long-term, the existence of this package and de...
49974e4f90aa06ca6016746001c6778b270831537f71d572439440e885e2bef0
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy import units as u from astropy.coordinates import representation as r from astropy.coordinates.attributes import DifferentialAttribute from astropy.coordinates.baseframe import ( BaseCoordinateFrame, RepresentationMapping, base_do...
ad4d3c7eb89b67a636701078afe4a42440f9ef4d2f431da20126ce5c08434545
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the SkyCoord class. Note that there are also SkyCoord tests in test_api_ape5.py """ import copy from copy import deepcopy import numpy as np import numpy.testing as npt import pytest from erfa import ErfaWarning from astropy import units...
2cfb7a7a2a3b8bf2081d54767f8c94678fa45e694a1cf104e8389683fd3d6435
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Define the Enhanced Character-Separated-Values (ECSV) which allows for reading and writing all the meta data associated with an astropy Table object. """ import json import re import warnings from collections import OrderedDict import numpy as np fr...
e3e509f81f2537a2acb8cac6f4e42b45afb957facb7ba2cf2eb3154ec944e999
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ .. _warnings: Warnings -------- .. note:: Most of the following warnings indicate violations of the VOTable specification. They should be reported to the authors of the tools that produced the VOTable file. To control the warnings e...
f6e6162db6db1d02886d0459c49d6864c7759b211af0a106bef2efc81177a595
# Licensed under a 3-clause BSD style license - see PYFITS.rst import contextlib import copy import gc import pickle import re import sys import warnings import numpy as np import pytest from numpy import char as chararray try: import objgraph HAVE_OBJGRAPH = True except ImportError: HAVE_OBJGRAPH = Fal...
4282bd7f8842f9239f5491dfdd733c2ab71cf0b18b630356933fa3456514245b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some methods related to ``CDS`` format reader/writer. Requires `pyyaml <https://pyyaml.org/>`_ to be installed. """ from io import StringIO import numpy as np import pytest from astropy import units as u from astropy.coordinates im...
b3de76b8281e30193c41a848d88f02f10f25977057cfcdcc5f89bc9d188fc63c
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import io import os import re from contextlib import nullcontext from io import BytesIO from textwrap import dedent import numpy as np import pytest from numpy import ma from astropy.io import ascii from astropy.io.ascii.core import ( ...
1f0bb87f615dd70c96d2e6de2d58279b18de4ecbad4a33fd7858cf7942b16b50
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some of the methods related to the ``ECSV`` reader/writer. """ import copy import os import sys from contextlib import nullcontext from io import StringIO import numpy as np import pytest import yaml from astropy import units as u ...
320bfb64e24a55d504ee83c9d00ae953852b20e449588302c20106008179e5ed
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import os import pathlib from contextlib import nullcontext from io import StringIO from itertools import chain import numpy as np import pytest from astropy import table from astropy import units as u from astropy.io import ascii from astro...
c4343435c7f3d1b788775955e510f334d85342310ca3b7e18e82215d8d1ab03a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from asdf.extension import AsdfExtension, BuiltinExtension from asdf.util import filepath_to_url # Make sure that all tag implementations are imported by the time we create # the extension class so that _astropy_asdf_types is populated correct...
9d999760768a81dadca101cb70f487b7924cc2a11215fb8fa46ec33a77dbcf4a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") from astropy.table import Table # noqa: E402 def make_table(): a = [1, 4, 5] b = [2.0, 5.0, 8.2] c = ["x", "y", "z"] return Table([a, b, c], names=("a", "b", "c"), meta={"name": "first ...
b1a58ec2f48c4a295ce7631495aa42b2dee3847d3052865c052eeccf971ad580
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling import math_functions from astropy.modeling.math_functions import * # noqa: F401, F403 from astropy.modeling.math_functions import __all__ as math_classes __all__ =...
f408840388fda923b13d5de0cc3248bf44e48622b27cd6d447c3f9ff23a58109
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") import numpy as np # noqa: E402 from asdf.tags.core.ndarray import NDArrayType # noqa: E402 from asdf.tests import helpers # noqa: E402 from packaging.version import Version # noqa: E402 import astro...
ceb2412f128c5ff9d2fdbd6c675138d04d5d92d3d726bbc4e5d286c9dcda0133
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") import os # noqa: E402 import numpy as np # noqa: E402 from asdf.tests import helpers # noqa: E402 from astropy.io import fits # noqa: E402 from astropy.io.misc.asdf.tags.tests.helpers import ( # n...
f8512a80ee445ce986be049408c185fb296e6885a46bf3270632b966039c8123
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") from asdf.tests.helpers import assert_roundtrip_tree # noqa: E402 from astropy import units as u # noqa: E402 from astropy.modeling.models import UnitsMapping # noqa: E402 def assert_model_roundtrip(...
4247784a5195f5f845fe3c66bd1f6b3f809d2d6afc00d921fb4517495da5bb63
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") import warnings # noqa: E402 import asdf # noqa: E402 import numpy as np # noqa: E402 from asdf import AsdfFile, util # noqa: E402 from asdf.tests import helpers # noqa: E402 from packaging.version ...