Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Remove all but the latest N versions from wheels on Anaconda.org
# Usefult to avoid building up too many files when uploading
# developer wheels.
from binstar_client.utils import get_server_api
KEEP_N_LATEST = 10
api = get_server_api(token=<TOKEN>)
package = api.package("astropy", "astropy")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def sample_dask_array_chunks(array, n_chunks):
"""
Return an 1-d array which contains the data values from n_chunks randomly
sampled from the chunks in the array (without replacement)
"""
# Find the indices of the chunks to extract
indices = [np.random.randint(dimsize, size=n_chunks) for dimsize in array.numblocks]
# Determine the boundaries of chunks along each dimension
#!/bin/bash -x
setfacl -m user:1000:r ${HOME}/.Xauthority
exec docker run \
-it \
--rm \
--name casa \
--net=host \
-e DISPLAY \
-v ${HOME}/.Xauthority:/home/user/.Xauthority \
-v ${HOME}/Code/glue:/glue \
import time
import uuid
import numpy as np
import dask.array as da
class ArrayLikeObject:
def __init__(self):
self._array = np.ones((20, 30), dtype=float)
============================= test session starts ==============================
platform linux -- Python 3.6.9[pypy-7.2.0-final], pytest-5.3.2, py-1.8.0, pluggy-0.13.1
Running tests with Astropy version 4.0.
Running tests in pypy/site-packages/astropy.
Date: 2019-12-18T11:05:26
Platform: Linux-5.3.0-24-generic-x86_64-with-debian-buster-sid
import numpy as np
from astropy.wcs.wcsapi import BaseLowLevelWCS
from astropy.coordinates import SkyCoord, EarthLocation
from astropy import units as u
# The following dictionary maps axis names to UCD1+ terms from
# http://www.ivoa.net/documents/latest/UCDlist.html
NAMES_TO_UCD = {
import gc
import sys
import inspect
from types import FunctionType
from typeguard import check_type
def annotation_checker(frame, event, arg):
try:
import os
import sys
import glob
import subprocess
import warnings
warnings.simplefilter('ignore')
for subpackage in sorted(glob.glob(os.path.join('astropy', '*'))):
if os.path.isdir(subpackage) and '_' not in subpackage and 'extern' not in subpackage:
output = subprocess.check_output([sys.executable, '-m', 'pytest', subpackage])