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 March 22, 2021 16:10
Bug report for Python 2 vs. Python 3 inconsistency

I'm seeing a bug between pyAMI v5.1.2 on CVMFS with inconsistent return structure for the provenance node dicts. The docs mention that for the pyAMI.atlas.api.get_dataset_prov API the return should be

a map of python dictionnaries. The key "node" gives a list of dataset with the distance to the given dataset and the key "edge" gives the list of successive pairs of input an output datasets.

This is true for Python 2.7, but for Python 3 the return structure is inconsistent with some datasets in the provenance node list having a return of

@matthewfeickert
matthewfeickert / README.md
Last active January 13, 2021 00:24
reproducible issue with jaxlib v0.1.58

Regression in jaxlib v0.1.58 for jax.scipy.special.gammaln for CPU

In pyhf we've noticed one of our unit tests that was passing for jax v0.2.7 and jaxlib v0.1.57, however, with the release of jaxlib v0.1.58 it has started failing. We've narrowed it down to being for jaxlib v0.1.58 with jax_enable_x64=True in CPU mode (aka, where our unit test run).

Minimal Reproducible Example

In a fresh Python 3.8 virtual environment

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/