hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
d8d576a153140c54c6716630bef0aec17df83337d0078bb607e55bc9642b462c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for putting velocity differentials into SkyCoord objects.
Note: the skyoffset velocity tests are in a different file, in
test_skyoffset_transformations.py
"""
import numpy as np
import pytest
from astropy import units as u
from astropy.coordi... |
742ee0e488f668d11984ca38719a684179d5f063d93fe18b4b1c401dbbbe70e2 | from contextlib import nullcontext
import numpy as np
import pytest
from numpy.testing import assert_allclose
import astropy.units as u
from astropy import time
from astropy.constants import c
from astropy.coordinates import (
FK5,
GCRS,
ICRS,
CartesianDifferential,
CartesianRepresentation,
Ea... |
3df8db134888a643dca37928bc289a1da7b02913cf5ba87b1299224b15323480 | # 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 astropy import units as u
from astropy.coordinates.matrix_utilities import (
angle_axis,
is_O3,
is_rotation,
matrix_product,
rotation_m... |
be427c59af19979977425d78c5945958b87ca8d3eaa23e45ab5cb04585aed6ef | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Regression tests for coordinates-related bugs that don't have an obvious other
place to live
"""
import copy
import io
from contextlib import nullcontext
import numpy as np
import pytest
from erfa import ErfaWarning
from astropy import units as u
f... |
3bdd32c9a6bb1bb3dd28c68a8ee5267bda6ad682bcaf333087dbf4061e327d07 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Accuracy tests for GCRS coordinate transformations, primarily to/from AltAz.
"""
import os
import warnings
from importlib import metadata
import erfa
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import (
... |
6047a58f3519dff80ee255b0bc09d035d570be29b0eb709ce5189c79fe3a6343 | import pytest
from astropy import units as u
from astropy.coordinates import EarthLocation, Latitude, Longitude
from astropy.coordinates.sites import (
SiteRegistry,
get_builtin_sites,
get_downloaded_sites,
)
from astropy.tests.helper import assert_quantity_allclose
from astropy.units import allclose as qu... |
dda642170dd3e9d47b823dbe5d11817eee8b7578bf6194d344f0282589a1c698 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for miscellaneous functionality in the `funcs` module
"""
import numpy as np
import pytest
from numpy import testing as npt
from astropy import units as u
from astropy.coordinates import FK5, ICRS, SkyCoord
from astropy.coordinates import rep... |
e923722340ccae98b152ac7bf271b8a6bf4ff9026f81b066337d44456c499f95 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import re
import warnings
from copy import deepcopy
import numpy as np
from astropy import units as u
from astropy.io import registry as io_registry
from astropy.table import Column, MaskedColumn, Table, meta, serialize
from astropy.time impo... |
f6323cf4e0ede5bcd1cddd42969de3e5e1fb70ffb5e3c5daebe8e219d2a74d2f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Facilities for diffing two FITS files. Includes objects for diffing entire
FITS files, individual HDUs, FITS headers, or just FITS data.
Used to implement the fitsdiff program.
"""
import fnmatch
import glob
import io
import operator
import os
import... |
b3924c6d7f34706dd5743a0f1f43f2f4732197580c476d6eb5348dcc114afef3 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
"""
A package for reading and writing FITS files and manipulating their
contents.
A module for reading and writing Flexible Image Transport System
(FITS) files. This file format was endorsed by the International
Astronomical Union in 1999 and mandated by... |
217e15687d76cc97c108e4f7454cafa357c7bf624833d707b7220a262e73362f | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import numbers
import operator
import re
import sys
import warnings
import weakref
from collections import OrderedDict
from contextlib import suppress
from functools import reduce
import numpy as np
from numpy import char as chararray
from as... |
b330b82cd28d03b54cf94e0e2cb2aee5e75ec84b5226ea41ac9b8b3a35d994c8 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import collections
import copy
import itertools
import numbers
import os
import re
import warnings
from astropy.utils import isiterable
from astropy.utils.exceptions import AstropyUserWarning
from ._utils import parse_header
from .card import KEYWORD_LEN... |
93f6318112108439cc2faad9db9b68b565012b789a900adf76f024696a7724c8 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import operator
import warnings
import weakref
from contextlib import suppress
from functools import reduce
import numpy as np
from numpy import char as chararray
from astropy.utils import lazyproperty
from .column import (
_VLF,
ASC... |
8480d4780df69f378282bda055d506db8fb76a56899962154d55cf50bcbf170a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import re
import warnings
from collections import OrderedDict, defaultdict
import numpy as np
from astropy import units as u
from astropy.coordinates import EarthLocation
from astropy.table import Column, MaskedColumn
from astropy.table.column import co... |
57b20618e41427ca256b07499a4d3a1e4512f02a92df4cb38dc0dc20e2526557 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
"""Convenience functions for working with FITS files.
Convenience functions
=====================
The functions in this module provide shortcuts for some of the most basic
operations on FITS files, such as reading and updating the header. They are
inclu... |
ad9eea3b355991575e06f79d60dc232d41af657437bbb938b10430cbad6a783a | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
import itertools
import mmap
import operator
import os
import platform
import signal
import sys
import tempfile
import textwrap
import threading
import warnings
import weakref
from contextlib import contextmanager, suppress
from funct... |
62958392a71425d478de5ce37c93568ab9a50cda9ef33fabe3892be74d1fe9c8 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import re
import warnings
import numpy as np
from astropy.utils.exceptions import AstropyUserWarning
from . import conf
from .util import _is_int, _str_to_num, _words_group, translate
from .verify import VerifyError, VerifyWarning, _ErrList, _Verify
__... |
3d467f8837c3bed7702eaf38eebf9f57de6621ffdfe899b3ce1035de08332cfb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
core.py:
Core base classes and functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import copy
im... |
76021cd5a72477ce1fe2f285f814792623cf81a884ceb468c39df19871e27118 | # 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... |
3f7378dd648a29d0e03a71b4e7cdc48a4fce5d36a8b9e439e9c6948e747699e6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions for serializing astropy objects to YAML.
It provides functions `~astropy.io.misc.yaml.dump`,
`~astropy.io.misc.yaml.load`, and `~astropy.io.misc.yaml.load_all` which
call the corresponding functions in `PyYaml <https://pyyaml.org>`_ but use ... |
b2d71d3011a93b03973a1aa1084fcfeaae5330838c2d9f92793c33fb72734126 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package contains functions for reading and writing Parquet
tables that are not meant to be used directly, but instead are
available as readers/writers in `astropy.table`. See
:ref:`astropy:table_io` for more details.
"""
import os
import warning... |
7a866dce406be24526dd445436f465ec2732f438fb19d6bf3e6e29b370f4e6e1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: Test FITS parsing
# STDLIB
import base64
import codecs
import gzip
import io
import re
import urllib.request
import warnings
# THIRD-PARTY
import numpy as np
from numpy import ma
# LOCAL
from astropy import __version__ as astropy_version
from as... |
251a4ef94f3a492475c38309b721ce5e6493c81273227d103cf21b7953f986c0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""VOTable exceptions and warnings.
.. _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... |
73b77a629e33d68f9d6714be4785b93b203b6f7600ee532b0ce2e8080ffe1dde | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains routines to verify the correctness of UCD strings.
"""
# STDLIB
import re
# LOCAL
from astropy.utils import data
__all__ = ["parse_ucd", "check_ucd"]
class UCDWords:
"""
Manages a list of acceptable UCD words.
Work... |
8623a1c708cb5a991907ef00dcb20a964d65950d1a1bff48b109569b638d45e3 | """
This module contains the FITS compression algorithms in numcodecs style Codecs.
"""
from gzip import compress as gzip_compress
from gzip import decompress as gzip_decompress
import numpy as np
from astropy.io.fits._tiled_compression._compression import (
compress_hcompress_1_c,
compress_plio_1_c,
comp... |
a5c18845578eb212c4f7262ae2d64fd8e622dd1a306a424966419be5c3018dab | # Licensed under a 3-clause BSD style license
import os
from setuptools import Extension
SRC_DIR = os.path.join(os.path.dirname(__file__), "src")
def get_extensions():
return [
Extension(
"astropy.io.fits._tiled_compression._compression",
sources=[
os.path.join(S... |
621b20e589f52ddcdb3e5e3c7b4a1ec92e6c22a324b5e609da440dda6aa9b568 | from math import ceil
import numpy as np
def _n_tiles(data_shape, tile_shape):
return [int(ceil(d / t)) for d, t in zip(data_shape, tile_shape)]
def _iter_array_tiles(
data_shape, tile_shape, first_tile_index=None, last_tile_index=None
):
ndim = len(tile_shape)
n_tiles = _n_tiles(data_shape, tile_... |
7a2fab13218050a089a1871d954f32f06b391f465d6026eb315c4ed67f9aa797 | """
This module contains low level helper functions for compressing and
decompressing buffer for the Tiled Table Compression algorithms as specified in
the FITS 4 standard.
"""
import sys
from math import prod
import numpy as np
from astropy.io.fits.hdu.base import BITPIX2DTYPE
from .codecs import PLIO1, Gzip1, Gzip... |
d5344de6cd1e7390682ecbe71479a4acb166f8fde4ea3e05fecadec505b9a984 | """
This file contains the code for Quantizing / Dequantizing floats.
"""
import numpy as np
from astropy.io.fits._tiled_compression._compression import (
quantize_double_c,
quantize_float_c,
unquantize_double_c,
unquantize_float_c,
)
from astropy.io.fits.hdu.base import BITPIX2DTYPE
__all__ = ["Quant... |
c535999e4859c942daf1df548e24e5d6a87104f6059fb2ba2568f6bae68338a6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsheader`` is a command line script based on astropy.io.fits for printing
the header(s) of one or more FITS file(s) to the standard output in a human-
readable format.
Example uses of fitsheader:
1. Print the header of all the HDUs of a .fits fil... |
150ed688b985727e8c1cc9cbe8bdc34bcf6cb9e4c477e50570c39931c950b997 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsinfo`` is a command-line script based on astropy.io.fits for
printing a summary of the HDUs in one or more FITS files(s) to the
standard output.
Example usage of ``fitsinfo``:
1. Print a summary of the HDUs in a FITS file::
$ fitsinfo file... |
ac8451efd6a45e31c81efb45b1c6008b970161bc3af48f89ba4b0e429c23b9ee | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import contextlib
import csv
import operator
import os
import re
import sys
import textwrap
import warnings
from contextlib import suppress
import numpy as np
from numpy import char as chararray
# This module may have many dependencies on astropy.io.fit... |
35035b6dcc76dc4b6a8d602f667126c8b243b51676c080ff34099a9d7e74ddcf | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import mmap
import sys
import warnings
import numpy as np
from astropy.io.fits.header import Header
from astropy.io.fits.util import (
_is_dask_array,
_is_int,
_is_pseudo_integer,
_pseudo_zero,
)
from astropy.io.fits.verify import VerifyW... |
80dfcd3b177aa828582b201deb8dff0a528b3232009025e69e15d8c1584fa1e0 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import ctypes
import gc
import itertools
import math
import re
import time
import warnings
from contextlib import suppress
import numpy as np
from astropy.io.fits import conf
from astropy.io.fits._tiled_compression import compress_hdu, decompress_hdu_sec... |
fb2be36f94f0e45463ae5c0f491cba1857eba791c098b424c72e0ac05cc92c4d | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import datetime
import numbers
import os
import sys
import warnings
from contextlib import suppress
from inspect import Parameter, signature
import numpy as np
from astropy.io.fits import conf
from astropy.io.fits.file import _File
from astropy.io.fits.... |
b92e1b0c1ff82cccc9bd103e179225e77482c76ab165636859da60c983d215e9 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import itertools
import os
import re
import shutil
import sys
import warnings
import numpy as np
from astropy.io.fits.file import FILE_MODES, _File
from astropy.io.fits.header import _pad_length
from astropy.io.fits.util import (
_free_sp... |
578f045cd5e0f95895b137e63666ae2c5288322facc04027bfdf583bbdbc68be | # 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... |
0836844873c4d8f59157d9ea13f936be3b26e56956c67265e8fc637ebd4edbb1 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import copy
import io
import os
import subprocess
import sys
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.hdu.base import _NonstandardHDU, _ValidHDU
from astropy.io.fits.verify import VerifyError, VerifyWarning
from a... |
44a400ee4353644e4e57f3f31630eb3a49039e4be0545ef71059a25223a4bc58 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import io
import os
import pathlib
import warnings
import numpy as np
import pytest
from numpy.testing import assert_array_equal
from astropy import units as u
from astropy.io import fits
from astropy.io.fits import printdiff
from astropy.io.fits.connect... |
681f9ffb8f6e0bc24e1182e7fe7c8ca0bc28873350b7ad8040bb17eef24ca5f7 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Can `astropy.io.fits.open` access (remote) data using the fsspec package?
"""
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from astropy.io import fits
from astropy.nddata import Cutout2D
from astropy.ut... |
be83d0dab0284503df77e3d4f2ab6813ee4e12b59dcf464a728d6898ddd1a954 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.column import Column
from astropy.io.fits.diff import (
FITSDiff,
HDUDiff,
HeaderDiff,
ImageDataDiff,
TableDataDiff,
)
from astropy.io.fits.hdu import HD... |
189ad884977eb5335266093451405ac47dc983650cdad07f4eea716dcbf6624d | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import collections
import copy
import warnings
from io import BytesIO, StringIO
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.card import _pad
from astropy.io.fits.header import _pad_length
from astropy.io.fits.util im... |
85383c5ec3c31e1660c64001bce69a155cffde75ca4df6b39e7c013614d61270 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import numpy as np
import pytest
from astropy import __version__ as version
from astropy.io import fits
from astropy.io.fits import FITSDiff, HDUList, Header, ImageHDU
from astropy.io.fits.convenience import writeto
from astropy.io.fits.hdu im... |
97d1ae3bf63d2090fd4b500e6c30f50c59fb701ba799a919cb3d02af65a6d891 | import gc
import warnings
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from astropy import units as u
from astropy.io import fits
from astropy.io.fits import (
BinTableHDU,
HDUList,
ImageHDU,
PrimaryHDU,
connect,
table_to_hdu,
)
from astropy.io... |
66095e7d2f580c86a51559446e568428919b09fa1d9194596400e9e9b04bbeef | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import errno
import gzip
import io
import mmap
import os
import pathlib
import shutil
import sys
import urllib.request
import zipfile
from unittest.mock import patch
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.conven... |
c51b52381453588ac1d14f311729b42a6cb133b1863a338dc4897c03f9dccadd | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import math
import os
import re
import time
from io import BytesIO
from itertools import product
import numpy as np
import pytest
from hypothesis import given
from hypothesis.extra.numpy import basic_indices
from numpy.testing import assert_equal
from as... |
cda523a23c9d7f13a5fe2782fc174691386f9e0b152c038c34069494f70f0352 | """
This test file uses the https://github.com/esheldon/fitsio package to verify
our compression and decompression routines against the implementation in
cfitsio.
*Note*: The fitsio library is GPL licensed, therefore it could be interpreted
that so is this test file. Given that this test file isn't imported anywhere
... |
5556e48619710d94583c10882ced2cefcd1fe7c603f24ed99d31337cc6cd996e | import itertools
import numpy as np
import pytest
COMPRESSION_TYPES = [
"GZIP_1",
"GZIP_2",
"RICE_1",
"HCOMPRESS_1",
"PLIO_1",
"NOCOMPRESS",
]
def fitsio_param_to_astropy_param(param):
# Convert fitsio kwargs to astropy kwargs
_map = {"qlevel": "quantize_level", "qmethod": "quantize_... |
dafa0f079a615b7c1c718bc963e56d3a156cc3da2f4fda6a5dde96cd2117f67f | from pathlib import Path
import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_equal
from astropy.io import fits
from astropy.io.fits._tiled_compression.codecs import PLIO1
from .conftest import fitsio_param_to_astropy_param
@pytest.fixture
def canonical_data_base_path():
return Pa... |
665de4bdf251ff15d3460e534e77cd978f4371237d81722ac4dfc842f0fc5786 | # 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
... |
e9a11cd23e97428d9a20f8f6d5199361367ccd3e9ed1fbfcee868463707e53ad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message=r"asdf.types is deprecated.*",
)
from asdf.... |
07a03e35b1b9db5c731e6f3b797af9297cb21e0c51e0eccbda19a2fc375ca4d0 | from pathlib import Path
from astropy.utils.introspection import minversion
def get_asdf_tests():
# return a list of filenames for all ".py" files in this
# directory and recursively in every sub directory. These
# are the files that pytest will import while attempting
# to find tests. This list is u... |
cbc56443d2407d24b728d973ae375a3825d6f74ea73c20210b05826ec73063e8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import warnings
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message=r"AsdfExtension is deprecated.*",
)
... |
516108b34cf2224777c570b0307f08d64059158e82c37725ea692cd3b9fcc698 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import numpy as np
import pytest
from astropy.io.misc.hdf5 import meta_path
from astropy.table import Column, QTable, Table
from astropy.table.table_helpers import simple_table
from astropy.units import allclose as quantity_allclose
from astro... |
c80568803e60d02bbd19a8c04c0039c3fd2ae1b6aaf83d2bf5ba7d21cf6b4546 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from asdf import tagged
from asdf.exceptions import AsdfDeprecationWarning
from astropy.io.misc.asdf.deprecation import create_asdf_deprecation_warning
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from astropy.model... |
dbffd00daf63a5e58e8118dbd21c98dda076c31f327ff76be81f0ece2455a374 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
def run_schema_example_test(organization, standard, name, version, check_func=None):
import asdf
from asdf.exceptions import AsdfDeprecationWarning
from asdf.schema import load_schema
with warnings.cat... |
299e1b6ba0f7d0ec6248049f266b7ef388185055a6c40e3098cae9900c57b50c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
import numpy as np
from asdf.exceptions import AsdfDeprecationWarning
from asdf.tags.core.ndarray import NDArrayType
with warnings.catch_warnings():
warnings.filterwarnings(
... |
a56183dc5ab36c6e44a0b09b8f6507cfe7050ae947c1dce8e2944dba1ffa9643 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
import os
import numpy as np
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDepre... |
496b13996cbd98b2e2c935857f6f8a56c74c938ff43df27a39213aef6ae107d8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message=... |
31a8302f5ac924e08785866352b11b7c80879633f453016573ecd8696bc53bb4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
asdf = pytest.importorskip("asdf")
import warnings
import asdf
import numpy as np
from asdf import AsdfFile, util
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ig... |
a750409b8f35363589df35227fcf9f24c5cf5b32908f0ac24962ca63920a95ad | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message=... |
a4a2972bcef20fffa8a0d566fdef5c435da0721d58770792a8e5f5d279801b69 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
import datetime
import asdf.schema as asdf_schema
import numpy as np
from asdf import AsdfFile, tagged, yamlutil
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_w... |
61ea781e5dfdbee01d33c3e88dcb963405f0624b33a165f8629e49e84a88f046 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message... |
dc17d0c9f029a45ccd4ee4f60eade2b9dae64d4ae25b38b07fe01a73fefec09b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message... |
1324c8911a5ee89603d5d782bc0bf8b66e13b7e5f80788f28b3020ffe8f84691 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
import pytest
from astropy import units as u
from astropy.coordinates import FK4, ICRS, Galactic, Longitude, SkyCoord
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnin... |
5f06853d868b0c25d64dccd0a6cf7688106a104eb97ea3b294647566e0eae533 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message... |
fa7df2facf1f7ba7bcd1889d51b68fdcafbbaa1d66e5877f29eecffdea31371e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
message=... |
212932dfe764083d6bf69f5f3f702d0ae1ffdb9ea4427daf090e9e6a71b40261 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
from astropy import units as u
from astropy.coordinates import ICRS, Galactic, SpectralCoord
from astropy.tests.helper import assert_quantity_allclose
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDep... |
e52ad8c178a1f68471a8b93516a0d20fb73b35fab7a4e74a28b3445420c11a6a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
... |
438593a2b4d11e8c5966dc613e9362003b6598b980bea5641122d614c8295060 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import io
import warnings
import pytest
asdf = pytest.importorskip("asdf")
from asdf.exceptions import AsdfDeprecationWarning
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
category=AsdfDeprecationWarning,
... |
dcd31db00786a2ab1d6887e5708ce2497197b2e08a9af75038a8a3a9713c6f10 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import pytest
from astropy import units as u
from astropy.cosmology import Planck15
from astropy.cosmology.units import with_H0
from astropy.units import equivalencies as eq
asdf = pytest.importorskip("asdf", minversion="2.3.0.dev0")
f... |
ef58f28fb6be9567af315037adecd0786ca9b4d49e687e15ea4391dd38d2b5a2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This is a set of regression tests for vo.
"""
# STDLIB
import difflib
import gzip
import io
import pathlib
import sys
from unittest import mock
import numpy as np
# THIRD-PARTY
import pytest
from numpy.testing import assert_array_equal
from astropy... |
6934a65848501f3f66d3b9a9c328d5104b4173bdecda833386f703d2755d8692 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the conversion to/from astropy.table.
"""
import io
import os
import pathlib
import numpy as np
import pytest
from astropy.config import reload_config, set_temp_config
from astropy.io.votable import conf, from_table, is_votable, tree, validate
f... |
6ba4b00ffe947eff9b2a39fd3f8384aebd4621d25bbee4cdb5a4ad3796f57bc6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Validates a large collection of web-accessible VOTable files,
and generates a report as a directory tree of HTML files.
"""
# STDLIB
import os
# LOCAL
from astropy.utils.data import get_pkg_data_filename
from . import html, result
__all__ = ["make_... |
696e61915ca38a40e09013e9d3232910c837399192b8a1ee782c34c17705dc85 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Read/Write/Interchange methods for `astropy.cosmology`. **NOT public API**.
"""
# Import to register with the I/O machinery
from . import cosmology, ecsv, html, mapping, model, row, table, yaml
|
5fabad8337582bee0b45036a1851c5050eec09adf1aba0a5c95d7d4a22c9227d | # 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... |
d370f4e0bfaf44054b67c5b93e591c5a73c9fe9ef0795d838219ff549e886396 | # 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__ = ["w0wzCDM", "Flatw0wzCDM"]
__d... |
88092626ba196c98bc5fd9efe9b87a3c6ce35342d8dc13cbfe34cfc05566d192 | # 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, FlatFLRWMixin
... |
b945f2a1fc80a82b3c0df475544a7ed193513033221b2c63f4a3e752cb18b701 | # 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... |
1fd06ef2bd8cc9220fca76e9661d1fe37d492424e40ebc7c80d9ce7b0330c4f0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.wpwazpcdm`."""
import numpy as np
# THIRD PARTY
import pytest
# LOCAL
import astropy.cosmology.units as cu
import astropy.units as u
from astropy.cosmology import FlatwpwaCDM, wpwaCDM
from astropy.cosmology.param... |
df4ff519231b3f74c3e6c1adde9fb87f2d86c2c2c4e053443ad6078d5f59019b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.lambdacdm`."""
##############################################################################
# IMPORTS
# STDLIB
# THIRD PARTY
import pathlib
import numpy as np
import pytest
# LOCAL
import astropy.constants as... |
ff2366a66e0c08885442715e2f7efe4303f04f5d9676c9259c1b903204ab4bab | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.w0wzcdm`."""
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
import astropy.units as u
from astropy.cosmology import Flatw0wzCDM, w0wzCDM
from astropy.cosmology.parameter import Parameter
from astropy.cosmo... |
c2973540791c1f71f15ab3125cda20c28739853d8b48e7fd9bbea024b6dee069 | # 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... |
454f0e74b22ab12178d207aa3d37ddfa85df587111af8a6fed5f79b077268cbb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import itertools
import sys
import types
import warnings
import weakref
from collections import OrderedDict, defaultdict
from collections.abc import Mapping
from copy import deepcopy
import numpy as np
from numpy import ma
from astropy import log
from as... |
4c45469187dae8a197983428071c7370a98560c00d11e1e7e03f137d242cc649 | # 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... |
598830b747a2185a4d845c5dcbffcc173173c29cec6ebf5c90568fb57ce1a2ed | # 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... |
4d9cd8f1fed9b2749666c8a1e6302402031cbe0ef86dd749d4f8a7c00c8081f2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Mathematical models."""
# pylint: disable=line-too-long, too-many-lines, too-many-arguments, invalid-name
import numpy as np
from astropy import units as u
from astropy.units import Quantity, UnitsError
from .core import Fittable1DModel, Fittable2DMo... |
ee2d49af11cadc3671ecb03676f604c27eeca435b5d94bc44cb7bcec69cd3b2b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Models that have physical origins.
"""
# pylint: disable=invalid-name, no-member
import warnings
import numpy as np
from astropy import constants as const
from astropy import units as u
from astropy.utils.exceptions import AstropyUserWarning
from .... |
494734e37bc0f0ceb97d28f4ae7b56861059231edeb734d3ff1f33773f7f92cf | # 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... |
3c36de567646b0ece1811bb4a695ab4ab0b6fee10de3d542f0bce1307cabd155 | # 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... |
008f395e9c60318c937dd6bcdbf39f8b476c30c38a117933ff7b0f236f864906 | # 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... |
006db280d9a4dc07616fc2953d70550bfc8a474b316503c65379900fb126158b | # 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.metadata import MetaData
from astropy.wcs.wcsapi import SlicedLowLevelWCS ... |
3681a05b204be8fd0e3e0ff91a1e9823fd77d4c9e905d94e5c8f96ad05d498ed | """
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... |
8fa90224713abad3fd1d83bcdbe99eef19c3b70ced2993933e7f1c746cce2297 | # 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... |
2b51b92ba82aca71dbcf51813d07373f3d5c56ec824f80e0829d117ea809a793 | # 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
... |
dd6ff136916e173ab11411389070604d5235affac150c1aab1837c39999c7886 | # 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,... |
4eba434461928a0dddba062d11e543e1342a331f83b725814c4e474b2c2aff56 | # 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... |
aba641f66dee9c99aec33f76aacca57ff1abdf4479a12c29ccc6538cb34e7697 | # 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... |
92e9d215caa8036a19343f7d17e7f3e62925d125cc12f696241def17c6f435d6 | # 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... |
335c64d7a6b23e3d96fd3b0b0a1383812edc0e1fb2006cf848e8c4f89c445585 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.