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 python | |
import sys | |
import pyarrow as pa | |
import pyarrow.parquet as pq | |
from helpers.io_utils import hlist2pandas | |
import tqdm | |
def main(input_filename): | |
reader = hlist2pandas(input_filename, sanitize_column_names=True, chunksize=1000000) |
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
# environment.yml | |
# Author: Yao-Yuan Mao @yymao | |
# Usage: | |
# wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh | |
# sh Miniforge3-Linux-x86_64.sh | |
# wget https://gist.githubusercontent.com/yymao/a1fcd607925996d8786a1d963fb01deb/raw/environment.yml | |
# mamba env create --file environment.yml | |
name: mypy | |
channels: |
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 python | |
from __future__ import print_function | |
import os | |
import sys | |
import subprocess | |
import json | |
import re | |
def abort(message, errorstatus=1): |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% hyperlink-year-only-natbib-patch.tex | |
% Gist URL: https://gist.github.com/yymao/eefa0bc6d881675b7e3c4bb7bee2b843 | |
% Raw URL: https://gist.githubusercontent.com/yymao/eefa0bc6d881675b7e3c4bb7bee2b843/raw/hyperlink-year-only-natbib-patch.tex | |
% Implementation taken from https://tex.stackexchange.com/a/27311 | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
\RequirePackage{hyperref} | |
\RequirePackage{natbib} | |
\RequirePackage{etoolbox} |
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
class Name(object): | |
""" | |
For better name comparison | |
""" | |
def __init__(self, name, exact=False): | |
self.name = name | |
if ',' in name: | |
name = '{0[1]} {0[0]}'.format(name.split(',')) | |
self.names = tuple((n.lower() for n in name.replace('-', ' ').replace('.', '. ').split() if n != '.')) | |
assert self.names, '*name* must not be empty' |
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
%% | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%% AASTeX61.cls %% | |
%% October 5, 2016 %% | |
%% December 28, 2016 (bug fix on .bib file) %% | |
%% Copyright 2016 American Astronomical Society %% | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
\def\currversion{6.1} |
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 python | |
import os | |
from shutil import copyfileobj | |
try: | |
from urllib.request import urlopen | |
except ImportError: | |
from urllib2 import urlopen | |
SLAC_KNOWN_HOSTS_URL = 'ftp://ftp.slac.stanford.edu/admin/known_hosts' | |
KNOWN_HOSTS_PATH = os.path.join(os.getenv('HOME'), '.ssh', 'known_hosts') |
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 python | |
from __future__ import print_function | |
import re | |
import argparse | |
def _find_ending_brace(s, open_brace=1): | |
escaping = False | |
output = '' | |
remain = '' |
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 python | |
from __future__ import print_function | |
import subprocess | |
import argparse | |
from contextlib import closing | |
import socket | |
import random | |
__author__ = 'Yao-Yuan Mao' |
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 python | |
import os | |
import time | |
from argparse import ArgumentParser | |
#user settings | |
_perl_exe = 'perl' | |
_default_ctrees_dir = os.getenv('HOME') + '/software/consistent-trees' | |
NewerOlder