hash
stringlengths
64
64
content
stringlengths
0
1.51M
b902e0dc08b75db97a4165f62e3bb7f8312b9c3c1d2cace6d2c1ba6e01e5ca1e
# 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...
e9cf431eba3e5f8a0d0f25d3f0261117317f7e629a60b1586a2baf6be3f51355
# The purpose of these tests are to ensure that calling quantities using # array methods returns quantities with the right units, or raises exceptions. import sys import numpy as np import pytest from numpy.testing import assert_array_equal from astropy import units as u from astropy.utils.compat import NUMPY_LT_1_21...
ad3af7027d73fda63fa574e89ab1052ce0599a3f6028a960b29cfd8a9444cc84
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities specifically with the ERFA ufuncs. """ import erfa import numpy as np import pytest from erfa import ufunc as erfa_ufunc from numpy.testing import assert_array_equal from astropy import units as u from astropy.test...
5eef6ad987912baf1623fb25854a5a3ff82b1c8a662c4299f20c7699a6e23cbd
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the Logarithmic Units and Quantities """ import itertools import pickle 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.tests.helper i...
0a8756b899bbf670d3a8ac7af696241a1b22029e4e774f7fa9c356c727ecc9d9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test Structured units and quantities. """ import copy 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.tests.helper import check_pickling_re...
d702628120c499defebd1a3a974c803867e9c364b76c60613cd9a0d28ca80706
# 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...
76ca4b6f9aca32f2aee76588f6b73bb618330a616e7248814ae544c39c9350a3
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Unit tests for the handling of physical types in `astropy.units`. """ import pickle import pytest from astropy import units as u from astropy.constants import hbar from astropy.units import physical from astropy.utils.exceptions import AstropyDeprec...
fd88d5e80ec00ccb9fb67589d4acf984742b62f54efddc6ff14007ddb51b6424
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re from copy import deepcopy import numpy as np import pytest from astropy import units as u from astropy.coordinates import EarthLocation, SkyCoord, galactocentric_frame_defaults from astropy.coordinates import representation as r from astropy.c...
2b031c228fe48c99a7f6ffeede5e938e2423c274d8a6bff4bcd6afeb41327abb
""" This file tests the behavior of subclasses of Representation and Frames """ from copy import deepcopy import astropy.coordinates import astropy.units as u from astropy.coordinates import ICRS, Latitude, Longitude from astropy.coordinates.baseframe import RepresentationMapping, frame_transform_graph from astropy.co...
0edb0e879e9622a2f5eab0b6b6b4b378dff79312a7837ea4122ebafb4bc98509
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test geodetic representations""" import pytest from astropy import units as u from astropy.coordinates.representation import ( REPRESENTATION_CLASSES, BaseBodycentricRepresentation, BaseGeodeticRepresentation, CartesianRepresentation, ...
074994d23b219e9e3b63e6afd3e41dd9906ad14b33dfb317b759ce1dd6bb552c
# 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...
d75f8b1c700c523c9d698e8d2c4bd2b576df555dd3f53f592e7ed145209fecf8
import numpy as np import pytest from numpy.testing import assert_equal from astropy.coordinates.polarization import ( StokesCoord, StokesSymbol, custom_stokes_symbol_mapping, ) from astropy.table import Table, vstack from astropy.utils import unbroadcast def test_scalar(): sk = StokesCoord(2) as...
541c4207092c8210a1ea279675619002cbfd9ab23a8c08cd0110fbc86f8e5438
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains tests for the name resolve convenience module. """ import time import urllib.request import numpy as np import pytest from pytest_remotedata.disable_internet import no_internet from astropy import units as u from astropy.config...
0f8a5af055089d25edf0c89a0d02f0c53cd64a59c78015e70695a1efdff2069b
# 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...
199249afee44f921062a41ad3917ba286f54a0282e5ddaa57a8d63c74cdaa254
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...
39f8283a3a287c5b386562d0e16f91398205e956f0448160df89166171c5528b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from numpy.testing import assert_allclose from astropy import units as u from astropy.coordinates.matrix_utilities import ( angle_axis, is_O3, is_rotation, matrix_product, rotation_matrix, ) from astrop...
03201d37414ef4d62379063f62ed9edcc0d7cc3e762d945df2a0b3e36e9edea1
import numpy as np import pytest import astropy.units as u from astropy.coordinates import CIRS, GCRS, AltAz, EarthLocation, SkyCoord from astropy.coordinates.erfa_astrom import ( ErfaAstrom, ErfaAstromInterpolator, erfa_astrom, ) from astropy.time import Time from astropy.utils.exceptions import AstropyWa...
409dbaf8009aa9c8797d37ed19534d74688cd39d2d12e1fc44ec863a9722989a
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from astropy import units as u from astropy.coordinates.angles import Angle, Latitude, Longitude from astropy.coordinates.distances ...
2f4ca75e05317751d448c42b2fdf01ffc59abe837bc267f9c2cb244d0e5d0085
# 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 ( ...
c221e3a448c5177f271dc4128777d7973f84837c94b8662fe6f3e55bdd58285a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the SkyCoord class. Note that there are also SkyCoord tests in test_api_ape5.py """ import copy from copy import deepcopy import numpy as np import numpy.testing as npt import pytest from erfa import ErfaWarning from astropy import units...
ef776c97e2e961378f3c8efc45c8b44c93b478d0197a579d1b6442513cdbf4ab
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test initialization of angles not already covered by the API tests""" import pickle import numpy as np import pytest from astropy import constants from astropy import units as u from astropy.coordinates.angles import Latitude, Longitude from astropy...
98e9a890c64e08a19084e7dc70b8f64509cdb7e76ccc3c7f07d2198c7afa02e2
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Cartesian representations and differentials.""" import numpy as np from erfa import ufunc as erfa_ufunc import astropy.units as u from .base import BaseDifferential, BaseRepresentation class CartesianRepresentation(BaseRepresentation): """ ...
20fc29eb0a24f80f550f2f2a2bbfd049ec3742fa0cd84a79008831ffce97d103
""" In this module, we define the coordinate representation classes, which are used to represent low-level cartesian, spherical, cylindrical, and other coordinates. """ from .base import BaseDifferential, BaseRepresentation, BaseRepresentationOrDifferential from .cartesian import CartesianDifferential, CartesianReprese...
025218a6a852d471b6a5607e6d822ad514c6965e1043d8f868da4a1b730d82ca
# Licensed under a 3-clause BSD style license - see LICENSE.rst import erfa import numpy as np from astropy import units as u from astropy.coordinates.angles import Latitude, Longitude from astropy.utils.decorators import format_doc from .base import BaseRepresentation from .cartesian import CartesianRepresentation ...
79ace632615f7f72637943eaba19b80a4d2bfef44e11f4b8cc15cb1090916a40
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Base classes for representations and differentials.""" import abc import functools import operator import warnings import numpy as np import astropy.units as u from astropy.coordinates.angles import Angle from astropy.utils import ShapedLikeNDArray, ...
777f59f2872466cee627b967635aa695ce8537462c5cf92055a490098d3cf58b
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Spherical representations and differentials.""" import operator import numpy as np from erfa import ufunc as erfa_ufunc import astropy.units as u from astropy.coordinates.angles import Angle, Latitude, Longitude from astropy.coordinates.distances impo...
740d03ab7859fd5a1a7d8884f2924468f8a8d681a1f2f3e3766efdb903c68e26
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Cylindrical representations and differentials.""" import operator import numpy as np import astropy.units as u from astropy.coordinates.angles import Angle from .base import BaseDifferential, BaseRepresentation from .cartesian import CartesianRepres...
84fade38bf0c9d2440261773ac1dc61b6b7371faf1366be7a70d591ae2ead675
# Licensed under a 3-clause BSD style license - see PYFITS.rst import errno import gzip import http.client import io import mmap import operator import os import re import sys import tempfile import warnings import zipfile from functools import reduce import numpy as np # NOTE: Python can be built without bz2. from ...
141d67d41e4b8170acf87aa97ba72227c533ebb612c7400986d0789bfa7e355d
# 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...
2c3ad5b8dd4a44dafbb15486ceb1d193352cb1c2a03f7ffc6a6e9d0950ac7b5b
# 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...
b46e03b7f20deef0de4d4ccff573d7eae78943d818ae8d77242410f32ea1755b
# 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...
7cc2c60800d837045fd0f950282b6bb419166e83ac67b524f47cfd5d84177a8b
# 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...
4da91246409817b5a50490feff48d4dc03196d01aa6d95963058ca6ba93ba17e
# 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 __...
0cdae15e2194386be868da9010f5e34c3d4b33bc09b3b284a5a7a6a12986dc45
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. cds.py: Classes to read CDS / Vizier table format :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import fnmatch import itertools impor...
24193c481603d095190185f8af57ad3bd9178d24f311d12cddd074f52e0c7e88
# 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...
7255c76760d08f45dd66e2a81ddff7418b715bea9949095b82c3abc4e55f9f22
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. fixedwidth.py: Read or write a table with fixed width columns. :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ from . import basic, cor...
7b86fe7794107de14080886880a731b3f8db4cdee99a601f3a37976533ad120f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Classes to read AAS MRT table format. Ref: https://journals.aas.org/mrt-standards :Copyright: Smithsonian Astrophysical Observatory (2021) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu), \ Suyog Garg (suyog7130@gmail.com) """ import r...
576bece0670c49d2966ccd668f3601650a46d21036da0c27cccca3d2dff1336f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. latex.py: Classes to read and write LaTeX tables :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import re from . import core latexdi...
c0ac9cebacf3c6ef8e38cc22f19e00ddec3c2db718d7f577a3278019ce532cbd
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. ipac.py: Classes to read IPAC table format :Copyright: Smithsonian Astrophysical Observatory (2011) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import re from collections import OrderedDic...
985a15a295421c05a7bce2a6022ecc82ac93bbf581da53a3442bbf49fb78ad30
# Licensed under a 3-clause BSD style license - see LICENSE.rst """An extensible ASCII table reader and writer. ui.py: Provides the main user functions for reading and writing tables. :Copyright: Smithsonian Astrophysical Observatory (2010) :Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu) """ import collecti...
72e217f6391e67be836c4dc2247016ffeb46178954b40637cb97b7c985228828
# 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 ...
bdbcc8173d43a253045d8b8e17c79412fa577886b93a2ae8b1dced3a7251d58c
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Mixin columns for use in ascii/tests/test_ecsv.py, fits/tests/test_connect.py, and misc/tests/test_hdf5.py. All columns should have length 2. """ import numpy as np from astropy import coordinates, table, time from astropy import units as u el = co...
4b503534f9bfc4fda9b649b36361e91b2dc50c8953df71bb41041810c072568c
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import sys from collections import OrderedDict from .base import IORegistryError, _UnifiedIORegistryBase __all__ = ["UnifiedIORegistry", "UnifiedInputRegistry", "UnifiedOutputRegistry"] PATH_TYPES = (str, os.PathLike) # TODO! include bytes ...
8148badf663949a00da2230e067deaee90daacf9f3bd14eba8f0177907121dd0
# Licensed under a 3-clause BSD style license - see LICENSE.rst import contextlib import re import warnings from collections import OrderedDict from operator import itemgetter import numpy as np __all__ = ["IORegistryError"] class IORegistryError(Exception): """Custom error for registry clashes.""" pass ...
8d4a6dd1b36a646411b0c66b702094744168fca643517d9a0f1b66360553986f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from astropy.io import registry as io_registry from astropy.table import Table from astropy.table.column import BaseColumn from astropy.units import Quantity from astropy.utils.misc import NOT_OVERWRITING_MSG from . import from_table, parse f...
9a21878eceb02cca5be8d72d6bc6a537777fabd173da8067baed861ab25a8723
# 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...
a4bcc13248940c0560460b4dcc790b745d35c52ddff309c6cadd405ca4eea3fb
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains a contains the high-level functions to read a VOTable file. """ # STDLIB import io import os import sys import textwrap import warnings from astropy.utils import data from astropy.utils.xml import iterparser # LOCAL from . import...
c4d0bb2faf901e62e8910e1bdb9c912d55907e31d528e5d9f3ba9168226dc549
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package reads and writes data formats used by the Virtual Observatory (VO) initiative, particularly the VOTable XML format. """ from astropy import config as _config from .exceptions import ( IOWarning, UnimplementedWarning, VOTable...
853c004f372f1cc7f2d06428bec4bdf83ef39b33bdbe0fc31936350ca896743f
# 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...
6129ea353c3dbc6e2f066fdcc172a6ba3eb65e32da838f9aeb6a611c92d16f45
""" 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...
5db5a68157a06ddad60d8e1ca3936c070e2236fa4a4161b266b6d0182b756658
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import numpy as np from astropy.io.fits.column import FITS2NUMPY, ColDefs, Column from astropy.io.fits.fitsrec import FITS_rec, FITS_record from astropy.io.fits.util import _is_int, _is_pseudo_integer, _pseudo_zero from astropy.utils import la...
9bfd82ad4dc2e12e1083c80e41c227a21dd72e0e3c08a24ce723f1800b44cd02
# 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...
6f01f1be853f737e781c4751b4d2b0fa7ee853e3e0bfc413435581c00719b155
# 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...
f6fa0f2d50855d0925858cdf00d939c053775e4b679bcbe5b17ab80793428dce
# Licensed under a 3-clause BSD style license - see PYFITS.rst import ctypes 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_image_data, decompress_...
a1470e1c6b6c21afc53a66982a869c80d0a9a9f2abb42d60398d4dac154150f5
# 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...
bdbb957c5f11a126665cd4d4961ed5f1bfa2a5f7a39efc169c2681ef6518f339
# 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...
c85baa58691697ed6e8a6014f83eea43073411ba4473e529d215a68f38a7c619
# 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...
952267d4521ff5e53b62cc88e257fe1b18a0b1d9d412ef4adf246c108ce7c622
# 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...
c849163b4875804e43d1383efb65c8486fbeb4ed29bff37d034955d541167627
# Licensed under a 3-clause BSD style license - see PYFITS.rst import numpy as np import pytest from astropy.io import fits from astropy.io.fits._tiled_compression import compress_image_data from .conftest import FitsTestCase MAX_INT = np.iinfo(np.intc).max MAX_LONG = np.iinfo(int).max MAX_LONGLONG = np.iinfo(np.lo...
e2eb8924dd0cc9a33aabe6da11ecdd8c26e5f15f574a66d6a55784f0e51c9c2e
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...
578d2ba65484e4c680d7312ea7476a1dfec10ad2f823607a0566f424f73fdfab
# 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...
bc7ce0f39c5fe0639a9b7ccc3c1d856c83eef121f03c1f09d20975449a4d052f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some methods related to ``CDS`` format reader/writer. Requires `pyyaml <https://pyyaml.org/>`_ to be installed. """ from io import StringIO import numpy as np import pytest from astropy import units as u from astropy.coordinates im...
f3de6c93668aed3d6057bc272233519c2af1a7751ac42d2c9d3f322c64fe57b5
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools import io import os import re from contextlib import nullcontext from io import BytesIO from textwrap import dedent import numpy as np import pytest from numpy import ma from astropy.io import ascii from astropy.io.ascii.core import ( ...
5311396e49e03a2649f52907bb2e3aa506c1653509da7550a3d42d3499775d22
# Licensed under a 3-clause BSD style license - see LICENSE.rst import locale import pathlib import platform import re from collections import OrderedDict from io import BytesIO, StringIO import numpy as np import pytest from astropy import table from astropy.io import ascii from astropy.io.ascii import core from as...
9388e6057deb98945690efaa7c5a110a94f2c4d26ed4ba7701b17565a21649c4
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import os import pathlib from contextlib import nullcontext from io import StringIO from itertools import chain import numpy as np import pytest from astropy import table from astropy import units as u from astropy.io import ascii from astro...
bd01e7811913c1e460b114f684ff08f528f00613524e8aa343b5e96b108fa886
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test :mod:`astropy.io.registry`. .. todo:: Don't rely on Table for tests """ import os from collections import Counter from copy import deepcopy from io import StringIO import numpy as np import pytest import astropy.units as u from astropy....
187374a1de1686c8fbdccf165987460b4bef84530307a7a3fc7137820ed8d51e
# 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...
10376d4c2b6cff5b6667672c54cb46c0b686ff35d90d532efb39d4e52b2e2872
# 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.io.votable import conf, from_table, is_votable, tree, validate from astropy.io.votable.exceptions import E25, W39, VOWarni...
51bd59eb5be9fc04e7846af56d39e82e10e8d936a1b24968a9ea56d3f18e6d4f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Contains a class to handle a validation result for a single VOTable file. """ # STDLIB import hashlib import http.client import os import pickle import shutil import socket import subprocess import urllib.error import urllib.request import warnings fr...
9019216816216c76a6650d139fbfe55888212f915d82107d699ca3bf3fb1224a
from astropy.timeseries.periodograms.base import * from astropy.timeseries.periodograms.bls import * from astropy.timeseries.periodograms.lombscargle import * from astropy.timeseries.periodograms.lombscargle_multiband import *
7b5eef685a3bb68e3bb8389a3e94a5af8c9dc13b5ad8824a40df5efec5dde533
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from numpy.testing import assert_equal from astropy import units as u from astropy.table import QTable, Table, join, vstack from astropy.time import Time from astropy.timeseries.binned import BinnedTimeSeries from astropy.timeseries.sampled...
75e28e658d91d54a2a76e384ec81abd81787448a44cd49eab53c850d391007a3
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"] import numpy as np from astropy import units from astropy import units as u from astropy.time import Time, TimeDelta from astropy.timeseries.periodograms.base import BasePeriodogram from astropy.ti...
aa8607008c428f24428bc92c55f0a90a0e4ddddd54fc45eb4579883445619c32
"""Main Lomb-Scargle Multiband Implementation""" import numpy as np from astropy import units as u from astropy.time import Time, TimeDelta from astropy.timeseries.binned import BinnedTimeSeries from astropy.timeseries.periodograms.lombscargle import LombScargle from astropy.timeseries.sampled import TimeSeries from...
43ce43f8c07c1c23b8db5592a6b8c0491dd12d33b1e3bd96fa6a06fa2b7bfbdc
# Licensed under a 3-clause BSD style license - see LICENSE.rst from .core import LombScargleMultiband
497ed8e58b0207dd6bc4e4455b0a34bef3dbdac23ee630da7d2ccffae72e0ec4
""" Main Lomb-Scargle Multiband Implementation The ``lombscarglemultiband`` function here is essentially a switch statement for the various implementations available in this submodule """ __all__ = ["lombscargle_multiband", "available_methods"] from .mbfast_impl import lombscargle_mbfast from .mbflex_impl import lom...
462a50d3aad2f1096718aad353b0220f20ced917a8506699887e648fd9388495
import numpy as np __all__ = ["lombscargle_mbflex"] def lombscargle_mbflex( t, y, bands, frequency, dy=None, nterms_base=1, nterms_band=1, reg_base=None, reg_band=1e-6, regularize_by_trace=True, center_data=True, ): if (nterms_base == 0) and (nterms_band == 0): ...
ae08a08f0c7ab6087b9f3c115d8137119e7e8a0d59ccd05330a7d9523bfcf2cc
"""Various implementations of the Multiband Lomb-Scargle Periodogram""" from .main import available_methods, lombscargle_multiband from .mbfast_impl import lombscargle_mbfast from .mbflex_impl import lombscargle_mbflex
0cee1ba5d9eb8daea45f5605e20b768129a6709eb794ba2f954deed4c64029a4
import numpy as np from astropy.timeseries.periodograms.lombscargle.implementations import lombscargle __all__ = ["lombscargle_mbfast"] def lombscargle_mbfast( t, y, bands, dy=None, frequency=None, sb_method="auto", assume_regular_frequency=False, normalization="standard", fit_me...
b28ba7cf94204b54ba5123dfdc9e09ec00c4f969370a70cff5bd951b0a5d974f
import numpy as np __all__ = ["design_matrix", "construct_regularization", "periodic_fit"] def design_matrix(t, bands, frequency, dy=None, nterms_base=1, nterms_band=1): t = np.asarray(t) omega = np.asarray(2 * np.pi * frequency) unique_bands = np.unique(bands) # Construct X - design matrix of the s...
22dfd91d2baf7c54bd9a40d02478b3b4c85d40fad4c253c5f67c2cceb9956a77
import numpy as np import pytest from numpy.testing import assert_allclose from astropy import units as u from astropy.tests.helper import assert_quantity_allclose from astropy.time import Time, TimeDelta from astropy.timeseries import TimeSeries from astropy.table import MaskedColumn from astropy.timeseries.periodogr...
0f2e8588336b071357821df737007f48ab9ef637364f4d7469b916e1f47303bf
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Functions for `astropy.cosmology`.""" from .comparison import cosmology_equal from .optimize import z_at_value __all__ = ["z_at_value", "cosmology_equal"]
9ad1ee982158f361341ed000f0566aa1f6012ad734d093960ce96b41680b923e
# Licensed under a 3-clause BSD style license - see LICENSE.rst __all__ = ["Parameter"] from ._core import Parameter
d28f308b468b49bf7ddfa100074ef3d839f60f61a52a3ddb3e1b4b540178ff8f
# Licensed under a 3-clause BSD style license - see LICENSE.rst from typing import Any, Callable import astropy.units as u __all__ = [] FValidateCallable = Callable[[object, object, Any], Any] _REGISTRY_FVALIDATORS: dict[str, FValidateCallable] = {} def _register_validator(key, fvalidate=None): """Decorator ...
9bd6ebc468fc7fdda026616db2e3f31dfd399c21d5a76241ee61799f66d2d118
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy import astropy.units as u from ._converter import _REGISTRY_FVALIDATORS, _register_validator __all__ = [] class Parameter: r"""Cosmological parameter (descriptor). Should only be used with a :class:`~astropy.cosmology.Cosmology` ...
d960db124989d14f657a0024e345c312e54296d30a5d91f7f08238832aac3070
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy.cosmology.utils import aszarr, vectorize_redshift_method from .test_core import _zarr, invalid_zs, valid_zs def test_vectorize_redshift_method(): """Test :func:`astropy.cosmology.utils.vectorize_redshi...
5dbd19d6892b494618e47c5d2638c877008442d5191b2a9c3160daa67fc4a1bb
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.parameter`.""" ############################################################################## # IMPORTS # STDLIB import inspect # THIRD PARTY import numpy as np import pytest # LOCAL import astropy.units as u from as...
e26fb18e6f7a39fa162864f54959de6c8194e16e9d527e5386c81071f48dfc92
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import os import pytest from astropy import cosmology from astropy.cosmology import Cosmology, w0wzCDM from astropy.cosmology._io.tests import ( test_cosmology, test_ecsv, test_html, test_json, test_latex, test_map...
e9b642f5f7d847545c95fc4382f13d9b6a2f51f3b68635bb7f7e47593f86dad4
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Testing :mod:`astropy.cosmology.core`.""" import abc import inspect import pickle import numpy as np import pytest import astropy.cosmology.units as cu import astropy.units as u from astropy.cosmology import Cosmology, FlatCosmologyMixin from astrop...
a27df6b6524b6e552983c0debefcd46e03cd374f0bcc73c9e5e751b427639e84
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides the tools used to internally run the cosmology test suite from the installed astropy. It makes use of the `pytest`_ testing framework. """ ############################################################################## # IMPORTS ...
c1e3c923a78bd837668556685e32d63e57765008a35357dc1267e582783f3652
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Astropy FLRW classes.""" from . import base, lambdacdm, w0cdm, w0wacdm, w0wzcdm, wpwazpcdm from .base import * from .lambdacdm import * from .w0cdm import * from .w0wacdm import * from .w0wzcdm import * from .wpwazpcdm import * __all__ = ( base.__...
d75e4e69bdc6d4d61ddaf630ff88f1eabb44867f58377e64d2259e2d2e49826d
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import annotations import warnings from abc import abstractmethod from math import exp, floor, log, pi, sqrt from numbers import Number from typing import TYPE_CHECKING, Any, TypeVar import numpy as np from numpy import inf, sin import ...
bf3b701c360dc3e67ba8ad74dace2a32a3a203bf68bb41bf74a582bf7ac6e82e
# Licensed under a 3-clause BSD style license - see LICENSE.rst import copy from collections import defaultdict from astropy.cosmology.connect import convert_registry from astropy.cosmology.core import Cosmology from astropy.table import QTable, Row from .mapping import from_mapping def from_row(row, *, move_to_me...
9d626673f67b9a7ed9e7027913acca8c091fb5a02b73efb3572b6b243b087b71
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from astropy.cosmology.connect import convert_registry from astropy.cosmology.core import Cosmology from astropy.table import Column, QTable, Table from .mapping import to_mapping from .row import from_row from .utils import convert_p...
7bd9d46ae53f9e59c119d3e4cd07ff01ce28568765c617c2f881d0489a6ff6a8
# 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, latex, mapping, model, row, table, yaml
1752f6225bf6bea5b5bf9e1af65ae3f767732be74645dadcc2202afd623d8414
import astropy.units as u from astropy.cosmology.connect import readwrite_registry from astropy.cosmology.core import Cosmology from astropy.cosmology.parameter import Parameter from astropy.table import QTable from .table import to_table _FORMAT_TABLE = { "H0": "$H_0$", "Om0": r"$\Omega_{m,0}$", "Ode0": ...
c8941435d0692f66ea9bc9955bb31d0757f4c8b514439d4fc498ab7a806b6a73
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The following are private functions, included here **FOR REFERENCE ONLY** since the io registry cannot be displayed. These functions are registered into :meth:`~astropy.cosmology.Cosmology.to_format` and :meth:`~astropy.cosmology.Cosmology.from_format...
e8de2d4ae387ad27ab5451ccdc8dba5ba81e5a70a7d409d5fb7811c2bbd7a034
import astropy.cosmology.units as cu import astropy.units as u from astropy.cosmology.connect import readwrite_registry from astropy.cosmology.core import Cosmology from astropy.cosmology.parameter import Parameter from astropy.table import QTable from .table import from_table, to_table # Format look-up for conversio...
eba2d2de952b22a83f516afc9c14da509b501f3b8d74685a937ee309a3bd9af0
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ The following are private functions, included here **FOR REFERENCE ONLY** since the io registry cannot be displayed. These functions are registered into :meth:`~astropy.cosmology.Cosmology.to_format` and :meth:`~astropy.cosmology.Cosmology.from_format...
d0d8ce9e080fd72e84654ffaebb8c6901e3492d3ba82d9724368af19023d9c8a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import astropy.cosmology.units as cu import astropy.units as u from astropy.cosmology.connect import readwrite_registry from astropy.cosmology.core import Cosmology from astropy.table import QTable from .table import from_table, to_table def read_ecsv(...
cd6dbdcaaf0c8cdc957222756ef632ffeb2c2f8462edf60f54dca33296fb70e1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Tests for :mod:`astropy.cosmology.comparison`""" import re import numpy as np import pytest from astropy.cosmology import Cosmology, FlatCosmologyMixin, Planck18, cosmology_equal from astropy.cosmology._io.tests.base import ToFromTestMixinBase from ...