Skip to content

Instantly share code, notes, and snippets.

View elena-pascal's full-sized avatar

Elena Pascal elena-pascal

View GitHub Profile
@Glench
Glench / python-async-callback.py
Last active August 2, 2021 10:34
An example of how to vary a parameter for an async callback function in python. Hint: don't use lambda functions in loops!
"""
We want to run a function asychronously and run a
callback function with multiple parameters when it
returns!
In this example, we are pretending we're analyzing
the names and ages of some people. We want to print
out:
jack 0
@ndevenish
ndevenish / refl_loader.py
Last active January 31, 2022 09:56
Loading DIALS reflection tables with only Numpy
"""
DIALS .refl file loader
This loads msgpack-type DIALS reflection files, without having DIALS or
cctbx in the python environment.
Note: All modern .refl files are at time of writing msgpack-based. Some
much older files might be in pickle format, which this doesn't read.
Usage: