hash
stringlengths
64
64
content
stringlengths
0
1.51M
926107043fbf13e2462c937c61efbcb9ab47413883b0652fe359834b4d39aab8
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import os from os.path import join import os.path import shutil import sys from collections import defaultdict from setuptools import Extension from setuptools.dep_util import newer_group import numpy from extension_helpers import import_file...
f8f050e69690ad8d2c249f2df0cd67ebb6cfbdf33e46328657a1fa3e3d09f8d7
# 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...
da726047ebb24c42a76b25ae71bf416e2b24abb9006e11fb95c8b3b7ca564503
# 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 os im...
c25c1a7b242aa994301a16646a66a6fec71bf62df13006b24c1a81fa76dd6f06
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Time utilities. In particular, routines to do basic arithmetic on numbers represented by two doubles, using the procedure of Shewchuk, 1997, Discrete & Computational Geometry 18(3):305-363 -- http://www.cs.berkeley.edu/~jrs/papers/robustr.pdf Furtherm...
53933c60f392ea5d0f0cf6c864e9de3c2fa04c8e144a72488d39c5c537cbfe63
# Licensed under a 3-clause BSD style license - see LICENSE.rst import fnmatch import time import re import datetime import warnings from decimal import Decimal from collections import OrderedDict, defaultdict import numpy as np import erfa from astropy.utils.decorators import lazyproperty, classproperty from astropy...
33528510d9720812eb7336678db328a5d9033499494aaf092f9737d7265fb448
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ['quantity_input'] import inspect from collections.abc import Sequence from functools import wraps from numbers import Number import numpy as np from . import _typing as T from .core import Unit, UnitBase, UnitsError, add_enabled_equivalencie...
cbe40d5345b69ac80bbc66977f447ecbd1cd4efc98a89d7adefda0e432cd06f4
# 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 ...
2458707807fb6adcfad398f526064825f63b40f5b4e7e5c954727affe1efe7ed
# 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>`...
c9f4dba9d73b1f525c468ffede1e00c68adf2706f6fbc7c8cee169072895d1b6
# 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 ...
f88605d597c02562db1248d829743eaa7c1a705b0271139cf8f4f83cbc4405cb
# 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 im...
219e35036e67c0c0459caf1f3d88d2eca18d0df1fbdd0eea05c5021f6468202a
# 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...
b87249b76d9cd3855bb3a1c11f023eda9852c2e30e13f71d270f551f41582d8c
# 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, binary_prefixes, def_unit, set_enabled_units, ...
0a09058c235717f4561587871b03f2733d0e77d5ddb1a8eb3dd543a5365c3ac1
# 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)...
b5e303b014b3ccadc9d0d04f1792954aa5814f945b58539e5aee858be8fb1b52
# 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,...
d6e5d3cc90bcf3c8a4ac50e47fe0d50bf8f55787bf45f4e54d4be3cc10a5a835
# 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. ...
2c521c1cdd85b63fa69f00ba234d7c86ff54ce102d8d694c02102c7196deee4a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module defines structured units and quantities. """ # Standard library import operator import numpy as np from .core import UNITY, Unit, UnitBase __all__ = ['StructuredUnit'] DTYPE_OBJECT = np.dtype('O') def _names_from_dtype(dtype): "...
1c0deebb215169b1574351866361d08be5c44a4b3cd0aab54c36dff00cc3931f
# 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...
8ec551f4e1e52934b30c32914e089688040da23fff56c16e346a66e7b44f96ab
# 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() #########################...
3f4b96e722bda106e67724afb599fbacc35118585a560402abaf3143f1922cd8
# 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 ...
c8e0cc4a421b2a8c09f82ed6547a7d0525a5f0cb052bd9d87c9665f08c575621
# 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 #...
2af6d0b9895280b6f0c273903b8daf794be046081600f9d24387c846025194d3
# Licensed under a 3-clause BSD style license - see LICENSE.rst ''' This module defines custom errors and exceptions used in astropy.coordinates. ''' from astropy.utils.exceptions import AstropyWarning __all__ = ['RangeError', 'BoundsError', 'IllegalHourError', 'IllegalMinuteError', 'IllegalSecondError', ...
a7f1b04eb77ec9675e08daf0dfb95b0863e57bba5add3cc447addd6406662509
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Utililies used for constructing and inspecting rotation matrices. """ from functools import reduce import numpy as np from astropy import units as u from .angles import Angle def matrix_product(*matrices): """Matrix multiply all arguments toget...
c91e69157f2030377cd5172678a1b220493bbfd5658ed03cb08305f434db766d
import re import copy import warnings import operator import numpy as np import erfa from astropy.utils.compat.misc import override__dir__ from astropy import units as u from astropy.constants import c as speed_of_light from astropy.utils.data_info import MixinInfo from astropy.utils import ShapedLikeNDArray from ast...
bb5c9a27cf338a975891b24eed83264676bc783b706220e99b3fe23b17cb52fe
# -*- 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...
d0b30bb7bfd9167d00ec7d4e4c616c8efc9b8bfdf9aa8ac4bfc0a72fc1e9197f
""" In this module, we define the coordinate representation classes, which are used to represent low-level cartesian, spherical, cylindrical, and other coordinates. """ import abc import functools import operator import inspect import warnings import numpy as np import astropy.units as u from erfa import ufunc as erf...
0970b501a50e042dad8e988004ce8c7133591b390bbd2c95b23a9bec54073876
# 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', 'uniform...
f9b4014cc3fe0bbd048fab23e4832b576094bcb26adc62bd1b4f3b558a1dde20
# 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...
4f0bfcf5daaa6e01dd1c8f5383b4afc0bd63777c84efbd8504de3e92d0e7dda1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the classes and utility functions for distance and cartesian coordinates. """ import warnings import numpy as np from astropy import units as u from astropy.utils.exceptions import AstropyWarning from .angles import Angle __al...
dcf1931e15b6a49ce33f8e7d40e82ba8c7bae9a79e4af3d6b5e8a56159a14e0b
# 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...
5063f5117cb8b22fe51bd2e1edc1ef5c2e677633a9b00a5cee7277b70e8d1a8e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re from collections.abc import Sequence import inspect import numpy as np from astropy.units import Unit, IrreducibleUnit from astropy import units as u from .baseframe import (BaseCoordinateFrame, frame_transform_graph, ...
92044c9d4603dd309f8307168f5443bc564552e9431f797eccee59db853d9d1a
# 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 from collections import namedtuple, defaultdict import warnings # Dependencies import numpy as np # Project from astr...
3b57c4e9ce41b876d661ab04c2fb3c382bea88fd9a507f4f532c0026a26f21ce
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains the fundamental classes used for representing coordinates in astropy. """ import warnings from collections import namedtuple import numpy as np from . import angle_formats as form from astropy import units as u from astropy.uti...
d6acd7d0446179f26dc4d7affdb79cba7f6df42823282b6e0f1a54fd4362a535
# 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', '...
b8d236ebfac62ef8667dff66db09e4a5f2383ef0d4cc4dc94621c7d31a86f687
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Standard library import re import textwrap import warnings from datetime import datetime from urllib.request import urlopen, Request # Third-party from astropy import time as atime from astropy.utils.console import color_print, _color_text from . impo...
6b50d8f392d524d972cbed9aa80649d3bbbdcee096b0e733d99a6d8010bd4119
"""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...
313368b85e2e874f7216a08dbacf4b098ab67c0cc845562731d3ed4da53c1bcf
# 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...
c6060beb2def2c61474e488ded6ae8e5e8674ad994aedc06f425f9d077661468
# 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 ...
faab05af5a2418826ab2182b35a5cd0bf42e4ad760dce9e05ec19bb614c87909
# 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, Mapping, TypeVar import numpy as np from astropy.io.registry import UnifiedReadWriteMethod from astropy.utils.decorators import classproperty from astro...
db8e84fb9e2f8fa5b11fb39c4e938c4efc9ecaf4f23c8c15d2bd298713e66638
# 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 equivalen...
e722e028f9d2e47f4f00df682cba40db5ba4211657542f13341c4c936ef184a6
# 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 .core import Cosmology _COS...
ac10eb76a4b9fa6607c87b0965e56fa5655546202883defc64ecf115a91b78a7
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] l...
7debf4a4f9e4cd4afc688b76f05d4173786af3b6d840a93df478dccc73dcaca0
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 rayleig...
15938acb3d0bd6fee679776d69f94131a53762283338ac46552fed25617c54df
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, 10...
faaee3d141a81405106d57477f1ebbde3e1d7277b23e59aec518bd331453073f
# 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...
16e2e39f0e65a6403b4df9abba31be76237a0fd1e427dbb860ffec9b8d556264
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'), ...
36781491e5b369591376e0731e778eb57bb11553caec5352be77a05d352a5466
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.tests.test_metadata import MetaBaseTest import gc import os import sys import copy from io import StringIO from collections import OrderedDict import pathlib import pickle import pytest import numpy as np from numpy.testing import asse...
e93854d462738c1a3cbefa2300f9a1fc2db8b559e4434a6e050579482dd3f914
# 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 astropy import table fro...
49d9ab7d9f346563f4ac21bcb23d0c5747d9b5d871f746807ab965454ae061c3
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...
24c58c555eafd5e877d150a7e2c3d9bd7e1a571f76941855bdd15f7952287594
# 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 ...
20c9f57c2eb6741c22842bf5418cc1eca996f04436a249c8d1e37c0a28bb84f2
import os import re import numpy as np 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, '....
53a02884d2a66520a099cb88256d52de64e52392aa95320054f5fd01e56b00ae
# 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): pass class MyTableCo...
aee33a85b110525749e09d487b63f2d9593000dcb6541834e8b6443dc2b19db9
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, ...
196182825e9df1a9b5b8610afdf8b73d98eca8c93af063676d6d666c394fd0db
# 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 ...
eb006a080678cd52a97c6455bd90f2a537a1e7ae8d7ceadfe9d0f3d05718e00b
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.utils.tests.test_metadata import MetaBaseTest import operator import warnings import pytest import numpy as np from numpy.testing import assert_array_equal from astropy.tests.helper import assert_follows_unicode_guidelines from astropy impo...
c7719415693adf869cf20249c8a04b5c428e803f6cfdf7ce3fb26bdc76258c12
# 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_helpers import ArrayWrapper ...
eafc44aee242fbe16b5d6d2664c0ee4502c62690197bb9266449a9caec418aea
# 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_table from astropy import units as u from astropy.util...
8fbec438884abdae59875fec7f5c73a67b2e83e264ef2f9b3360eb519795fbe5
# 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 ...
c9669ce4699102b98897ed1e4a2276544fa6addced52988b6f7a59cdc309279b
# 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...
014f37139b8e0c333e107a21dffcffae1be054109a16871a411cda82246ef5b4
# 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...
009485797fd80b8658d732d64a22be481fefb067b22a67cab6b781bf863d1b93
# 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_filename from astropy.utils.exc...
2489af990e66d1af3a2f711ed276b6d7f599080f270bfa9141d9908f056aecd3
# 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...
f28105ee94da23b4d054d8507a92511c971806543c12a91ad6315a4729449efa
# 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, _BaseSelectorArgume...
faa6758cad40b2f0f052dee47c2dab95990c0fdb8b54726dbd9ff206345a9b73
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for spline models and fitters""" import unittest.mock as mk import numpy as np import pytest from numpy.testing import assert_allclose from astropy.modeling.core import FittableModel, ModelDefinitionError from astropy.modeling.fitting import ( ...
239a1767ee6e27c90d12c8664dbc2b8573c5c2dfa89142356cf0e67fe6b3593b
# 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...
aab09909534fc1531327e6da41fc63cbe186db96a8c7811c3698ebf86cc93116
# Licensed under a 3-clause BSD style license - see LICENSE.rst # pylint: disable=invalid-name, no-member import numpy as np import pytest from astropy import units as u from astropy.modeling.bounding_box import ModelBoundingBox from astropy.modeling.core import fix_inputs from astropy.modeling.fitting import DogBoxL...
bdff4af521e02da06a941aa86c05511745f96983a5ed2ddaa66ea373d22d602a
from .iers import *
ae4db7c61c0ab9702090bac360fc8908a9ff56ab7c067158971743d57055424c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module includes a fast iterator-based XML parser. """ # STDLIB import contextlib import io import sys # ASTROPY from astropy.utils import data __all__ = ['get_xml_iterator', 'get_xml_encoding', 'xml_readlines'] @contextlib.contextmanager def...
5a9f3e7b2afe92c114c224c7aeb929fe04a77d42110d2657678051a25dfdde4a
# 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 pytest import numpy as np from astropy.utils import data, misc from astropy.io import fits def test_isiterable(): assert misc.isiterable(2) is False a...
22a4668e3a745dce40d8f03f0b8dc58aaecd240cc262c190acc3a53bfd9d4852
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from astropy.utils.data_info import dtype_info_name from astropy.table import QTable from astropy.table.index import SlicedIndex from astropy.time import Time from astropy.coordinates import SkyCoord import astropy.units ...
3fce94f0cb1eaf6f155b15cba34ff25420749d6d40a134d2c7796892feb592d7
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import os import sys import stat import errno import base64 import random import shutil import hashlib import pathlib import platform import tempfile import warnings import itertools import contextlib import urllib.error import urllib.parse impo...
29c4559962daaed2eda4b91ac3da247da506dc27b0c02bdea4086ccd84da6385
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import pytest from . import test_progress_bar_func from astropy.utils import console from astropy import units as u class FakeTTY(io.StringIO): """IOStream that fakes a TTY; provide an encoding to emulate an output stream with a spe...
2874cdd5f139057a176ee2fcd0b0f886f0d2280ea6406c94f349bd6c348ae9b6
# 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 `...
43016585b39c175366044bee48452701a4fa4191d5b2259b566b5f8572e046a6
# 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`....
60771ddfa1a7f6ed29079feabde2af2d1754418422e216152aa341df0cd4d1b1
# 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_19', 'NUMPY_LT_1_19_1', 'NUMPY_LT_1_20', 'NUMPY_LT_1_21_1', 'N...
484a53b378a55661f1384b2c4f941f8571814023d0bc5ed9d522db31e608c58b
# 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.table import QTable, hstack, vstack, join from astropy.utils.masked import Masked from astropy.utils.compat.optional_deps import HA...
bf12a1c3f784033ff51608312be8b46df5527c0dc24760167bc3f4f5f6e9e6f7
# 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 from numpy.testing import assert_array_equal import pytest from astropy import units as u fr...
7305b7c093c44b443e70b4decfdca72f68b97ab595e3c6d7bacfbd8ffdd68385
# 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 SkyCoord, representation as r from astropy.time import Time from astropy.utils.masked import Masked class Test...
5788a5760fc9af2b983413284971c50089e12dfd648e61b0ff4938eb9a1b5960
# 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 ...
335b0da6a0a90074c2978ec557741b98f4be23ece77fa4625d47e8dafde672dd
# Licensed under a 3-clause BSD style license - see LICENSE.rst from textwrap import indent from collections import OrderedDict from .coordinate_helpers import CoordinateHelper from .frame import RectangularFrame, RectangularFrame1D from .coordinate_range import find_coordinate_range class CoordinatesMap: """ ...
0536edb77b3f4ecdafbb784365d46dedab7f90fdc084a3122408636d5fe60d36
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import pytest from astropy.utils.compat.optional_deps import HAS_PLT if HAS_PLT: import matplotlib.pyplot as plt import numpy as np from astropy import units as u from astropy.coordinates import Angle from astropy.visualization.units impo...
a3abce9b794f648eeee5ec5299469e0baea030b5101c79828d9958143bbd2425
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest pytest.importorskip('matplotlib') # noqa import matplotlib.pyplot as plt import matplotlib.dates from contextlib import nullcontext from erfa import ErfaWarning from astropy.time import Time from astropy.visualization.time import time_su...
7ba5c68c2796901587d84802294b95cf022533bf9876fe6e02d4e9970e22a072
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings from packaging.version import Version import pytest import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.contour import QuadContourSet from astropy import units as u from astropy.wcs import WCS from astropy...
402837800849df233960829ea11da410e632056ecdf618ee2f45597cb32ca99e
from astropy.nddata import NDData, NDIOMixin, NDDataRef # Alias NDDataAllMixins in case this will be renamed ... :-) NDDataIO = NDDataRef def test_simple_write_read(tmpdir): ndd = NDDataIO([1, 2, 3]) assert hasattr(ndd, 'read') assert hasattr(ndd, 'write')
65ea7ca6cfb409109e804cd19e8678b7a6fdeb0714e03bf5d2bc30c73fc8dd4e
import os import abc import numpy as np __all__ = ['BaseLowLevelWCS', 'validate_physical_types'] class BaseLowLevelWCS(metaclass=abc.ABCMeta): """ Abstract base class for the low-level WCS interface. This is described in `APE 14: A shared Python interface for World Coordinate Systems <https://doi.o...
bf735d3e5c7fcb3418b3e0967bd8c1285775e898a5c1749eb3f6aee4b38d4727
# 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...
c1a891af6c441624e237d08deeb3bdd0d0595fb388c1d83fae3a4d806495fb71
# 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.coordi...
e029a7fcd54265dec9d892047e844b6a34e1459148454fca12f47bae21000d2e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings from contextlib import nullcontext import pytest from packaging.version import Version import numpy as np from numpy.testing import assert_almost_equal, assert_equal, assert_allclose from astropy.utils.data import get_pkg_data_contents, ...
3f5b9be6f8a45ba4fdad55b3f41928d7ca432913d9f69e1dc8fbb005224f95d1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import io import os from contextlib import nullcontext from datetime import datetime from packaging.version import Version import pytest import numpy as np from numpy.testing import ( assert_allclose, assert_array_almost_equal, assert_array_almost_eq...
3ddedd7ee830a2398eb1b755021a6d82f89931a5bec183f75b46f4b5764fb503
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Tests for the auxiliary parameters contained in wcsaux from numpy.testing import assert_allclose from astropy.io import fits from astropy.wcs import WCS STR_EXPECTED_EMPTY = """ rsun_ref: dsun_obs: crln_obs: hgln_obs: hglt_obs:""".lstrip() def tes...
a63d81c09307399eaef393af9f68ab392602b3b4366ee882866d9b0e046000af
# Licensed under a 3-clause BSD style license - see LICENSE.rst import gc import locale import re from packaging.version import Version import pytest import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from astropy.io import fits from astropy.wcs import wcs from astropy.wcs imp...
89ed2a3746da4c2c99da0eb15c23e3fd48e87c93ea33d4ab590457a99c6d1a3c
import numbers from collections import defaultdict import numpy as np from astropy.utils import isiterable from astropy.utils.decorators import lazyproperty from ..low_level_api import BaseLowLevelWCS from .base import BaseWCSWrapper __all__ = ['sanitize_slices', 'SlicedLowLevelWCS'] def sanitize_slices(slices, n...
436046348e98f3fe038e301b923f09a05c74c7671efe8a75ffa0b74a8ca208dc
# 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 packaging.version import Version import numpy as np import pytest from numpy.testing import assert_equal, assert_allclose from...
6c917b9ae11646e4554b59a97aea10c752fb96588d0c85c961c7f4aef33baae1
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import itertools import operator from decimal import Decimal from datetime import timedelta import pytest import numpy as np from astropy.time import ( Time, TimeDelta, OperandTypeError, ScaleValueError, TIME_SCALES, STANDARD_TIM...
4a508978a6adc72c65f73aaccdd78238b6b55a8a7af2db08805d8db6037af758
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import copy import functools import datetime from copy import deepcopy from decimal import Decimal, localcontext from io import StringIO import numpy as np import pytest from numpy.testing import assert_allclose import erfa from erfa import Erf...
f3f1bb6fd1bfb14f04faebe2b49f5ce0a34fa988b11864208d2fafaa404f7494
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import itertools import pytest import numpy as np import erfa from astropy import units as u from astropy.time import Time from astropy.time.core import SIDEREAL_TIME_MODELS from astropy.utils import iers allclose_hours = functools.part...
e91a4c0ed98ee734d8b02abeac85f52a9bae5776a795e9e0bf41dbdce20d38b2
# 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 # ...
c18a6b2eaf36843eeede9d26c15910a798064e0fb1c7cd3dcaaee40111b6701c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "Console" unit format. """ from . import base, core, utils class Console(base.Base): """ Output-only format for to display pretty formatting at the console. For example:: >>> import astropy.units as u >>> ...
7381d22354adc4a6f652df06141e5537ebce362843821741b25bca1c242e2763
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "VOUnit" unit format. """ import copy import keyword import operator 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 im...
3a717c8ceb7f9a2ecfe283f660fa2c8c5e16e15ba4cb0c586082f34124ac61c2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles the "Unicode" unit format. """ from . import console, utils class Unicode(console.Console): """ Output-only format to display pretty formatting at the console using Unicode characters. For example:: >>> import astro...
5e257f847eca9c9432f227b47c7c92bbc4440220fbfa78bd9241294992996c27
# 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 # ...