Skip to content

Instantly share code, notes, and snippets.

View richardjgowers's full-sized avatar
🇪🇺
Back

Richard Gowers richardjgowers

🇪🇺
Back
View GitHub Profile
import numpy as np
def blocks_of(a, n, m):
"""Extract a view of (n, m) blocks along the diagonal.
Arguments:
a - starting array
n, m - size of each miniblock
Returns:
@richardjgowers
richardjgowers / read_xvg
Created April 28, 2015 10:00
Read xvg file
import numpy as np
import sys
def read_xvg(fname):
"""Read columns of data from file fname
Returns numpy array of data
"""
with open(fname, 'r') as f:
for i, line in enumerate(f):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richardjgowers
richardjgowers / PDB_multiple.ipynb
Created March 27, 2017 17:24
Multiply out a single PDB file using MDAnalysis (similar to editconf in Gromacs)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richardjgowers
richardjgowers / cellgrid.ipynb
Created May 29, 2018 22:59
Optimising cellgrids
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richardjgowers
richardjgowers / implicit_all.ipynb
Created October 12, 2018 14:30
For scipy issue 3168
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richardjgowers
richardjgowers / timing-2.ipynb
Created November 17, 2018 13:46
Timing distance searching in MDAnalysis and BioPython
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richardjgowers
richardjgowers / timing-2.ipynb
Created November 17, 2018 13:46
Timing distance searching in MDAnalysis and BioPython
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.