hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
991b3b5b511eb684dcecb40139c00b7452e12f6491479f01e7ead86dbc636104 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
__doctest_skip__ = ["quantity_support"]
def quantity_support(format="latex_inline"):
"""
Enable support for plotting `astropy.units.Quantity` instances in
matplotlib.
May be (optionally) used with a ``with`` statemen... |
795b532e029242316028c1b1c8359e23c25eb39c83e5a175ec03b83b8d96b5e8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from datetime import datetime
import numpy as np
from astropy import units as u
from astropy.time import Time
__all__ = ["time_support"]
__doctest_requires__ = {"time_support": ["matplotlib"]}
UNSUPPORTED_FORMATS = ("datetime", "datetime64")
YMDHMS_F... |
f8b526b91a4536a2e6f5227fff29bf5a6d6c9b273c1ef29cb7756c1981c1d658 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from copy import deepcopy
from functools import wraps
from inspect import signature
from itertools import islice
from astropy.utils.exceptions import AstropyUserWarning
from .nddata import NDData
__all__ = ["support_nddata"]
# All su... |
71843f6a059ed1f664bed9106b7e49a0421ff00a52c91dbe15163fee6b16a3eb | # 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... |
1c2630d394875365d5f299686d32a3fe3eb39557f9feb59adf557685b1ece835 | # 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... |
65ea3d216059e45bf0be4b04c4807147676494f344b9a2c033ed115d4592386a | """
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... |
a7f00f56eb9785d0d28a937d58258b6f1c56168b6f945756c5294d1ce2f7d4be | # 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... |
ac8d7e57aeb42956f8650a4cd0c541739f905f6620fe1f7af76cd4e346a554b4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module includes helper functions for array operations.
"""
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.io.fits.hdu.image import Section
from astropy.utils imp... |
2636ee0bc378587af528f50b9415d7e2e6bfd13512fcd76ddcd6c50d5809e521 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module contains a class equivalent to pre-1.0 NDData.
import numpy as np
from astropy import log
from astropy.units import Unit, UnitConversionError, UnitsError # noqa: F401
from .flag_collection import FlagCollection
from .mixins.ndarithmetic ... |
b11c5e9f564f65806beba5d0cd66d426121e540c3ebf34d6aa970308d899cbbb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements a class based on NDData with all Mixins.
"""
from .mixins.ndarithmetic import NDArithmeticMixin
from .mixins.ndio import NDIOMixin
from .mixins.ndslicing import NDSlicingMixin
from .nddata import NDData
__all__ = ["NDDataRef"... |
e063e8d0fe7d4f8c35bbb3fbed23bdf57e585d6776ea46531f6c8b7761b21a84 | # 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... |
3a25d35499a5da1c1b98a4685d25f93b6498aef26403e3ac77583d55582f5901 | # 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... |
60ae849657f93cdc875f84e6de309e48abd12823076ec2121918307967af4f79 | # 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
... |
5b11966ec42c7ba1ee2f422b92289a0d0e994d50a6da9c345200dc019dd0cbbc | # 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,... |
6abae9ecca014008e736e6c970572720c41805c35f4c63224da14e6121aeb26b | # 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_en... |
2d063beebb6eba16f9e8e0b87b413573cf0226945f214659ae8a56727b2bb9a9 | # 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... |
0dacb06cee61c5e804999a9832183f407b06332659840ed0e56b9efaa753d244 | # 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... |
0e8988ccae2b9d51f7d290eaa5d01c623e2fc112dbc341d28d73f8981d7aa151 | # 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()
#########################... |
90188c3e789729d2658473472a0a6efab3a552068ae8e39cbe9325a64c07a743 | # 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... |
ea2a66234766112c6761320e8010f1e37f33d23a0beafbe1d402e4c89afbe74a | # 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
#... |
632ad0b437cb70ae17479c99c821bec88dc1b1abb1234e1377a835b23ddc5ce4 | # 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",
"IllegalSecon... |
0ea9e67f77ea290fd3a3f6e2dff339bb29e4e5903b82df5b664cc4f2841c6deb | # 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 astropy.utils import deprecated
from .angles import Angle
@deprecated("5.2", alternative="@"... |
6eba8e142fec825332804db519dc07cd27ae88782c54f9b6e65027835ee0ace8 | """
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... |
36d0da89fd7fcba13154762f7f0de1365686b9deb2ae4369616c6f61c8b741a6 | # 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... |
606b890f74a7174caf7f359a26d5047dcc75f00e86e4789ec8a06d59ae3415a3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions implementing some of the
algorithms contained within Jean Meeus, 'Astronomical Algorithms',
second edition, 1998, Willmann-Bell.
"""
import erfa
import numpy as np
from numpy.polynomial.polynomial import poly... |
3c0a7845ce6b4af83204353d8be5797f8bbc55e98f6f1dba3fbd12bcb7bdb449 | # 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... |
602cc5bfcfd4f808a3106ff210612e46cdf8117517a4ec2bf4d8ca1e5f2fe299 | # 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... |
3e3285e5a6fd88ed33f74255eacdee6e2a77cd33cfee40a7bf8a55d8c61808f4 | """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 shutil
import stat
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from setu... |
1c8e12abb993f7e75ff203f093ae81357585e9a45ac8f79afb34ef1a2495389a | """Implements the Astropy TestRunner which is a thin wrapper around pytest."""
import copy
import glob
import inspect
import os
import shlex
import sys
import tempfile
import warnings
from collections import OrderedDict
from functools import wraps
from importlib.util import find_spec
from astropy.config.paths import ... |
1f464e42210d84e4fc553a7c4950e8bfe344ac706376181fd05cd73e5af10ff8 | # 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
... |
1637ce59ac7b8e1dff41c8402a02874fe6775b8554c47d7694a64d8a6243baea | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict, UserDict
from collections.abc import Mapping
import numpy as np
import pytest
import astropy.units as u
from astropy.table import Column, MaskedColumn, QTable, Table, TableColumns
class DictLike(Mapping):
"""A ... |
2790e5c04991dd53c693f2cf959d57011abdc71a64584548d91bacda1e032c9e | # 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.utils.compat import NUMPY_LT_1_22, NUMPY_LT_1_22_1
fro... |
5aed3d06d852ea5490782f91524185d1ce72fce54fdc50fded4dcde4b0cd64fc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test behavior related to masked tables"""
import numpy as np
import numpy.ma as ma
import pytest
import astropy.units as u
from astropy.table import Column, MaskedColumn, QTable, Table
from astropy.table.column import BaseColumn
from astropy.time impo... |
19e15a26f132a14405add46dbebce70739d1225b3e951929f538c9f4d47c0151 | # 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... |
912fdc129cb91fdcca8dcb6f438cf0da132aa055773e1196310b0353d39e567b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test that Distribution works with classes other than ndarray and Quantity."""
import numpy as np
import pytest
from numpy.testing import assert_array_equal
import astropy.units as u
from astropy.coordinates import Angle, Latitude, Longitude
from astro... |
a9bda2d1e93736078453f34c4bc4185440e02e827a12f3e2a3cf03a33bd3ff1a | # 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... |
35b90e4725b3da34f5576fdff746afa354f47dc9156c5e33521c5e3bd4daf169 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name
from contextlib import nullcontext
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal, assert_array_less
from astropy import units as u
from astropy.coordinates import Angle
from... |
4dca908ba4dbc67444ee9599b535323d16279370038a468b790d7f836c5949fd | # 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... |
fc6866f0b00994a24abf37274d5c2f18587986eb5428d6064bc0264625f1ff14 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests that relate to fitting models with quantity parameters
"""
import numpy as np
import pytest
from astropy import units as u
from astropy.modeling import fitting, models
from astropy.modeling.core import Fittable1DModel
from astropy.modeling.param... |
0c5b5aa4a3a46f9cad3a84229e9233ad17d24aca6ec608b27ab97cc9a6be7380 | # 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... |
44423f15585771d7f6679f903232dcd5adc16056b071a14d6faeed0bd9e058ec | # 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 (
D... |
736741340f6b72746c04621825fbffa81deec80143bd562a5cccccba9a073499 | import threading
import time
import xmlrpc.client as xmlrpc
from astropy.samp.client import SAMPClient
from astropy.samp.errors import SAMPClientError, SAMPHubError
from astropy.samp.hub import WebProfileDialog
from astropy.samp.hub_proxy import SAMPHubProxy
from astropy.samp.integrated_client import SAMPIntegratedCli... |
e692d89b6cb836fc341000b4852d3ae71044f58de83c4b875949fe9878ab88d5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The astropy.utils.iers package provides access to the tables provided by
the International Earth Rotation and Reference Systems Service, in
particular allowing interpolation of published UT1-UTC values for given
times. These are used in `astropy.time`... |
1d47016a5092abad058dc89109a2afcb649a181d45cb05dad76878f4a9ef3465 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Contains a class that makes it simple to stream out well-formed and
nicely-indented XML.
"""
# STDLIB
import contextlib
import textwrap
try:
from . import _iterparser
except ImportError:
def xml_escape_cdata(s):
"""
Escapes &... |
d61009b904a4d8e0b459004de053603f953ad16efc1450fe791c6b3e0835b967 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from hypothesis import given
from hypothesis.extra.numpy import basic_indices
from numpy.testing import assert_equal
from astropy.utils.shapes import check_broadcast, simplify_basic_index, unbroadcast
def test_check_bro... |
31a8fd965eba156068d6cf7258255d512417a703cf71ae9f4d983e99a45db381 | # 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... |
dc4f420dbeeb3e356c7f1eece2c37a9e3e4996ddc7909743b377c321b15567b3 | # 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 `... |
845dafd84713eae8d2d1ebceea7d0cd6e5f7d2d35cfab85445fb65bf15f88d7f | # 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`.... |
615d4ccd141c70f66d603a40d2e826ed2d6e58d6ab09e5838581cb048e745020 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import warnings
from pathlib import Path
import numpy as np
import pytest
from astropy import units as u
from astropy.config import set_temp_cache
from astropy.table import QTable
from astropy.tests.helper import assert_quantity_allc... |
cc1b71c29ebafdace8b5feee327436500b47b2f657c7809d56b6fd88769efc33 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test numpy functions and ufuncs on Masked arrays and quantities.
The tests here are fairly detailed but do not aim for complete
coverage. Complete coverage of all numpy functions is done
with less detailed tests in test_function_helpers.
"""
import nu... |
458b955f6d4e13de1956c67c5b85fac4551344ae85ba4a30ecaae76bfd25da81 | # 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... |
925c2c522ce909a1d40516d67f6f408317feae9dac06fa0261129c97649a0d72 | # 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 ... |
279b868f0104ac35f7a17d58f2cfe4460a58fc1c2d4bcae650e7c66ffb9fde9f | # 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, ... |
0b77e7efaa298a4e22cbde0bada8ffcdd36ce3cb30e475c678da1c99c980a0e9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import units as u
from astropy.coordinates import BaseCoordinateFrame, UnitSphericalRepresentation
__all__ = [
"select_step_degree",
"select_step_hour",
"select_step_scalar",
"transform_contour_set_inplac... |
66b266e951dd8c45576ea5b4e47211a6630a17428bc818c578ce2b9f79634071 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy import units as u
from astropy.utils.exceptions import AstropyDeprecationWarning
# Algorithm inspired by PGSBOX from WCSLIB by M. Calabretta
LONLAT = {"longitude", "latitude"}
def wrap_180(values):
... |
4ee977ecdf52288562631692e71ce0cd24d508625e961f7b0b42ff49065fa098 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
import warnings
from collections import OrderedDict
import numpy as np
from matplotlib import rcParams
from matplotlib.lines import Line2D, Path
from matplotlib.patches import PathPatch
from astropy.utils.exceptions import AstropyDeprecation... |
14297e107c7e502879b60885309a57b73813620cb38f4d05a70871f464aeef93 | # 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 im... |
73fe3705957f09504af7eec059154a0ede63b9e948e0adef6fbc831c6938f42a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from numpy import ma
from numpy.testing import assert_allclose, assert_equal
from astropy.utils.compat.optional_deps import HAS_MATPLOTLIB, HAS_PLT
from astropy.visualization.interval import ManualInterval, PercentileInte... |
a9c2147e84c2a67a0908c464d0af96f3bfc01d7d40ca131d0d8488f018135b17 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy.io import fits
from astropy.utils.compat.optional_deps import HAS_MATPLOTLIB
if HAS_MATPLOTLIB:
import matplotlib.image as mpimg
from astropy.visualization.scripts.fits2bitmap import fits2bitmap, ma... |
c69a38dea486b56b186ae15d9cbdd0027daca5e3b63c04c20a3e07ede520c1a5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from contextlib import nullcontext
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pytest
from matplotlib.contour import QuadContourSet
from packaging.version import Version
from astropy import units as u
from ... |
74a005c702eb1788357fb3a5867c148b10cf49d8db497849d7cf8f9d2d5f8eea | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from numpy.testing import assert_almost_equal
from astropy import units as u
from astropy.coordinates import Angle, Galactic, HADec
from astropy.tests.helper import (
assert_quantity_allclose as assert_almost_equal_quantity,
)
from astropy.visualiza... |
7d547c065aa13a89c398fd93c8b47e9d2f2956234af2882f093ff6193f991924 | # 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... |
dd51570a44ff54eca813096aa0bcf0aa3efc6d28a2b9726834c77bfd3a07d712 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the Slicing mixin to the NDData class.
from astropy import log
from astropy.wcs.wcsapi import BaseHighLevelWCS # noqa: F401
from astropy.wcs.wcsapi import BaseLowLevelWCS # noqa: F401
from astropy.wcs.wcsapi import HighLevelWCS... |
b75dddf7259836f4293dd9fcde7e3bbcd11a30219a444d2a79d09452c6877efa | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the Arithmetic mixin to the NDData class.
import warnings
from copy import deepcopy
import numpy as np
from astropy.nddata.nduncertainty import NDUncertainty
from astropy.units import dimensionless_unscaled
from astropy.utils im... |
2da7ae81613ab2d812961ec7baf83f4c34c468502b85ccd64625b657b836854b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This module implements the I/O mixin to the NDData class.
from astropy.io import registry
__all__ = ["NDIOMixin"]
__doctest_skip__ = ["NDDataRead", "NDDataWrite"]
class NDDataRead(registry.UnifiedReadWrite):
"""Read and parse gridded N-dimension... |
55c87594b88874565c83a9cf01e465361bc0737bac2aa8ef7546d444ef1b4578 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from packaging.version import Version
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.nddata import (
CCDData,
Cut... |
bdc257a75e12ef1272f02fdd0e83e3e6aa0dcceb7e287de84416d20918b09cd9 | # 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... |
1f6f6b6f537ca7cda07e9532b8c8ac1bdcd77262496abdb735c350b44110b63e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pickle
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from astropy import units as u
from astropy.nddata.ccddata import CCDData
from astropy.nddata.compat import NDDataArray
from astropy.nddata.ndda... |
057b91f3fba6e126ba10724c74dca0f2ca4c6609b96a368509f1664a8ec5b1a8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal, assert_array_equal
from astropy import units as u
from astropy.nddata import NDDataRef
from astropy.nddata import _testing as nd_testing
from astropy.nddata.nduncertain... |
4eb717dde0a52b265843e0690d4572bdaf6777f5158045b233176484d3bf7d50 | 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 = [... |
88d39aada0e95659c922cea2c44fa00bacee429f0364af2d7435359045f41119 | # 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... |
1acc1034612d79a5ca13ecbf4bb336071a2a66936eea2b7b9b88751735c7dc4b | # 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... |
ce48d838df4f73e0efc95fdfa9812dd385d60d1f0d25127c94c063f3ba78b56b | import numpy as np
from numpy.testing import assert_allclose
from astropy.wcs import WCS
from astropy.coordinates import SkyCoord
from astropy.units import Quantity
from astropy.wcs.wcsapi.high_level_api import (
HighLevelWCSMixin,
high_level_objects_to_values,
values_to_high_level_objects,
)
from astropy.... |
1c9f7957e3f480f255377358491ddce7e563ebe76245be13f6afe234037339d6 | # 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_... |
081151758ef7a9c6bb036c1f5f3f82250c6b6ee16694b0c05c0784312e5d738c | import contextlib
import decimal
import functools
import warnings
from datetime import datetime, timedelta
from decimal import Decimal
import erfa
import numpy as np
import pytest
from erfa import ErfaError, ErfaWarning
from hypothesis import assume, example, given, target
from hypothesis.extra.numpy import array_shap... |
3c4c59b334998314ef5d72649a20d1fa57c79dfd4f900191fb54c93394f6f36f | # 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
# ... |
32699647e6d1cb56a01b4026087a7cc5f2a5048ba4845fb54b51b872a7003123 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "Console" unit format.
"""
from . import base, utils
class Console(base.Base):
"""
Output-only format for to display pretty formatting at the
console.
For example::
>>> import astropy.units as u
>>> print(... |
f7fbf0960d77a63c477d9817093db55b2efb7a5b6994a35ae873abd294cd62a2 | # 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 ... |
2d5c69726fb990a37a85a683041e8b22485eba5bdc04d707abc7f6a46403d362 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "LaTeX" unit format.
"""
import re
from . import console, utils
class Latex(console.Console):
"""
Output LaTeX to display the unit based on IAU style guidelines.
Attempts to follow the `IAU Style Manual
<https://www.ia... |
cf3f53b35624f5d3dd36263a2530b09e776b9351dee9c68366d1ba8fd7ec5936 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "Unicode" unit format.
"""
from . import console
class Unicode(console.Console):
"""
Output-only format to display pretty formatting at the console
using Unicode characters.
For example::
>>> import astropy.unit... |
69ccbf67ce1c8e0b0fa3fa9e53bd47e000f689eb93d43dd4e3a39c8442fdd845 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from . import utils
class Base:
"""
The abstract base class of all unit formats.
"""
registry = {}
_space = " "
_scale_unit_separator = " "
def __new__(cls, *args, **kwargs):
# This __new__ is to make it clear that t... |
a399ffb9d5aaafeeb33d99e4b205ae584e0eea3a7188fbef6f1606d7a8b77f72 | # 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
# ... |
c05ff363874c65f9d3f6a2be9d1bd37f73a0d48ee4d660bd6131e0d2fbe7be72 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities shared by the different formats.
"""
import warnings
from astropy.units.utils import maybe_simple_fraction
from astropy.utils.misc import did_you_mean
def get_grouped_by_powers(bases, powers):
"""
Groups the powers and bases in ... |
b07d517b548d53e8c12be201a8f598db61bb3bae1b530c9a68d172887e793fe1 | # -*- 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/units
#
# You can... |
a3b4ab090120d3d06dd86da152fa7ff015966e13ef976e5637fe0c35c9fbf6bc | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles the "FITS" unit format.
"""
import copy
import keyword
import numpy as np
from . import core, generic, utils
class Fits(generic.Generic):
"""
The FITS standard unit format.
This supports the format defined in the Units secti... |
5e82eeec1fa1a6451d2a4a1962ced9ad1d1805f855fb18502468b2e632326e0a | # 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
#... |
9456e35b7d78b28f8b4aaba78f2b0b129fd6b887db67004fd0b31f67e5ad051a | # 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__`.
... |
0478d84c0341a4893ca2399f494e4bf226c9532cdf4d0b70c8c38cb2053d4253 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
import typing as T
# THIRD PARTY
import pytest
# LOCAL
from astropy import units as u
from astropy.units import Quantity
from astropy.units._typing import HAS_ANNOTATED
def test_ignore_generic_type_annotations():
"""Test annotations that ... |
69883d015a1d56a100221116af41a4652e2017a48d9e55a70c4ed08fad6134b4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Test the propagation of info on Quantity during operations."""
import copy
import numpy as np
from astropy import units as u
def assert_info_equal(a, b, ignore=set()):
a_info = a.info
b_info = b.info
for attr in (a_info.attr_names | b_i... |
8a6ec59d800ed98359b143f29165c9d9888f708b0d83e2b1ce39be09b1f7809b | # 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... |
c44395f535130ffe3641ec49408b7277fb39f67ef9d39ad4258fc7c3fec4a08f | # 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... |
a5eed8ad7c1d9397b558eb03dd6104a69c62e3182e6d9145519d616a81b3c5ab | # 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... |
fe8ef21e9dae7b3dc4cdac382cb3022e03aaacd8d52a568194bb7cc9481fd60d | # The purpose of these tests are to ensure that calling ufuncs with quantities
# returns quantities with the right units, or raises exceptions.
import concurrent.futures
import dataclasses
import warnings
from collections import namedtuple
import numpy as np
import pytest
from erfa import ufunc as erfa_ufunc
from num... |
de44d6c18144d601d6c930b34a07647a4ebe2d55f41bc67da5c02f74e330fa71 | # 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... |
8e5897645d09f8335c59367e3c4fc9608fdfbf8b655f3fc14584d1ec29130907 | # 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,
)
... |
3425be4498b58bedb29338d8ddc1db276fcff5a6028019f08a7c77fc85a1f511 | import os
from urllib.error import HTTPError
import numpy as np
import pytest
from astropy import units as u
from astropy.constants import c
from astropy.coordinates.builtin_frames import TETE
from astropy.coordinates.earth import EarthLocation
from astropy.coordinates.funcs import get_sun
from astropy.coordinates.re... |
5455177ce2562ae86e68af39ec838c553c9dc9893164c8b4203a634fd8912888 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import representation as r
from astropy.coordinates import transformations as t
from astropy.coordinates.attributes import Attribute
from astropy.coordinates.basefr... |
5eea8327889344d150fa54eb01749e2411988ed50ec38abbbaec9561c005857d | import numpy as np
import pytest
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.coordinates import Distance, EarthLocation, SkyCoord
from astropy.coordinates.sites import get_builtin_sites
from astropy.table import Table
from astropy.tests.helper import assert_quantity_al... |
7773f634a58f4609f7c57d5beccfc6ac615c87be1daca94f47f2223cda3656f0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import builtin_frames as bf
from astropy.coordinates import galactocentric_frame_defaults
from astropy.coordinates import representation as r
from astropy.coordinate... |
0babc602ce72ae5b5576067b344f87d5550cf9a650e8585004b70cd11987e164 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from itertools import combinations
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import Angle, EarthLocation, SkyCoord
from astropy.coordinates.builtin_frames import (
FK5,
ICRS,
AltAz,
Galactic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.