The EUPS distrib facility (eups distrib ...
) has support for packaging and
publishing binary builds in a package format called "tarballs". Unlike the
"eupspkg" (source) package format that was the sole DM published product
format, "tarballs" are inherently tied to the microarchitecture and ABI of a
platform. As there are currently multiple supported "stack" build platforms, a
means of coordinating multiple independent binary builds from identical sources
is needed both to ensure consistency of product versions across platforms and
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 sre_parse import Pattern, SubPattern, parse as sre_parse | |
from sre_compile import compile as sre_compile | |
from sre_constants import BRANCH, SUBPATTERN | |
class Scanner(object): | |
def __init__(self, tokens, flags=0): | |
subpatterns = [] | |
pat = Pattern() |
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
git clone https://github.com/lsst-sqre/build-graph.git | |
cd build-graph/ | |
wget https://raw.githubusercontent.com/lsst/versiondb/master/manifests/b1780.txt | |
virtualenv deps | |
. deps/bin/activate | |
pip install -r requirements.txt | |
./deps.py b1780.txt |
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
{ | |
"Comment": "A new CNAME for jsick's Read the Docs documentation.", | |
"Changes": [ | |
{ | |
"Action": "CREATE", | |
"ResourceRecordSet": { | |
"Name": "docs.lsst.codes.", | |
"Type": "CNAME", | |
"SetIdentifier" : "Read the Docs", | |
"Weight": 10, |
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 astropy.table import Table, Column, join, vstack | |
from uncertainties import ufloat | |
import astropy.units as u | |
def uncert_str(tab_row, col_name, value_fmt): | |
''' format tab_row[col_name] single table row in LaTeX $num \pm unc$ format | |
input: tab_row: single row from an astropy table | |
col_name: name of column to be extracted and formatted | |
value_fmt: format for string output | |
output: |
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
/* | |
Minimal Facebook Messenger | |
========================== | |
1. Make a Fluid (http://fluidapp.com/) instance of https://facebook.com/messages/ | |
1. a. (You need to buy the paid version of Fluid to modify UserStyles) | |
2. Apply the below CSS as a Userstyles stylesheet | |
3. Like magic, you can now message without all the cruft of Full Facebook | |
First time:
python setup.py register
Uploading a new version:
python setup.py check
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 astropy.coordinates import ICRS, Galactic, Distance, Angle | |
from astropy import units as u | |
import math as mt | |
import numpy as np | |
from astropy.table import Table, Column | |
# inspired by | |
#http://idl-moustakas.googlecode.com/svn-history/r560/trunk/impro/hiiregions/im_hiiregion_deproject.pro | |
def correct_rgc(coord, glx_ctr=ICRS('00h42m44.33s +41d16m07.5s'), glx_PA=Angle('37d42m54s'), glx_incl=Angle('77.5d'), glx_dist=Distance(783,unit=u.kpc)): | |
'''computes deprojected galactocentric distance for an object at coord, |
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
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
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
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
NewerOlder