The main aim of the astropy-helpers
is to make it easier to build, test, and produce documentation in packages. For
example, it defines a python setup.py test
command that can be used to run
all the tests, and a python setup.py build_docs
command that will automatically
build the documentation using Sphinx. For more informaiton, see the
README.rst
file for astropy-helpers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cmap_kittens | |
from astropy.io import fits | |
import matplotlib.pyplot as plt | |
data = fits.getdata('monalisa.fits')[0] | |
plt.imshow(data, cmap='kittens', origin='lower') | |
plt.colorbar() | |
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glue.core import Data | |
from glue.config import viewer_tool | |
from glue.external.echo import keep_in_sync | |
from glue.viewers.common.tool import Tool | |
from glue.viewers.scatter.qt.data_viewer import ScatterViewer | |
from glue_vispy_viewers.scatter.scatter_viewer import VispyScatterViewer | |
@viewer_tool | |
class XYZViewersTool(Tool): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import click | |
import shutil | |
@click.command() | |
@click.option('--notebook', required=True) | |
@click.option('--template', required=True) | |
@click.option('--app', required=True) | |
def make_app(notebook, template, app): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import tarfile | |
import tempfile | |
import requests | |
BUILDS_URL = 'https://dev.azure.com/{pipeline_id}/_apis/build/builds' | |
ARTIFACTS_URL = BUILDS_URL + '/{build_id}/artifacts' | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import numpy as np | |
In [2]: x = np.arange(1000000) | |
In [3]: y = x[::2] | |
In [4]: y.__array_interface__ | |
Out[4]: | |
{'data': (4658720768, False), | |
'strides': (16,), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glue.core.data import BaseCartesianData | |
from glue.core.message import NumericalDataChangedMessage | |
class IndexedData(BaseCartesianData): | |
""" | |
A dataset where some dimensions have been removed via indexing. | |
""" | |
def __init__(self, original_data, indices): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmarks that have improved: | |
before after ratio | |
[df4c75aa] [66ff20b9] | |
- 28.4±0.03ms 4.85±0.01ms 0.17 coordinates.FrameBenchmarks.time_concatenate_array | |
- 24.3±0.03ms 3.36±0.03ms 0.14 coordinates.FrameBenchmarks.time_concatenate_scalar | |
- 1.08±0.01ms 744±2μs 0.69 coordinates.FrameBenchmarks.time_init_array | |
- 390±0.4μs 82.6±0.6μs 0.21 coordinates.FrameBenchmarks.time_init_nodata | |
- 905±2μs 556±1μs 0.61 coordinates.FrameBenchmarks.time_init_scalar | |
- 18.4±0.01ms 1.79±0ms 0.10 coordinates.FrameBenchmarks.time_init_scalar_diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\fixlen = T | |
\primary = 0 | |
\RowsRetrieved = 23938 | |
\QueryTime = 00:00:38.68672 | |
\ORIGIN = 'IPAC Infrared Science Archive (IRSA), Caltech/JPL' | |
\DATETIME= '2009-04-15 18:46:00' | |
\DataTag = 'ADS/IRSA.Gator#2009/0415/184600_12519' | |
\DATABASE= '2MASS All-Sky Point Source Catalog (PSC) (fp_psc)' | |
\EQUINOX = 'J2000' | |
\SKYAREA = 'within 1000 arcsec of ra=274.70073 dec=-13.80723 Eq J2000 ' |