hash
stringlengths
64
64
content
stringlengths
0
1.51M
c2470286a9711875592649ef66bb5351c0d623f173d80e32b5aa25593dc88bc3
# 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...
4c78483bd6facb1ba3c50b2f0be6980931cd14bb7da7f3b79c957392674faba8
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file connects any readers/writers defined in io.misc to the # astropy.table.Table class from . import hdf5, parquet hdf5.register_hdf5() parquet.register_parquet()
d79d306fbbcd24f3135c0ac738ef92909a4c5a559580f358ca905375bf2a60fa
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This package contains functions for reading and writing HDF5 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 warnings i...
9d588aa5314b2cade2b50d08874dee67ebcbc2dc2c60f75f655e499de3f9b748
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions for serializing core astropy objects via the YAML protocol. 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...
a57c6d752212fe9b29d039dc4e0ee6ce09ea0c4d8e0163b4eb4cf4f3b9353147
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains simple input/output related functionality that is not part of a larger framework or standard. """ import pickle __all__ = ["fnpickle", "fnunpickle"] def fnunpickle(fileorname, number=0): """Unpickle pickled objects from a s...
9d8c81d56b3f67215ab90f2bdb6674a48f8740f914c96fb0b1099cede17688ab
# 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...
5f20ebad094a468c7340f24f0af00948f608d93b832e4653f0248b4be8d2b624
# 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 """ import numpy as np from astropy import coordinates, table, time from astropy import units as u el = coordinates.EarthLocation(x=[1, 2] * u...
746dd2289252e015bdc93195a49da346250684503a7f0270ce102098fc957480
# 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 ...
cbd3ce4a3b5791be4afd5b3ffbf4295b889347e297838fa548353954be33924b
# Licensed under a 3-clause BSD style license - see LICENSE.rst import abc 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.""" ...
38453102c4396f7fafe38f884a34df032a791b5b78e3f4ad140a974f8e5ef1bf
# Licensed under a 3-clause BSD style license - see LICENSE.rst import inspect import os import re from .base import IORegistryError __all__ = ["UnifiedReadWriteMethod", "UnifiedReadWrite"] # ----------------------------------------------------------------------------- class UnifiedReadWrite: """Base class f...
c35b604661ea32491cf275cd1c15f20626516d156153b9e825c90d1cc612c555
# Licensed under a 3-clause BSD style license - see LICENSE.rst import functools from .core import UnifiedIORegistry __all__ = [ "register_reader", "register_writer", "register_identifier", "unregister_reader", "unregister_writer", "unregister_identifier", "get_reader", "get_writer", ...
19c3bd9672efaae155d5309b07e2b147747b0c4ae43b58ebca2aa741073c753a
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module handles the conversion of various VOTABLE datatypes to/from TABLEDATA_ and BINARY_ formats. """ # STDLIB import re import sys from struct import pack as _struct_pack from struct import unpack as _struct_unpack # THIRD-PARTY import numpy ...
6d2e00423525dd2ca228b29405790075db3e092c62d4bd21b1ce28bde7ad9ce9
# 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...
b6be6b29d08fc26446a30a40791251bf4437f25c9296edeef5c2964d43b9fe1e
# 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...
4de1b8e349b0914b7676ac70e815dfab3bfab3a5c4be8deeee40d386df111003
# 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.decorators import deprecated_renamed_argumen...
9f5dca729ea209a946e6c6f8c622691f16522c8b49e5aed0869681e53ce8cbd2
# 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...
901e6cbb6bcf068c63086fc296d64ae3dd72a080f92dab734efa570de037028f
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ .. _warnings: Warnings -------- .. note:: Most of the following warnings indicate violations of the VOTable specification. They should be reported to the authors of the tools that produced the VOTable file. To control the warnings e...
176a8670da149f0c983e6dbe3ca23dd14b6406086d7dd02992b4d4a71d7efc07
# 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...
0c5f7ae231506a4dc9e161b36b115471724659958e13308b42d7bb86dea6bc8f
# Licensed under a 3-clause BSD style license - see LICENSE.rst from os.path import join from setuptools import Extension def get_extensions(build_type="release"): VO_DIR = "astropy/io/votable/src" return [ Extension( "astropy.io.votable.tablewriter", [join(VO_DIR, "tablewri...
159d67c0728a1d409a77b3a81d85d111e6270be8b088b040b7c6a255adc5eee8
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Various utilities and cookbook-like things. """ # STDLIB import codecs import contextlib import gzip import io import os import re from packaging.version import Version __all__ = [ "convert_to_writable_filelike", "stc_reference_frames", ...
2ed3370e5af263efead8d55844d2c60a6832601fe7e71a9f3c3c53107add4f15
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Various XML-related utilities """ # ASTROPY from astropy.logger import log from astropy.utils import data from astropy.utils.xml import check as xml_check from astropy.utils.xml import validate # LOCAL from .exceptions import W02, W03, W04, W05, vo_...
8cea550af167b1f1f1eeabe49ae38fc02f4c55a6ed5210d3af2ea6eaaf42dec1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Script support for validating a VO file. """ def main(args=None): import argparse from . import table parser = argparse.ArgumentParser( description="Check a VOTable file for compliance to the VOTable specification" ) par...
95060ace711dbb68c6d4494f52eb1b26221b7e6e8d8ec888cdd9e6b09f5b584a
# 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...
7102a8827569e6a5120bbee54fdac29c45724c35e81d53f2f113504dac504ab9
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ ``fitscheck`` is a command line script based on astropy.io.fits for verifying and updating the CHECKSUM and DATASUM keywords of .fits files. ``fitscheck`` can also detect and often fix other FITS standards violations. ``fitscheck`` facilitates re-wri...
71ee64da8a605c44ef218fd416c5a1e626644217b6f71f08a1028a00366c5b16
# 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...
98d9e63c3c1436c79de77208c0a3c6da474211bab63b3faa2aa740ee76e5a775
# Licensed under a 3-clause BSD style license - see LICENSE.rst import argparse import glob import logging import os import sys from astropy import __version__ from astropy.io import fits from astropy.io.fits.util import fill log = logging.getLogger("fitsdiff") DESCRIPTION = """ Compare two FITS image files and rep...
dfe656eb2ffdc45479043656cccd7d47c1067aeaf2b9dfe96f557fe95d740049
# 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...
c97ddb5cad4051694de8e76f10046688e50a4ad489a5683b39c6499ccfe3c361
# 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...
60dc63e7614edd03c9b9fbb046a73c51deff51a6c79c70ce2dab50c0943034d4
# Licensed under a 3-clause BSD style license - see PYFITS.rst from .base import BITPIX2DTYPE, DELAYED, DTYPE2BITPIX, register_hdu, unregister_hdu from .compressed import CompImageHDU from .groups import Group, GroupData, GroupsHDU from .hdulist import HDUList from .image import ImageHDU, PrimaryHDU from .nonstandard ...
112b1b0b88e3f121c1d2c3c6b05e66d60d6bb46b25440c4cf786847b31caf953
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import io from astropy.io.fits.file import _File from astropy.io.fits.header import Header, _pad_length from astropy.io.fits.util import fileobj_name from astropy.utils import lazyproperty from .base import NonstandardExtHDU from .hdulist imp...
9aa3513fddf4e0063593850b045ac9c5c750d8e6cd42786fa40de1b0859dfbad
# 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...
41b9d2d9b5f089a6498a8258c037fc1dcef9a2c71af410018217c2d03744c6fd
# 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.card import Card from astropy.io.fits.column import KEYWOR...
ee1bd9b4ab3ab63ed0215542c1a0a5531e4b7543e5ed4789ece9c50651aec6d4
# Licensed under a 3-clause BSD style license - see PYFITS.rst import datetime 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.header import H...
26f9e1af56a56b4a18fb59091b0e7e50fcd10b3d6257d056bb7083733a152ca5
# 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...
94020cdcaf26b609ba95d32c35be3d942558c6db7688132106ccbc67fc57c0de
# Licensed under a 3-clause BSD style license - see PYFITS.rst import gzip import os from astropy.io.fits.file import _File from astropy.io.fits.header import _pad_length from astropy.io.fits.util import fileobj_name from .base import BITPIX2DTYPE, _BaseHDU from .hdulist import HDUList from .image import PrimaryHDU ...
6875e63f60cd07fb647db4b5ae0c51d9a60cb46fc7b8e1f09fab546da6c6b5cd
# 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...
90c11319ffd434c1a3b5a77ee078d0d251f7c00a7295b1d58cf0bb8c6fd00394
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import warnings import numpy as np import pytest from astropy.io import fits from astropy.io.fits.hdu.base import _ValidHDU from .conftest import FitsTestCase from .test_table import comparerecords class TestChecksumFunctions(FitsTestCase):...
fc707b96a27b523e00c901a222d883fae232adc62b55bd1a5334d050a79da22c
# Licensed under a 3-clause BSD style license - see PYFITS.rst import numpy as np from astropy.io import fits from .conftest import FitsTestCase class TestDivisionFunctions(FitsTestCase): """Test code units that rely on correct integer division.""" def test_rec_from_string(self): with fits.open(se...
72fb86e6245e7e6ef45a614428d592410070eec0fdf8159985dd7886b1f33a58
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import time import numpy as np import pytest from astropy.io import fits from astropy.utils.misc import _NOT_OVERWRITING_MSG_MATCH from .conftest import FitsTestCase from .test_table import comparerecords class TestGroupsFunctions(FitsTestC...
39f459b19043af0552ee092bd59e37eec31a9512f4d33401fe3b15bee616ebe6
# Licensed under a 3-clause BSD style license - see PYFITS.rst import numpy as np from astropy.io import fits from .conftest import FitsTestCase class TestNonstandardHdus(FitsTestCase): def test_create_fitshdu(self): """ A round trip test of creating a FitsHDU, adding a FITS file to it, ...
810bd61f2c16dea28d55758f015d3430f255ca2b9582607906a254aa657ddafb
# 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...
f19da1f064d14d6f73bf8702a3daad9e1d0ea15872351ef1ad5b6a8bd92aa56a
# Licensed under a 3-clause BSD style license - see LICENSE.rst import re import pytest from astropy import __version__ as version from astropy.io import fits from astropy.io.fits.scripts import fitscheck from astropy.utils.exceptions import AstropyUserWarning from .conftest import FitsTestCase class TestFitschec...
afe0e595412d502b5d6b4fcc48d629205d3e82958dffd4d4a43227245893f81a
# Licensed under a 3-clause BSD style license - see PYFITS.rst
bc053407e583a4ee9baafc96414662f80291f4ea7b2ead3e5306b5ab6c5a99d1
# Tests related to writing dask arrays to FITS files in an efficient way import numpy as np import pytest from astropy.io import fits from astropy.io.fits import ImageHDU, PrimaryHDU da = pytest.importorskip("dask.array") @pytest.fixture def dask_array_in_mem(): return da.random.uniform(-1000, 1000, (1322, 755...
c695465d0e3021a3bf982fb4cc08db1fa1c32dda91b04f6b868c87c0fe3d92bd
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os import pathlib import shutil import stat import tempfile import time import pytest from astropy.io import fits @pytest.fixture( params=[False, "str", "pathlib"], ids=["", "home_is_data", "home_is_data, pathlib"] ) def home_is_data(request...
5cb4673ed069c1d55bcc238f8701b9b23762a47ad23bd79b8f08ee82a60bab79
# 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...
35aa7d074cb338a19cef2f0d886067fbd2ce9b5235265ab91a5f511ea047fac9
# 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...
dc22fb1e8c04dea7bb65b590c3fb8a97e7719f9f0846ff33c16b314b8e2c2b01
# Licensed under a 3-clause BSD style license - see LICENSE.rst import gzip import os import signal import sys import numpy as np import pytest from numpy.testing import assert_equal from astropy.io.fits import util from astropy.io.fits.util import _rstrip_inplace, ignore_sigint from astropy.utils.compat.optional_de...
5dd0e5b319931484d91f39dcaf4f0494fca3b7204ba877376926a20a7a2b9a81
# 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...
afe90b6fa54343720ef6658c35419e12df00c4d34c402553b5ce246ec28391e8
# 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...
b83f811b7350d876365679641c6c46cc3c9ffd2a40d4528d09ed8963e60c7418
# 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...
bff5c74b1f4c17100c3adf8be08693e9250d13b038f050170ed1bc446ff015ca
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import numpy as np from astropy.io import fits from .conftest import FitsTestCase def compare_arrays(arr1in, arr2in, verbose=False): """ Compare the values field-by-field in two sets of numpy arrays or recarrays. """ ar...
1ab3399793c678c8125128cc2c16f269cd9ac197c5050f266b818436520d5179
# 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.compression import compress_hdu from .conftest import FitsTestCase MAX_INT = np.iinfo(np.intc).max MAX_LONG = np.iinfo(int).max MAX_LONGLONG = np.iinfo(np.longlong).max ...
500d2b49bcdb7c036ef72a4721ccc72e331d6cbcb7335cf2b19d2c1082248219
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import __version__ as version from astropy.io.fits.scripts import fitsheader from .conftest import FitsTestCase class TestFITSheader_script(FitsTestCase): def test_help(self): with pytest.raises(SystemExit) as e:...
655c4b172e1ec3443f1e162b3cc72d5bb51e08ffd71b554ecde99060f73cea06
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, table_to_hdu from astropy.io.fits.column import ( _fortran_to_...
db0ae7b51a5b9646cbd8dc578df19bb9c7db186e0cb23dcf5adbb60632abb98b
# 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...
137117d4b8bf167b284289e06c52b62de6480b9b5428b765d80d2e401a03b49c
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy.coordinates import EarthLocation from astropy.io import fits from astropy.io.fits.fitstime import ( GLOBAL_TIME_INFO, is_time_column_keyword, time_to_fits, ) from astropy.table import Column, QTab...
9578e15f088f66d89f332a1001cffb532ba97be40ebe51fecd73ea89b1e44e14
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy import __version__ as version from astropy.io.fits.scripts import fitsinfo from .conftest import FitsTestCase class TestFitsinfo(FitsTestCase): def test_help(self): with pytest.raises(SystemExit) as e: ...
01c2acbff3c56a00403c1fc8063f2185a156ead2c1555ec0dd2e714564b0ec9d
# Licensed under a 3-clause BSD style license - see PYFITS.rst import platform import numpy as np import pytest from numpy.testing import assert_array_equal from astropy.io import fits from .conftest import FitsTestCase class TestUintFunctions(FitsTestCase): @classmethod def setup_class(cls): cls....
be7c804cee0cf1067d16ca5627615a3ed38ba3a97804309f7346d53bafd6dbbc
# Licensed under a 3-clause BSD style license - see PYFITS.rst import os import numpy as np import pytest from astropy.io import fits from astropy.utils.misc import _NOT_OVERWRITING_MSG_MATCH from .conftest import FitsTestCase class TestTildePaths(FitsTestCase): """ Exercises a few functions, just to ensu...
beea6a8df8a7e7227b83e998b8708022ef62f91989264f96ea38d7cfc81a6afd
# Licensed under a 3-clause BSD style license - see PYFITS.rst import math import os import re import time import numpy as np import pytest from numpy.testing import assert_equal from astropy.io import fits from astropy.io.fits.hdu.compressed import DITHER_SEED_CHECKSUM, SUBTRACTIVE_DITHER_1 from astropy.utils.compa...
93acff9e5ede8f269bf9d4415b9a83d3f298ee6cfb26494a43dcff6c17d2b783
import numpy as np import pytest from astropy.io import ascii from astropy.io.ascii.qdp import _get_lines_from_file, _read_table_qdp, _write_table_qdp from astropy.table import Column, MaskedColumn, Table from astropy.utils.exceptions import AstropyUserWarning def test_get_tables_from_qdp_file(tmp_path): example...
0fa50e914cd3c78deec1ff43238248ea6e8d24a4b4a6a2140e32ad3279087dd0
# 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...
2370dd6af3bbc965a07ac67260de3d8673c551cfa8776b24c869f64d3849312d
# 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 ( ...
84e37a15bbc9de691c67fa7127b894d32877a289ee9a7779744efb435e8e1602
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import numpy as np import pytest from astropy.io import ascii from astropy.io.ascii.core import InconsistentTableError from .common import assert_almost_equal, assert_equal def assert_equal_splitlines(arg1, arg2): assert_...
cd324804f53717d6fc803ae206b7c08658cb4344fe0b6456493ad01f3c23d08f
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import pytest from astropy.io import ascii from astropy.io.ascii.core import masked from astropy.io.ascii.ipac import Ipac, IpacFormatError, IpacFormatErrorDBMS from astropy.io.ascii.ui import read from astropy.table import Colum...
9d587df1296fb665d2a45428a3c41dd22fb582757dfa2cbbedf9a01663dd76c1
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some of the methods related to the ``HTML`` reader/writer and aims to document its functionality. Requires `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_ to be installed. """ from io import StringIO import numpy ...
8f54af3bb9e3ab7f7fd3250ce1a7a61c98cf620ddfa272a96e477c7e4ebe4ce0
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import numpy as np from astropy.utils.decorators import deprecated __all__ = [ "assert_equal", "assert_almost_equal", "assert_true", "setup_function", "teardown_function", "has_isnan", ] CWD = os.getcwd() TEST_DIR = o...
78427b0a8b1252146cfb9316ce94851adf02da042c3e013128748446def1831f
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy.io.ascii import read # NOTE: Python can be built without bz2 or lzma from astropy.utils.compat.optional_deps import HAS_BZ2, HAS_LZMA from astropy.utils.data import get_pkg_data_filename @pytest.mark.parame...
35c7bc35a52558c9655f18c472d950c63b5d34bb70b353d8d0669cba3b63ee8f
# 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 ...
8f286df228176533da952cc92dbe96491ca5733817e190b5ae29c3234c3d9e9a
# 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...
e7abdd9b52b454fe5e10e8392cae05d97f10023f21a52e694c619a5de07bf807
# 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...
edde1b9053da08606448cd6984edc26f21894b5fb9231d2b61a8eccf87cccbb3
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy.table import Column, Table from astropy.table.table_helpers import simple_table from astropy.utils.compat.optional_deps import HAS_BS4 from astropy.utils.data import get_pkg_data_filename files = [ "data/...
112fd09b3565277668cb62fd50776248a2a899e0a7c07f485a41d40204a8d7e7
# 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.io import ascii from .common import ( # noqa: F401 assert_almost_equal, assert_equal, setup_function, teardown_function, ) def read_table1(readme, data): ...
43a32e214f1cbdac8397258d7ebf4188536e57962367d8b6f878ec3de8f73f01
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO from astropy.io import ascii from .common import assert_almost_equal, assert_equal def assert_equal_splitlines(arg1, arg2): assert_equal(arg1.splitlines(), arg2.splitlines()) def test_read_normal(): """Normal SimpleRS...
db00a9568b1a6d78acb5efaf37a4f6465a51cfcdbc6875534cfacaaf5119e0a6
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import numpy as np from astropy.io import ascii from .common import assert_equal def test_types_from_dat(): converters = {"a": [ascii.convert_numpy(float)], "e": [ascii.convert_numpy(str)]} dat = ascii.read( ...
e960e0490ca9a3eff924f738144a15099d1524a2d7bc4ccc80c7ec259d8e1dea
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file connects ASDF to the astropy.table.Table class import warnings from astropy.io import registry as io_registry from astropy.io.misc.asdf.deprecation import create_asdf_deprecation_warning from astropy.table import Table from astropy.utils.compa...
e6146ac7a82b10233ba2f7396a140aaff76d528d337fc311eee5aa2e4553c987
from astropy.utils.exceptions import AstropyDeprecationWarning def create_asdf_deprecation_warning(): return AstropyDeprecationWarning( "ASDF functionality for astropy is being moved out of the astropy package to" " the new asdf-astropy package. Please use this package instead." " astropy....
9651180d7cfcf401e67c7083737e6bbd8be83278292d3ee0f868b6e76b6482ec
# Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings from asdf.types import CustomType, ExtensionTypeMeta from astropy.io.misc.asdf.deprecation import create_asdf_deprecation_warning __all__ = ["AstropyType", "AstropyAsdfType"] # Names of AstropyType or AstropyAsdfType subclasses that are...
307416d8665adcbc7fdb84f22e15f111cb79ab11d63be458976fbb040ab8cf3d
from pathlib import Path from astropy.utils.introspection import minversion def get_asdf_tests(): asdf_dir = Path(__file__).parent.resolve() paths = Path(asdf_dir).rglob("test_*.py") return [str(p.relative_to(asdf_dir)) for p in paths] collect_ignore = get_asdf_tests() try: import asdf except Impo...
dba8ca362f09cd0514fba49b4b92e1cabcc501837a2424a0448a2741b2d976cc
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from asdf.extension import AsdfExtension, BuiltinExtension from asdf.util import filepath_to_url # Make sure that all tag implementations are imported by the time we create # the extension class so that _astropy_asdf_types is populated correct...
4dbbed4644aad680ede7794711f57d2741e7caf47b5819a829b3596c0167c1f0
# Licensed under a 3-clause BSD style license - see LICENSE.rst # This file connects the readers/writers to the astropy.table.Table class import functools import os.path import astropy.io.registry as io_registry from astropy.table import Table from astropy.utils.misc import NOT_OVERWRITING_MSG __all__ = ["PANDAS_FMT...
840f927796feaa111a6932c1fe9929d1f30d9b9ebf37f0bf683a15b4debb007d
# Licensed under a 3-clause BSD style license - see LICENSE.rst from io import StringIO import numpy as np import pytest from astropy import units as u from astropy.coordinates import SkyCoord from astropy.io import ascii from astropy.io.misc.pandas import connect from astropy.table import QTable, Table from astropy...
a35beb4ef1d85f3558d624cc88788e71746f16cd3e200506508477c95d22eac0
# 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 ( Angle, CartesianRepresentation, EarthLocation, Latitude, Longitude, SkyCoord, SphericalCosLatDifferential, SphericalRepresen...
381b2e1be6207976f83b0a0fdd26b33ebfc880de5a18e70175252a1656df4118
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module tests some of the methods related to YAML serialization. """ from io import StringIO import numpy as np import pytest from astropy import units as u from astropy.coordinates import ( Angle, CartesianDifferential, CartesianRe...
268e73a5fec61e4fb795e70faa9aee85ad5b60ee9eeddeba559ef5cea5fff55e
# 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...
62b076083effdfc6bc15a8a0a03892c278e4f5cb430f718ee00ce5254bcbb476
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from astropy.io.misc import fnpickle, fnunpickle def test_fnpickling_simple(tmp_path): """ Tests the `fnpickle` and `fnupickle` functions' basic operation by pickling and unpickling a string, using both a filename and a fi...
6a4a8b83856ccfb18cc66afc57bc887b5a55fd2f0fc65f83e65bb332d47f210f
# Licensed under a 3-clause BSD style license - see LICENSE.rst # Define a constant to know if the entry points are installed, since this impacts # whether we can run the tests. from importlib.metadata import entry_points import pytest # TODO: Exclusively use select when Python minversion is 3.10 eps = entry_points...
a3959c90324e7bd385c67554d6c117657ecbff8accf2e14b3f40e4eedb30e0b4
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest asdf = pytest.importorskip("asdf") from astropy.table import Table def make_table(): a = [1, 4, 5] b = [2.0, 5.0, 8.2] c = ["x", "y", "z"] return Table([a, b, c], names=("a", "b", "c"), meta={"name": "first table"}) def...
92a4849101f0dc6cb1f3a92d38afe3d4bccc5560b292f44fd3f49b76fbe9a3b0
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.coordinates.tests.helper import skycoord_equal as _skycoord_equal from astropy.utils.decorators import deprecated __all__ = ["skycoord_equal"] @deprecated("5.1", alternative="astropy.coordinates.tests.helper.skycoord_equal") def skycoord_eq...
2abbc8e62a30e80b794dc1ea0f30ea19001761951c7e9e0001d2dcb6c22fbeab
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from asdf.tags.core.ndarray import NDArrayType from astropy import table from astropy.io.misc.asdf.types import AstropyAsdfType, AstropyType class TableType: """ This class defines to_tree and from_tree methods that are used b...
c76ed27d1281383c8a27088da2248c70a588aca6e265350703d6548b7e8866f1
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_array_equal from astropy import table from astropy.io import fits from astropy.io.misc.asdf.types import AstropyAsdfType, AstropyType class FitsType: name = "fits/fits" types = ["astropy.io.fits.HDUList"] req...
90ec9e072b9ce25969f8a918d6c7a7f5a3dfff5e104d92adf7e3ad7b0b9d9030
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from asdf.versioning import AsdfVersion from astropy.io.misc.asdf.types import AstropyAsdfType, AstropyType from astropy.modeling import functional_models, mappings from astropy.modeling.bounding_box import CompoundBoundingBox, ModelBou...
b7efe823d7389e11a9eea90c0d0f69e9d0cf3dd3330dd4d61ba07677adae98d0
from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling.models import Spline1D __all__ = ["SplineType"] class SplineType(TransformType): name = "transform/spline1d" version = "1.0.0" types = ["astropy.modeling.spline.Spline1D"] @classmethod def from_tree_transfo...
2c6b0452457d7e868f79da38cce3ac2f1130d21d4d426e0295c04b6234f1ca7a
# Licensed under a 3-clause BSD style license - see LICENSE.rst from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling import math_functions from astropy.modeling.math_functions import * # noqa: F401 from astropy.modeling.math_functions import __all__ as math_classes __all__ = ["NpU...
a229a419abd2864e3ae0d90880d932eca844c113830c665c40f489da301f90d2
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_array_equal from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling import functional_models from . import _parameter_to_value __all__ = [ "AiryDisk2DType", "Box1DType", "Box...
393a3378d7b2987d5abb3b8d8ee8eaf7d0c3f93b31a30bdba66d585bba451356
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_array_equal from astropy import modeling from astropy.io.misc.asdf.tags.transform.basic import TransformType from . import _parameter_to_value __all__ = ["AffineType", "Rotate2DType", "Rotate3DType", "RotationSequenceTyp...
709b69fc3fbcb66d2f085d39d5a48c949d658992ae5ad8f2bd002222e6654626
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from asdf.versioning import AsdfVersion from numpy.testing import assert_array_equal import astropy.units as u from astropy import modeling from astropy.io.misc.asdf.tags.transform.basic import TransformType from . import _parameter_to...
fe74c0698513181c441f3d0b0f62d531c3164bc427be97a1ed59ae515f3c9ba6
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from numpy.testing import assert_array_equal from astropy import modeling from astropy import units as u from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling.bounding_box import ModelBoundingBox __a...
55471f4fc67b37aedb5a5c9dda51baa05585780cfa1539fbabf254a882b6b377
# Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_array_equal from astropy.io.misc.asdf.tags.transform.basic import TransformType from astropy.modeling import physical_models from . import _parameter_to_value __all__ = ["BlackBody", "Drude1DType", "Plummer1DType"] cla...