Skip to content

Instantly share code, notes, and snippets.

View jpivarski's full-sized avatar

Jim Pivarski jpivarski

View GitHub Profile
@jpivarski
jpivarski / static-analysis.py
Last active November 15, 2023 21:37
Analysis of repos that use Numba
# see https://gist.github.com/jpivarski/001867b9da51a47b93913a0b9809db3a
import concurrent.futures
import time
import glob
import tarfile
import json
import ast
import re
import gzip
@jpivarski
jpivarski / static-analysis.py
Last active November 11, 2023 11:02
Static analysis of GitHub repos
# see https://gist.github.com/jpivarski/001867b9da51a47b93913a0b9809db3a
import concurrent.futures
import time
import glob
import tarfile
import json
import ast
import re
import gzip
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jpivarski
jpivarski / life-numba.py
Last active February 6, 2023 19:43
For https://youtu.be/lhqP50YVT-I (Game of Life in Python and Numba)
import time
import numpy as np
import numba as nb
# This could also be done without a class, using @nb.jit directly.
# It just seems natural to use a class. (That *might* slow it down a little; haven't tested it.)
spec = [
("width", nb.int32),
("height", nb.int32),

Uproot version 5.0.0

Uproot version 5 has a few major new features, one removal (uproot.lazy), and is based on Awkward Array version 2 instead of version 1.

uproot.lazy → uproot.dask

@kkothari2001 upgraded Uproot from Awkward version 1 to version 2, the major part of which was replacing uproot.lazy, which is based on Awkward 1's virtual and partitioned lazy arrays, with the new Dask collection, dask-awkward. The entry point for this function is uproot.dask.

@kkothari2001 also simplified Uproot's Pandas backend, which used to "explode" ragged arrays from ROOT into Pandas DataFrames with a non-trivial MultiIndex. Now, it takes advantage of awkward-pandas to put ragged (and more complex) Awkward Arrays directly into Pandas columns.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jpivarski
jpivarski / _Converting Argo data from NetCDF4 to Parquet.md
Created May 2, 2022 18:52
Converting Argo data from NetCDF4 to Parquet

First, I fetched all of the Argo data up through 2021 via ftp:

wget -r ftp://ftp.ifremer.fr/ifremer/argo

# wait a long time

tree ftp.ifremer.fr
└── ifremer
 └── argo