Skip to content

Instantly share code, notes, and snippets.

View matthewfeickert's full-sized avatar

Matthew Feickert matthewfeickert

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@matthewfeickert
matthewfeickert / Dockerfile
Last active January 11, 2021 04:49
matplotlib cursive fonts Stack Overflow question
FROM ubuntu:20.04
RUN apt-get update -y && \
apt-get install -y \
fontconfig \
fonts-dejavu \
fonts-freefont-ttf \
python3 \
python3-dev \
python3-pip \
@matthewfeickert
matthewfeickert / Dockerfile
Last active January 8, 2021 23:37
matplotlib font question on Stack Overflow
FROM ubuntu:20.04
RUN apt-get update -y && \
apt-get install -y \
fontconfig \
fonts-dejavu \
fonts-freefont-ttf \
python3 \
python3-dev \
python3-pip \
@matthewfeickert
matthewfeickert / .gitignore
Last active December 22, 2020 06:59
Multi parameter example
.vscode/
@matthewfeickert
matthewfeickert / README.md
Last active December 11, 2020 04:40
Interacting with JSON in R for Lauren

Writing and Reading JSON with jsonlite

Using the jsonlite library in R you can read, write, and manipulate JSON data.

This Gist contains an example (write_json.R) of writing a list containing ecological "data types" and arrays of column data types to a JSON file using jsonlite::write_json.

That JSON file nicely serializes a mapping of the key values (e.g., "FSH", "IHI") — the ecological data types — to the associated data — the column data types.

To use this serialization (a data structure written to file) an example is given (read_json.R) in which it is read into a data frame using jsonlite::read_json.

@matthewfeickert
matthewfeickert / README.md
Last active November 23, 2020 22:27
Example GPU benchmarking script

Benchmarking of pyhf pseudoexperiments on CPU and GPU vs. ROOT

Setup

Install pyhf with the JAX backend in a virtual environment either locally from the Git repo

python -m pip install --editable .[jax]
@matthewfeickert
matthewfeickert / .gitignore
Last active October 29, 2020 23:44
hist, uproot4 issue
.ipynb_checkpoints/
@matthewfeickert
matthewfeickert / .gitignore
Last active October 29, 2020 04:49
Henry's hist demo
.ipynb_checkpoints/
@matthewfeickert
matthewfeickert / .gitignore
Last active August 21, 2020 08:04
Notes on choices of asymptotic test statistics in the LHC-era of likelihood-based analyses
.ipynb_checkpoints*
@matthewfeickert
matthewfeickert / README.md
Last active July 29, 2020 19:41
pip is going to break your pip freeze requirements.txt so hard in October

Example of --use-feature=2020-resolver breaking a pip freeze requirements.txt

Breaking Example

If the environment that is created from

$ python -m pip install -r requirements_original.txt