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
| #!/usr/bin/env bash | |
| # Sync the astropy GitHub org's issues/PRs/discussions/etc. into a | |
| # local git-versioned archive via github-backup. | |
| # | |
| # First invocation: full backfill (likely many hours for astropy/astropy | |
| # alone; run in tmux/screen the first time and just let it work). | |
| # Subsequent invocations: --incremental, only items whose updated_at | |
| # advanced since the last successful sync per resource. | |
| # | |
| # Safe to run from cron: holds a flock so overlapping runs no-op, |
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: |
NewerOlder