Skip to content

Instantly share code, notes, and snippets.

View kratsg's full-sized avatar

Giordon Stark kratsg

View GitHub Profile
import itkdb
class Client(itkdb.client.Client):
def __init__(self, *args, **kwargs):
self.project = kwargs.pop("project", "P")
self.institute = kwargs.pop("institute", "UCSC")
super().__init__(*args, **kwargs)
def get_component_type(self, code):
@kratsg
kratsg / README.md
Last active July 19, 2021 20:34
Aeneas Alignment

Aligning Text with Aeneas

I've installed aeneas and I want to split text. Here's what I did. Taking the raw transcript from my captioner, I convert to plain text (on Mac OSX using textutil):

textutil 2021-01-28\ Machine\ Learning.rtf -convert txt

This gives me 2021-01-28\ Machine\ Learning.txt which I then process with split.py above (requires nltk):

<!doctype html>
<html>
<head>
<style type="text/css">
div.row {
display: flex;
}
div.color {
color: #F00;
border: 1px solid;
@kratsg
kratsg / script.js
Last active January 22, 2021 17:35
// dimensions
var canvasWidth = 1200;
var canvasHeight = 800;
var margin = {
top: 50,
bottom: 50,
left: 200,
right: 50,
}
@kratsg
kratsg / ATLASSUSY_ReproducibleSummaryPlots.ipynb
Last active December 7, 2023 10:59
ATLAS SUSY Reproducible Summary Plots
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
$ docker run -it --rm -e LC_ALL=en_US.utf-8 -e LANG=en_US.utf-8 -v $PWD:/opt/app-root/src gitlab-registry.cern.ch/authoring/documentation/s2i-mkdocs-container bash -c '/opt/rh/rh-python36/root/bin/python3 -m pip install -r requirements.txt; /opt/rh/rh-python36/root/bin/mkdocs build --strict --site-dir site'
Defaulting to user installation because normal site-packages is not writeable
Collecting git+git://github.com/marcofavorito/mkdocs-bibtex.git@eaac92d5a5fd73b34d20565bfc6e75bbdabac87e (from -r requirements.txt (line 2))
Cloning git://github.com/marcofavorito/mkdocs-bibtex.git (to revision eaac92d5a5fd73b34d20565bfc6e75bbdabac87e) to /tmp/pip-req-build-crl98r91
Running command git clone -q git://github.com/marcofavorito/mkdocs-bibtex.git /tmp/pip-req-build-crl98r91
Requirement already satisfied (use --upgrade to upgrade): mkdocs-bibtex==0.2.4.dev47+geaac92d from git+git://github.com/marcofavorito/mkdocs-bibtex.git@eaac92d5a5fd73b34d20565bfc6e75bbdabac87e in ./.local/lib/python3.6/site-packages (from -r r
$ docker run -it --rm -e LC_ALL=en_US.utf-8 \
> -e LANG=en_US.utf-8 \
> -v $PWD:/opt/app-root/src \
> gitlab-registry.cern.ch/authoring/documentation/s2i-mkdocs-container \
> bash -c '/opt/rh/rh-python36/root/bin/python3 -m pip install -r requirements.txt; /opt/rh/rh-python36/root/bin/mkdocs build --strict --site-dir site'
Defaulting to user installation because normal site-packages is not writeable
Collecting git+git://github.com/marcofavorito/mkdocs-bibtex.git@eaac92d5a5fd73b34d20565bfc6e75bbdabac87e (from -r requirements.txt (line 2))
Cloning git://github.com/marcofavorito/mkdocs-bibtex.git (to revision eaac92d5a5fd73b34d20565bfc6e75bbdabac87e) to /tmp/pip-req-build-o_s3mogw
Running command git clone -q git://github.com/marcofavorito/mkdocs-bibtex.git /tmp/pip-req-build-o_s3mogw
Requirement already satisfied (use --upgrade to upgrade): mkdocs-bibtex==0.2.4.dev47+geaac92d from git+git://github.com/marcofavorito/mkdocs-bibtex.git@eaac92d5a5fd73b34d20565bfc6e75bbdabac87e in ./.local/lib/python3.6/site-pac
"""
Input for this made with:
$ ack "m_.*;" $(ack -l Algorithm.h xAODAnaHelpers/) | grep -v std::vector | grep -v AnaToolHandle | grep -v 'Tool\*' | grep -v nullptr | grep -v '\[' | grep -v '\->' | grep -v std::map | grep -v ANA_CHECK | grep -v '\* '
"""
input_data = """xAODAnaHelpers/ClusterHistsAlgo.h:14: std::string m_inContainerName = "";
xAODAnaHelpers/ClusterHistsAlgo.h:17: std::string m_detailStr = "";
xAODAnaHelpers/DebugTool.h:16: bool m_printStore = false;
xAODAnaHelpers/TauCalibrator.h:18: std::string m_inContainerName = "";
from time import sleep
import pyhf
from funcx.sdk.client import FuncXClient
pyhf_endpoint = 'a727e996-7836-4bec-9fa2-44ebf7ca5302'
fxc = FuncXClient()
fxc.max_requests = 200
import pyhf
pyhf.set_backend('pytorch', 'minuit')
nSig = 4.166929245
errSig = 4.166929245
nBkg = 0.11
errBkgUp = 0.20
errBkgDown = 0.11
model_json = {