Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# 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") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
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 |
This file contains hidden or 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
#!/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 \ |
This file contains hidden or 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 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) |
This file contains hidden or 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
============================= 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 |
This file contains hidden or 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 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 = { |
This file contains hidden or 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 gc | |
import sys | |
import inspect | |
from types import FunctionType | |
from typeguard import check_type | |
def annotation_checker(frame, event, arg): | |
try: |
This file contains hidden or 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 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]) |
NewerOlder