Skip to content

Instantly share code, notes, and snippets.

View lpsinger's full-sized avatar
🧗

Leo Singer lpsinger

🧗
View GitHub Profile
@lpsinger
lpsinger / gpmetis.py
Created May 30, 2025 18:53
Call METIS from Python
import subprocess
from pathlib import Path
import tempfile
from numpy import typing as npt
def gpmetis(
edge_weights_matrix: npt.ArrayLike,
n_partitions: int,
seed: int = 1,
@lpsinger
lpsinger / bar.py
Created April 9, 2024 18:37
Example of collection doctests from a Python function defined in a C function; has __doc__ but not __code__
from functools import wraps
from foo import hello as _hello
def wrap_it(func):
@wraps(func)
def wrapper(*args, **kwargs):
return result
return wrapper
@lpsinger
lpsinger / output.txt
Created November 20, 2023 17:50
@architect/sandbox test failure
$ npm run coverage
> @architect/[email protected] coverage
> nyc --reporter=lcov --reporter=text npm run test:unit
> @architect/[email protected] test:unit
> cross-env tape 'test/unit/**/*-test.js' | tap-arc
@lpsinger
lpsinger / cla
Last active January 27, 2021 03:09
NASA Individual Contributor License Agreement
# NASA Individual Contributor License Agreement
In order to clarify the intellectual property license granted with
Contributions from any person or entity, The United States of America as
represented by the Administrator of the National Aeronautics and Space
Administration ("NASA") must have a Contributor License Agreement ("Agreement"
or "CLA") on file that has been signed by each Contributor, indicating
agreement to the license terms below. These terms apply to Your Contributions
to the project named above ("Project Software"), including source code, object
code and accompanying documentation, if any. This license is for Your
@lpsinger
lpsinger / Dockerfile
Last active July 15, 2020 23:43
SQLAlchemy example of broken index expression in MySQL
FROM python
RUN pip install --no-cache-dir sqlalchemy pymysql cryptography
COPY test.py /
ENTRYPOINT /test.py
@lpsinger
lpsinger / dump.sql
Last active February 20, 2020 04:13
HEALPix intersection example
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.1 (Debian 12.1-1.pgdg100+1)
-- Dumped by pg_dump version 12.1 (Debian 12.1-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
@lpsinger
lpsinger / tasks.json
Last active December 9, 2019 18:31
GWCelery task visualization
[
{
"uuid": "27569dae-2df5-460f-968f-d92f501eea08",
"name": "gwcelery.tasks.gracedb.create_label",
"state": "SUCCESS",
"received": 1575913287.074348,
"sent": null,
"started": 1575913287.0789192,
"rejected": null,
"succeeded": 1575913287.5497715,
@lpsinger
lpsinger / build.log
Created February 21, 2019 17:23
Skipped components in MacPorts HTCondor build
...
-- external skipped (drmaa)
-- external skipped (qpid)
-- Boost components: python
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- python
-- external configured (BOOST_INCLUDE=/opt/local/include) version:(106600) link directories (/opt/local/lib)
-- external configured (CURL_FOUND=/opt/local/lib/libcurl.dylib)
-- external configured (OPENSSL_FOUND=/opt/local/lib/libssl.dylib;/opt/local/lib/libcrypto.dylib)
@lpsinger
lpsinger / ShadowLog
Created February 21, 2019 16:21
MacPorts ShadowLog
02/21/19 09:54:52 ******************************************************
02/21/19 09:54:52 ** condor_shadow (CONDOR_SHADOW) STARTING UP
02/21/19 09:54:52 ** /opt/local/sbin/condor_shadow
02/21/19 09:54:52 ** SubsystemInfo: name=SHADOW type=SHADOW(6) class=DAEMON(1)
02/21/19 09:54:52 ** Configuration: subsystem:SHADOW local:<NONE> class:DAEMON
02/21/19 09:54:52 ** $CondorVersion: 8.8.0 Feb 21 2019 $
02/21/19 09:54:52 ** $CondorPlatform: X86_64-DARWIN_18.2.0 $
02/21/19 09:54:52 ** PID = 25347
02/21/19 09:54:52 ** Log last touched 2/21 09:54:12
02/21/19 09:54:52 ******************************************************
$ cd /tmp
$ virtualenv --python=/usr/bin/python2.7 hp
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in hp/bin/python
Installing setuptools, pip, wheel...done.
$ source hp/bin/activate
(hp)$ pip install numpy
You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting numpy