hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
37502e803d17afb4e35f39125a442b13206fa4f2052c7132d8474b373a0d48ac | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import sys
from io import StringIO
import numpy as np
import pytest
from astropy import units as u
from astropy.cosmology import core, flrw
from astropy.cosmology.funcs import z_at_value
from astropy.cosmology.funcs.optimize import _z_at_... |
b349ccf86b74ca361c0ac7d55fff030fdcbda50b7f7a75173f9773a8a0617b90 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.__init__.py`."""
##############################################################################
# IMPORTS
import pytest
##############################################################################
# TESTS
#####... |
6edca3723c9ae850b110e8b986da59d2543a77e99b1406f8798cd7e38cb913a5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Testing :mod:`astropy.cosmology.flrw.base`."""
##############################################################################
# IMPORTS
# STDLIB
import abc
import copy
# THIRD PARTY
import numpy as np
import pytest
import astropy.constants as const... |
ecc438d3935c0c656a5d297a8cb9fa55f2555443d9b92c486d48d67a4b8314b5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import inspect
import random
import numpy as np
import pytest
from astropy.cosmology._io.model import _CosmologyModel, from_model, to_model
from astropy.cosmology.core import Cosmology
from astropy.cosmology.tests.helper import get_redshift_methods
from... |
79c067d8b675e1f41c25573893967d6ba452c447f197918489090858ef8be683 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from collections import OrderedDict
import numpy as np
import pytest
from astropy.cosmology import Cosmology
from astropy.cosmology._io.mapping import from_mapping, to_mapping
from .base import ToFromDirectTestBase, ToFromTestMixinBase
###############... |
83b48d4df6f8ca6ec8a59443ea6b00afc4dfe81319af9ba74bcec0a5479068ae | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.cosmology import Cosmology
from astropy.cosmology._io.table import from_table, to_table
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.table import QTable, Table, vstack
from .base import ToFromDirectTestBa... |
f281429e74c8ce8affb7811dc55ab29b19ce003533a0231e679feec5860aed03 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import astropy.units as u
from astropy.cosmology import Cosmology, FlatLambdaCDM, Planck18
from astropy.cosmology import units as cu
from astropy.cosmology._io.yaml import (
from_yaml,
to_yaml,
yaml_constructor,
yaml_represe... |
b8d7b24ae5de68e9ebcf0c175dd284ef0133d4a214f662fbd39b6da0a538cdf2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.cosmology._io.latex import _FORMAT_TABLE, write_latex
from astropy.io.registry.base import IORegistryError
from astropy.table import QTable, Table
from .base import ReadWriteDirectTestBase, ReadWriteTestMixinBase
class Write... |
cc536c5a98aa16ab47c288fabcfd07fe18e561c88648e92c75236e9a03cecc5f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import astropy.units as u
from astropy.cosmology._io.html import _FORMAT_TABLE, read_html_table, write_html_table
from astropy.cosmology.parameter import Parameter
from astropy.table import QTable, Table, vstack
from astropy.units.decorator... |
2bc897f417d830bfc25e38da3aa3c01c18f18da66e8dfd2eea595bc5fa33222b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.cosmology._io.ecsv import read_ecsv, write_ecsv
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.table import QTable, Table, vstack
from .base import ReadWriteDirectTestBase, ReadWriteTestMixinBase
#########... |
459439a184318110fee35c680b9ba1345dd8775febbecfa33855fe6af3dbc625 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import astropy.units as u
from astropy.cosmology import Cosmology, Parameter, realizations
from astropy.cosmology import units as cu
from astropy.cosmology.core import _COSMOLOGY_CLASSES
from astropy.cosmology.realizations import available
... |
5ac895ae936a317eb8e37d447da669cfc143d51ce64b05a212fa3ae73c1a3735 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.cosmology._io.row import from_row, to_row
from astropy.cosmology.core import _COSMOLOGY_CLASSES, Cosmology
from astropy.table import Row
from .base import ToFromDirectTestBase, ToFromTestMixinBase
############################... |
261e3a59d075548be7f74327afe909d8b9a4b22a5c1316dc5a2617985bbb7a41 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import json
import os
import pytest
import astropy.units as u
from astropy.cosmology import units as cu
from astropy.cosmology.connect import readwrite_registry
from astropy.cosmology.core import Cosmology
from .base import ReadWriteDirectTestBase, Rea... |
5824381f82bb617021489ae1c9242eadd13cfe00b0bbbf9afd356ec7e8543292 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from astropy.cosmology._io.cosmology import from_cosmology, to_cosmology
from .base import IODirectTestBase, ToFromTestMixinBase
###############################################################################
class ToFromCosmologyTestMi... |
253de22657422a1dc8d4b17c56d75f1df34cda2ff440de49c975d10783e8f8ec | #!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import glob
import ah_bootstrap
from setuptools import setup
from astropy_helpers.setup_helpers import (
register_commands, get_package_info, get_debug_option)
from astropy_helpers.distutils_helpers import ... |
2c630f38c06b25a303ca9298b0a3734ceedca96283a08633dc5ba741c8a7eae5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
pytest_plugins = [
'astropy.tests.plugins.config',
'astropy.tests.plugins.display',
]
|
32bd643ff3af1967c2109440da5f0f0e2fdb00cd09ef415fc9f7e7e4cb843638 | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... |
156a401bf6ed7df5fefd164e17e55083757da06016c37ea375d28243929e680a | #!/usr/bin/env python
"""
Setuptools bootstrapping installer.
Maintained at https://github.com/pypa/setuptools/tree/bootstrap.
Run this script to install or upgrade setuptools.
This method is DEPRECATED. Check https://github.com/pypa/setuptools/issues/581 for more details.
"""
import os
import shutil
import sys
im... |
7777fbe3bc80230eac159a10ec500e03393a34c160830773a78c56eed2918450 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Astropy is a package intended to contain core functionality and some
common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for
managing them.
"""
import sy... |
54b8d4374ca4303f36d4381fad642b2d0f9e26505f2efc0fc822f98a114cca58 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file contains pytest configuration settings that are astropy-specific
(i.e. those that would not necessarily be shared by affiliated packages
making use of astropy's test runner).
"""
from importlib.util import find_spec
from astropy.tests.plugi... |
8057d44bebca904660e99827f673f5fc8fed789bf066af0fe47426747c0975ce | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
return {'astropy': ['astropy.cfg']}
|
e8859df6fc847f09f0e2abedd5cbf04e0375b085311758daea4c3be927a192f0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module defines a logging class based on the built-in logging module"""
import inspect
import os
import sys
import logging
import warnings
from contextlib import contextmanager
from . import config as _config
from . import conf as _conf
from .util... |
7b4869b5007e574121a52db58035059de1f6211e72b049914935739e18bbbbfc | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
#
# Astropy documentation build configuration file.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this file.
#
# All configurati... |
b58a788365928d3a739f9df60cedc17eb8a48fe9e634dd89dd796c14cc3c09d0 | # -*- coding: utf-8 -*-
"""
========================
Title of Example
========================
This example <verb> <active tense> <does something>.
The example uses <packages> to <do something> and <other package> to <do other
thing>. Include links to referenced packages like this: `astropy.io.fits` to
show the astro... |
4cc48754070010c8109d4cd80648a363617a4e1103a29743e3e6c6cb23ad12f6 | # -*- coding: utf-8 -*-
"""
========================================================================
Transforming positions and velocities to and from a Galactocentric frame
========================================================================
This document shows a few examples of how to use and customize the
`~ast... |
acf72c7d45b714149a27d722fc07da683b5f9d96dc19f47977057d7d25427204 | # -*- coding: utf-8 -*-
"""
===================================================================
Determining and plotting the altitude/azimuth of a celestial object
===================================================================
This example demonstrates coordinate transformations and the creation of
visibility cur... |
5e10cacac7b3876e1564e6a3008f5448ab228d0e8c1cfa21e89a276700ff877f | # -*- coding: utf-8 -*-
"""
================================================================
Convert a radial velocity to the Galactic Standard of Rest (GSR)
================================================================
Radial or line-of-sight velocities of sources are often reported in a
Heliocentric or Solar-syst... |
d9f332bf55abee762b182ceac1bb11e3c82cea9c833521d0be52d43c888650ca | # -*- coding: utf-8 -*-
"""
==========================================================
Create a new coordinate class (for the Sagittarius stream)
==========================================================
This document describes in detail how to subclass and define a custom spherical
coordinate frame, as discussed in ... |
f02043221ece54730f468542cac47fbe467917e71c50da1c69c6667d82c7b190 | # -*- coding: utf-8 -*-
"""
=====================================================
Create a multi-extension FITS (MEF) file from scratch
=====================================================
This example demonstrates how to create a multi-extension FITS (MEF)
file from scratch using `astropy.io.fits`.
----------------... |
6d5e36720c0cc9f7e44ed1440757538afabbe214ccafe1d09047e6ffebb75a3b | # -*- coding: utf-8 -*-
"""
==================
Edit a FITS header
==================
This example describes how to edit a value in a FITS header
using `astropy.io.fits`.
-------------------
*By: Adrian Price-Whelan*
*License: BSD*
-------------------
"""
from astropy.io import fits
#############################... |
fd7e56aed30b48c9be3e1c7d95eb537af8983306b2119be09b348a916e3068c3 | # -*- coding: utf-8 -*-
"""
=======================================
Read and plot an image from a FITS file
=======================================
This example opens an image stored in a FITS file and displays it to the screen.
This example uses `astropy.utils.data` to download the file, `astropy.io.fits` to open
th... |
ee95409a1acf713ff32ea85cf3b7ee4c223479577cb7383eca499271b8a2b63f | # -*- coding: utf-8 -*-
"""
==========================================
Create a very large FITS file from scratch
==========================================
This example demonstrates how to create a large file (larger than will fit in
memory) from scratch using `astropy.io.fits`.
-------------------
*By: Erik Bray*
... |
ea7456f9855eb9c4935d4065e10d34eb3a42f04ad2ed54e266c5ab12450c8714 | # -*- coding: utf-8 -*-
"""
=====================================================================
Accessing data stored as a table in a multi-extension FITS (MEF) file
=====================================================================
FITS files can often contain large amount of multi-dimensional data and
tables. T... |
34d826133a5a8acd7d52504aaf8b66c5d8e2b62438758251e4314e6c10f1995d | # -*- coding: utf-8 -*-
"""
=====================================================
Convert a 3-color image (JPG) to separate FITS images
=====================================================
This example opens an RGB JPEG image and writes out each channel as a separate
FITS (image) file.
This example uses `pillow <htt... |
e515fb4027e7cc5b3edee6ed7969b2adf9b6949336fb2d0a452a104ab747587e | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import warnings
from ..utils.exceptions import AstropyUserWarning
__all__ = ['SigmaClip', 'sigma_clip', 'sigma_clipped_stats']
class SigmaClip:
"""
Class to perform sigma clipping.
The data will be iterated over, each t... |
e3e6eb66476d9d5040c0a4a432615db8e3acb985ad92129119ac911007683332 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Bayesian Blocks for Time Series Analysis
========================================
Dynamic programming algorithm for solving a piecewise-constant model for
various datasets. This is based on the algorithm presented in Scargle
et al 2012 [1]_. This cod... |
57290e5210c5681afd7178c4491ad792ac1b14e257c1a1b94cc1985dcdbc47da | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains statistical tools provided for or used by Astropy.
While the `scipy.stats` package contains a wide range of statistical
tools, it is a general-purpose package, and is missing some that are
particularly useful to astronomy or a... |
fae1ea9b444cb1ad61241a0e5ebc647c23d560c2d6f1c435ba970dc0ae9514e5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple functions for dealing with circular statistics, for
instance, mean, variance, standard deviation, correlation coefficient, and so
on. This module also cover tests of uniformity, e.g., the Rayleigh and V tests.
The Maximum L... |
c7e7f05997296765746f4db5c2598e350b6aa478e4d3b73d08804b2ff68600cb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements functions and classes for spatial statistics.
"""
import numpy as np
import math
class RipleysKEstimator:
"""
Estimators for Ripley's K function for two-dimensional spatial data.
See [1]_, [2]_, [3]_, [4]_, [5]_ f... |
444bd19dfcdf9ff143504d21a1e3a6dc27c27906dadbda28319af231a7291d4e | # 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... |
2f536f287346a69180458203b7f150bd7c7607a25aab558ce1720e4ce0d18c75 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains simple functions for model selection.
"""
import numpy as np
__all__ = ['bayesian_info_criterion', 'bayesian_info_criterion_lsq',
'akaike_info_criterion', 'akaike_info_criterion_lsq']
__doctest_requires__ = {'bayesia... |
225e38e7a4c0605b81d127f43f389a0447b09816acc9bce09a64bc11b17cc043 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains functions for computing robust statistics using
Tukey's biweight function.
"""
import numpy as np
from .funcs import median_absolute_deviation
from ..utils.decorators import deprecated_renamed_argument
__all__ = ['biweight_loc... |
7e5b44e45cab1846754f344d45f9a03e2a140c511445b28b6571316019f948b6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Methods for selecting the bin width of histograms
Ported from the astroML project: http://astroML.org/
"""
import numpy as np
from . import bayesian_blocks
__all__ = ['histogram', 'scott_bin_width', 'freedman_bin_width',
'knuth_bin_wid... |
88ce92a9dfeda529e18ce5a7734e783744571da83453bfaac208dc7e775ddba6 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
__all__ = ['jackknife_resampling', 'jackknife_stats']
__doctest_requires__ = {'jackknife_stats': ['scipy.special']}
def jackknife_resampling(data):
""" Performs jackknife resampling on numpy arrays.
Jackknife resampling is ... |
cffd4a1b35b001b5c3ae01cdc646de113f584b95f037072d72af99e904742534 | """
Table property for providing information about table.
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
import os
import numpy as np
from ..utils.data_info import DataInfo
__all__ = ['table_info', 'TableInfo']
def table_info(tbl, option='attributes', out=''):
"""
Write summa... |
cd641a6b0ca9fb2f562b0057f35b27b9b2c1c0062af86e376130f3ad56a41da8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... |
9533b12b8825b2fd259b8be28d2f415e8e310c9dedc59e3603a852ee6343df2d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from os.path import abspath, dirname, join
from .table import Table
from ..io import registry as io_registry
from .. import config as _config
from .. import extern
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.... |
3a8c3e9e624b2538c50a960f4ee694f9632cb1ceb62d0f8a27b0323692e5b54f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import collections
import numpy as np
class Row:
"""A class to represent one row of a Table object.
A Row object is returned when a Table object is indexed with an integer
or when iterating over a table::
>>> from astropy.table imp... |
d5f7121487277db9d629f31edd6260a989e50d50faf3944a9dcf871017da5284 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import platform
import warnings
import numpy as np
from .index import get_index
from ..utils.exceptions import AstropyUserWarning
__all__ = ['TableGroups', 'ColumnGroups']
def table_group_by(table, keys):
# index copies are unnecessary and slow ... |
96d437f615c402d9d35972f261d7e8985a036fb420117c65de2055ce3de91b58 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .index import TableIndices, TableLoc, TableILoc, TableLocIndices
import re
import sys
from collections import OrderedDict, Mapping
import warnings
from copy import deepcopy
import numpy as np
from numpy import ma
from .. import log
from ..io import... |
e9780196543c25162f060aa9f0bafc5f94208a991f5aab9bc9d66ee63468ee17 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .. import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astropy.table`.
"""
auto_colname = _config.ConfigItem(
'col{0}',
'The template that determines the name of a column ... |
32eb03761f2275626c281b0a3027682fa6b28d795b7ecef7781cf4d0ae2e71a2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import weakref
import re
from copy import deepcopy
import numpy as np
from numpy import ma
# Remove this when Numpy no longer emits this warning and that Numpy version
# becomes the minimum required version for Astropy.
# https://github... |
06177cfc44ad79c472030c621c8175466133bfa65b0742948e30613e5d9bd87a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import operator
import numpy as np
class MaxValue:
'''
Represents an infinite value for purposes
of tuple comparison.
'''
def __gt__(self, other):
return True
def __ge__(self, other):
return True
def __lt__(... |
cac02eb7154ca07bf77b9f2b6d56c01e767d639c56d787b0a69c9be3c1636c07 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import sys
import re
import numpy as np
from .. import log
from ..utils.console import Getch, color_print, terminal_size, conf
from ..utils.data_info import dtype_info_name
__all__ = []
def default_format_func(format_, val):
if isinstan... |
dccdaf50f189b8ef4960a13da0c420ecb823c9ade93b979113304d5e81f650d0 | """
High-level table operations:
- join()
- setdiff()
- hstack()
- vstack()
"""
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from copy import deepcopy
import warnings
import collections
import itertools
from collections import OrderedDict, Counter
import numpy as np
from numpy import ma
from ..ut... |
14cec9473b334dbbe97477d84e9f8d006f90c143452e8b763377da53654d734e | """
High-level operations for numpy structured arrays.
Some code and inspiration taken from numpy.lib.recfunctions.join_by().
Redistribution license restrictions apply.
"""
from itertools import chain
import collections
from collections import OrderedDict, Counter
import numpy as np
import numpy.ma as ma
from . imp... |
9d7f2000bc50b5a112b275f8f0e598aae9d529ea2f1b078fdf3ae9b6b362781c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from distutils.extension import Extension
ROOT = os.path.relpath(os.path.dirname(__file__))
def get_extensions():
sources = ["_np_utils.pyx", "_column_mixins.pyx"]
include_dirs = ['numpy']
exts = [
Extension(name='astropy... |
e1bf51dd09c6d4d854b2d8ecb7f222e84d36584651750d4e9bfebe37698cf5bb | import textwrap
import copy
from collections import OrderedDict
__all__ = ['get_header_from_yaml', 'get_yaml_from_header', 'get_yaml_from_table']
class ColumnOrderList(list):
"""
List of tuples that sorts in a specific order that makes sense for
astropy table column attributes.
"""
def sort(sel... |
58edfe951fdde85d1f79bf0d7adbc0ce2d34d1e54a391ed0ad93d5661306cdb8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
def _searchsorted(array, val, side='left'):
'''
Call np.searchsorted or use a custom binary
search if necessary.
'''
if hasattr(array, 'searchsorted'):
return array.searchsorted(val, side=side)
# Python ... |
19f7f0f4a3a84109418be6cca20be0efae782bfdc73ac802490e271328027d72 | from importlib import import_module
import re
from copy import deepcopy
from ..utils.data_info import MixinInfo
from .column import Column
from .table import Table, QTable, has_info_class
from ..units.quantity import QuantityInfo
__construct_mixin_classes = ('astropy.time.core.Time',
'as... |
63b78bd566590e4e295d3d90a7dab36091ff6b69a9c64ba935f242c79be8d4d0 | # -*- coding: utf-8 -*-
ascii_coded = 'Ò♙♙♙♙♙♙♙♙♌♐♐♌♙♙♙♙♙♙♌♌♙♙Ò♙♙♙♙♙♙♙♘♐♐♐♈♙♙♙♙♙♌♐♐♐♔Ò♙♙♌♈♙♙♌♐♈♈♙♙♙♙♙♙♙♙♈♐♐♙Ò♙♐♙♙♙♐♐♙♙♙♙♙♙♙♙♙♙♙♙♙♙♙Ò♐♔♙♙♘♐♐♙♙♌♐♐♔♙♙♌♌♌♙♙♙♌Ò♐♐♙♙♘♐♐♌♙♈♐♈♙♙♙♈♐♐♙♙♘♔Ò♐♐♌♙♘♐♐♐♌♌♙♙♌♌♌♙♈♈♙♌♐♐Ò♘♐♐♐♌♐♐♐♐♐♐♌♙♈♙♌♐♐♐♐♐♔Ò♘♐♐♐♐♐♐♐♐♐♐♐♐♈♈♐♐♐♐♐♐♙Ò♙♘♐♐♐♐♈♐♐♐♐♐♐♙♙♐♐♐♐♐♙♙Ò♙♙♙♈♈♈♙♙♐♐♐♐♐♔♙♐♐♐♐♈♙♙Ò♙♙♙♙♙♙♙♙♙♈♈♐♐♐♙♈♈♈♙♙♙♙Ò'
a... |
7fe5cb9d72ef83eb9128cfb3c983ebfdbee66a3ff71d0e53ac54d0f551847d57 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Helper functions for table development, mostly creating useful
tables for testing.
"""
from itertools import cycle
import string
import numpy as np
from .table import Table, Column
from ..utils.data_info import ParentDtypeInfo
class TimingTables:... |
9c45a19c8e74da0c26d242cf6c8ef504f1ad856a775983d550ebfcd84cc38210 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import numpy as np
from .core import Kernel1D, Kernel2D, Kernel
from .utils import KernelSizeError
from ..modeling import models
from ..modeling.core import Fittable1DModel, Fittable2DModel
from ..utils.decorators import deprecated_renamed_a... |
87efd49eba4cf3a4f5823185d5e70b68f94d11280045d0afe22210543af9b45f | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains the convolution and filter functionalities of astropy.
A few conceptual notes:
A filter kernel is mainly characterized by its response function. In the 1D
case we speak of "impulse response function", in the 2D case we call it "po... |
0ae4cf6946cebc016ed90451ed9294b185102f74aee0cf6d8dabc86e41bd4936 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .core import *
from .kernels import *
from .utils import discretize_model
try:
# Not guaranteed available at setup time
from .convolve import convolve, convolve_fft, interpolate_replace_nans, convolve_models
except ImportError:
if not _... |
8cd670f5b1439060f1f5a089ae40662748b0841fbc495d8049b31981c5c669c8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ..modeling.core import FittableModel, custom_model
__all__ = ['discretize_model']
class DiscretizationError(Exception):
"""
Called when discretization of models goes wrong.
"""
class KernelSizeError(Exception):
... |
31e855b28433d25beb7f95dc99f65cb41a20cca0ac5d9a71b7a50662e45a2338 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from functools import partial
from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION
from ..utils.exceptions import AstropyUserWarning
from ..utils.console import human_file_size
from ..utils.decorators impor... |
3a31f66c637e99055a4f4565c425a6c9912405f7d7076e4c8c18f7d1a367cbf0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module contains classes and functions to standardize access to
configuration files for Astropy and affiliated packages.
.. note::
The configuration system makes use of the 'configobj' package, which stores
configuration in a text format li... |
608f960f70d8f5adec0f2a2cb4aace60fd4bc1a37795e324a30958a84e2cd62a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" This module contains functions to determine where configuration and
data/cache files used by Astropy should be placed.
"""
from ..utils.decorators import wraps
import os
import shutil
import sys
__all__ = ['get_config_dir', 'get_cache_dir', 'set_te... |
2ed3175203f19f263f30f5d18c91914135da3d89acb86ab738b82d7d0f087fd2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
return {
str('astropy.config.tests'): ['data/*.cfg']
}
|
5ac70e74d82e46691e6ca7ee5a3768aa5260994e99df89a101d11e6830467b33 | # 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... |
be17316456660f161cda727d5ec15748a4da313a736b1ab725b882ed0073afc0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module defines two classes that deal with parameters.
It is unlikely users will need to work with these classes directly, unless they
define their own models.
"""
import functools
import numbers
import types
import operator
import numpy as np... |
c66b04270b93ef12ee28868f7d91cc15de70e26ea6bca2dac8091bf90bf84456 | # 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... |
cd555bcec03ec1b3b139ade2664745a66c4e4948c7bf9253ebb46d8abe526664 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Creates a common namespace for all pre-defined models.
"""
from .core import custom_model # pylint: disable=W0611
from .mappings import *
from .projections import *
from .rotations import *
from .polynomial import *
from .functional_models import *... |
9fadff46cf02d5fb3ed3ad4f9fb967c54f2fea92b03c81666e4ec93df0eb0231 | """
Special models useful for complex compound models where control is needed over
which outputs from a source model are mapped to which inputs of a target model.
"""
from .core import FittableModel
__all__ = ['Mapping', 'Identity']
class Mapping(FittableModel):
"""
Allows inputs to be reordered, duplicate... |
3ebdbd6e608be84baae96e7a7fc3cf12837f0ccd4250027c217c45d77099728a | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Model and functions related to blackbody radiation.
.. _blackbody-planck-law:
Blackbody Radiation
-------------------
Blackbody flux is calculated with Planck law
(:ref:`Rybicki & Lightman 1979 <ref-rybicki1979>`):
.. math::
B_{\\lambda}(T) = ... |
82fe5a1cfc7144462f126d80c6745462501540bc79fb6c997e9ed96d5d8e6e7b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Optimization algorithms used in `~astropy.modeling.fitting`.
"""
import warnings
import abc
import numpy as np
from ..utils.exceptions import AstropyUserWarning
__all__ = ["Optimization", "SLSQP", "Simplex"]
# Maximum number of iterations
DEFAULT_M... |
f37129005be7b5868442fbbaf6843a376a59279b3a9968038c2029966e90a9b0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Implements rotations, including spherical rotations as defined in WCS Paper II
[1]_
`RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in
WCS Paper II to rotate to/from a native sphere and the celestial sphere.
The implement... |
49c587feb89d4da20c2e7735d206b168f98e4ab9949e42065655230b4af6f2af | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from os.path import join
from distutils.core import Extension
from distutils import log
from astropy_helpers import setup_helpers, utils
from astropy_helpers.version_helpers import get_pkg_version_module
wcs_setup_package = utils.import_file(... |
27ae6f39535c3c76b612a745a6d94047f3c6743283f470a17bfc46a28c39e12d | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Functions to determine if a model is separable, i.e.
if the model outputs are independent.
It analyzes ``n_inputs``, ``n_outputs`` and the operators
in a compound model by stepping through the transforms
and creating a ``coord_matrix`` of shape (``n_... |
c8b8c18c672b907b8bb18ac0fd3468434593e3666bd3ec793cd7e0f27f1308ee | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides utility functions for the models package
"""
from collections import deque, MutableMapping
from inspect import signature
import numpy as np
from ..utils import isiterable, check_broadcast
from ..utils.compat import NUMPY_LT_1... |
ec60aca1b59ad1e72bc4578b6067c1bed8b18be8aa1c3c8a60898d00d55e7404 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Mathematical models."""
from collections import OrderedDict
import numpy as np
from .core import (Fittable1DModel, Fittable2DModel,
ModelDefinitionError)
from .parameters import Parameter, InputParameterError
from .utils import e... |
8b83f267e5e5b97cec3189fb94e17b812c437bfb40f19640f386743785ee735c | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
Implements projections--particularly sky projections defined in WCS Paper II
[1]_.
All angles are set and and displayed in degrees but internally computations are
performed in radians. All functions expect inputs and outputs d... |
9a90ca5eabae74e6c1b92f532ea899b8b0d54605008bbff7ac3ed1b3cbf60b73 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains models representing polynomials and polynomial series.
"""
from collections import OrderedDict
import numpy as np
from .core import FittableModel, Model
from .functional_models import Shift
from .parameters import Parameter
fro... |
00b7e4aa1e91a0180bf2b2538d2c2ac6c46e3bdbdfefaddef203c2bfc93f8bd3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tabular models.
Tabular models of any dimension can be created using `tabular_model`.
For convenience `Tabular1D` and `Tabular2D` are provided.
Examples
--------
>>> table = np.array([[ 3., 0., 0.],
... [ 0., 2., 0.],
... ... |
715e1d31ff069e56d5200f432e64600c6e66698ca84b44a91a2272e58fb36196 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Statistic functions used in `~astropy.modeling.fitting`.
"""
import numpy as np
__all__ = ['leastsquare']
def leastsquare(measured_vals, updated_model, weights, x, y=None):
"""
Least square statistic with optional weights.
Parameters
... |
fbc852b8f0c7c95d6d62c34727f4a05ab6d8868aad5019a3b17871397592a9d8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Power law model variants
"""
from collections import OrderedDict
import numpy as np
from .core import Fittable1DModel
from .parameters import Parameter, InputParameterError
from ..units import Quantity
__all__ = ['PowerLaw1D', 'BrokenPowerLaw1D',... |
39e241058122a1605440a3956bbcd3626214ab8b122556d4cc17339b70b984e0 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import os
import select
import socket
import threading
import time
import uuid
import warnings
import queue
import xmlrpc.client as xmlrpc
from urllib.parse import urlunparse
from .. import log
from .constants import SAMP_STATUS_OK
from .co... |
1513a729a2ebb529b7bbd2d6938e632d23554e2d0f788d171fb949010f5c7b41 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# TODO: this file should be refactored to use a more thread-safe and
# race-condition-safe lockfile mechanism.
import datetime
import os
import socket
import stat
import warnings
from contextlib import suppress
from urllib.parse import urlparse
import x... |
ca15eb1658e3b872c90d62c8b2568d2374e204a06da87d8ada35f3d60e77b5b8 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import time
import sys
import argparse
from .. import log, __version__
from .hub import SAMPHubServer
__all__ = ['main']
def hub_script(timeout=0):
"""
This main function is executed by the ``samp_hub`` command line tool.
"""... |
c692d281d305330486ada8b88459bdbe028ffe8c7a53fb242cff087fc4a158f4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines custom errors and exceptions used in `astropy.samp`.
"""
import xmlrpc.client as xmlrpc
from ..utils.exceptions import AstropyUserWarning
__all__ = ['SAMPWarning', 'SAMPHubError', 'SAMPClientError', 'SAMPProxyError']
class SAMPWarning(As... |
30f5e1d868844e138c342963522851e4b3f928adc7d0ca0cdf59b2701f792035 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from urllib.parse import parse_qs
from urllib.request import urlopen
from ..utils.data import get_pkg_data_contents
from .standard_profile import (SAMPSimpleXMLRPCRequestHandler,
ThreadingXMLRPCServer)
__all__ = []
CROS... |
9d9475e638e9a55ef2f476ded6d6a1defda8a6d54604c5da57959ca024610ba1 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from .client import SAMPClient
from .hub_proxy import SAMPHubProxy
__all__ = ['SAMPIntegratedClient']
__doctest_skip__ = ['SAMPIntegratedClient.*']
class SAMPIntegratedClient:
"""
A Simple SAMP client.
This class is meant to simplify the... |
faca97c7571b8ba4671ac8fb7604af055e7c59239ff69b90a6806c0f02152016 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage provides classes to communicate with other applications via the
`Simple Application Messaging Protocal (SAMP)
<http://www.ivoa.net/documents/SAMP/>`_.
Before integration into Astropy it was known as
`SAMPy <https://pypi.python.org/pypi... |
305e16ee68c793e1ec16331107f881cc2743ff58d3855755bf5ccb7d9d73d3b9 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import os
import select
import socket
import threading
import warnings
from urllib.parse import urlunparse
from .constants import SAMP_STATUS_OK, SAMP_STATUS_WARNING
from .hub import SAMPHubServer
from .errors import SAMPClientError, SAMPWar... |
28511a0670ba5f8dbe6bb3f69e7ab40287a61655d78f03e9652ac73fa8cf4b2b | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
def get_package_data():
return {
'astropy.samp': [os.path.join('data', '*')],
'astropy.samp.tests': [os.path.join('data', '*')]
}
|
656b29d8b13fa8b34968162a39e209afc8b52b377d34077c9abb42a226a6b5fa | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utility functions and classes
"""
import queue
import inspect
import traceback
from io import StringIO
import xmlrpc.client as xmlrpc
from urllib.request import urlopen
from .constants import SAMP_STATUS_ERROR
from .errors import SAMPProxyError
de... |
48a9acf52f554461a5fe4f0a5c6883981292748b94fe0048ba53b6e5e30fdb07 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines constants used in `astropy.samp`.
"""
from ..utils.data import get_pkg_data_filename
__all__ = ['SAMP_STATUS_OK', 'SAMP_STATUS_WARNING', 'SAMP_STATUS_ERROR',
'SAFE_MTYPES', 'SAMP_ICON']
__profile_version__ = "1.3"
#: General con... |
84dcb74a18b3548cf158fb06ba99ab1fd027a9f7ae738f3bf86603043c7244bb | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import copy
import xmlrpc.client as xmlrpc
from .errors import SAMPHubError
from .utils import ServerProxyPool
from .lockfile_helpers import get_main_running_hub
__all__ = ['SAMPHubProxy']
class SAMPHubProxy:
"""
Proxy class to simplify the ... |
82e1dcd4dcee323e9ac02d478901511cb42bc5b42a9c30297da5b8c2bbe4070a | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Sundry function and class decorators."""
import functools
import inspect
import textwrap
import types
import warnings
from inspect import signature
from .codegen import make_function_with_signature
from .exceptions import (As... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.