Skip to content

Instantly share code, notes, and snippets.

View matthewfeickert's full-sized avatar
💭
☕ + 💻

Matthew Feickert matthewfeickert

💭
☕ + 💻
View GitHub Profile
@matthewfeickert
matthewfeickert / README.md
Last active August 23, 2019 18:15
Small From Scratch Demo

Small From Scratch Demo

This is a very brief demo to show how one could go from an environment with just a Python 3 runtime to pyhf installed and being useful.

Installation

To take advantage of the great tools that uproot provides us let's install pyhf with the xmlio options

pip3 install pyhf[xmlio]
@matthewfeickert
matthewfeickert / Makefile
Last active September 22, 2019 21:17
Example of Gantt charts made with Mermaid JS
default: example
all: example key
example: example.mmd
docker run --rm -v "${PWD}":/home/node/data matthewfeickert/mermaid-cli -i example.mmd -o example.svg
docker run --rm -v "${PWD}":/home/node/data matthewfeickert/mermaid-cli -i example.mmd -o example.pdf
docker run --rm -v "${PWD}":/home/node/data matthewfeickert/mermaid-cli -i example.mmd -o example.png
key: gantt_key.mmd
@matthewfeickert
matthewfeickert / README.md
Last active October 1, 2019 01:13
Testing Python Docstrings with doctest and pydocstyle

Testing Python Docstrings with doctest and pydocstyle

Setup

Like any good project, we'll create a virtual environment for this example. You can use your virtual environment tool of choice, but I'm just going to show with Python's venv (and some help from venv-activate)

cd
mkdir venvs
cd venvs
@matthewfeickert
matthewfeickert / README.md
Last active October 7, 2019 02:34
MG5aMC_PythonMEs Minimal Working Example

MG5aMC_PythonMEs Minimal Working Example

Kyle notified people over email and Twitter that Valentin Hirschi had gotten MadGraph to export matrix element codes for Feynman diagrams into a form that can be used by differentiable machine learning libraries (e.g., TensorFlow and PyTorch). The project is called MG5aMC_PythonMEs. This is a short walkthrough of doing the simplest possible thing: just running the code that MG5aMC_PythonMEs generates. As I don't have much experience with MadGraph5_aMC@NLO and its installation and use instructions are quite bad I threw together a Docker image that at leasts somewhat works. This walkthrough will use that.

To be clear, this is never how you would actually do anything with a Docker image. This is just throwing things against the wall at the moment.

@matthewfeickert
matthewfeickert / Dockerfile
Last active October 17, 2019 21:12
A quickly thrown together Dockerfile to get Python 3.8 and Jupyter together
FROM python:3.8
MAINTAINER Matthew Feickert <matthewfeickert@users.noreply.github.com>
USER root
WORKDIR /root
SHELL [ "/bin/bash", "-c" ]
RUN apt-get -qq -y update && \
@matthewfeickert
matthewfeickert / hzz.txt
Created January 2, 2020 20:25
CMS Combine toy example
# derived from Table 4 (page 58) of http://arxiv.org/pdf/1312.5353v3
imax 3 number of bins
jmax 2 number of samples minus one
kmax * number of nuisance parameters
--------------------------------------------------------
bin bin4e bin2e2m bin4m
observation 4 13 8
--------------------------------------------------------
bin bin4e bin2e2m bin4m bin4e bin2e2m bin4m bin4e bin2e2m bin4m
@matthewfeickert
matthewfeickert / .gitignore
Last active April 15, 2020 04:46
Giordon CLs example
*.pdf
HistFactory/
validation.txt
.xml2json_output
roundtrip.json
@matthewfeickert
matthewfeickert / README.md
Last active May 17, 2020 05:45
Example for Anna

Example of Python classes and the use of self

Click this button to run an example in Binder:

Binder

As you can see from requirements.txt I've added some fun Python libraries, that are available in the Binder instance so you can use them in this sandbox environment.

@matthewfeickert
matthewfeickert / CMakeLists.txt
Last active July 1, 2020 06:12
Minimal failing exampe of CMake
cmake_minimum_required (VERSION 3.14 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14)
project(testing_frugal)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.8.0
@matthewfeickert
matthewfeickert / .gitignore
Last active July 10, 2020 08:43
xAH CMake FetchContent problem
*.asetup.save
build/
submitDir/