Skip to content

Instantly share code, notes, and snippets.

View nickvandewiele's full-sized avatar

NICK VANDEWIELE nickvandewiele

View GitHub Profile
@nickvandewiele
nickvandewiele / driver.py
Last active January 31, 2023 19:14
PyQT, pyqtgraph, and Cython
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg
## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
import sys
from window import CustomWindow
@nickvandewiele
nickvandewiele / profiling.py
Created June 15, 2016 14:34
A standalone script to convert a cProfile CPU-profiling *.prof file into a graph.
import sys
import subprocess
import logging
import pstats
try:
from gprof2dot import PstatsParser, DotWriter, SAMPLES, themes
except ImportError:
logging.warning(
@nickvandewiele
nickvandewiele / easy_build_goolf-1.4.10-no-OFED.eb.error
Created December 21, 2015 03:27
easy_build goolf-1.4.10-no-OFED.eb error
This file has been truncated, but you can view the full file.
== 2015-12-21 02:17:12,683 runpy.EB_GCC INFO This is EasyBuild 2.5.0 (framework: 2.5.0, easyblocks: 2.5.0) on host precise32.
== 2015-12-21 02:17:12,684 runpy.EB_GCC INFO This is easyblock EB_GCC from module easybuild.easyblocks.gcc (/home/vagrant/.local/easybuild/software/EasyBuild/2.5.0/lib/python2.7/site-packages/easybuild_easyblocks-2.5.0-py2.7.egg/easybuild/easyblocks/g/gcc.pyc)
== 2015-12-21 02:17:12,684 runpy.EB_GCC INFO Build dir set to /home/vagrant/.local/easybuild/build/GCC/4.7.2/dummy-dummy
== 2015-12-21 02:17:12,685 runpy.EB_GCC INFO Software install dir set to /home/vagrant/.local/easybuild/software/GCC/4.7.2
== 2015-12-21 02:17:12,686 runpy.EB_GCC INFO Module install dir set to /home/vagrant/.local/easybuild/modules/all
== 2015-12-21 02:17:12,686 runpy.EB_GCC INFO Init completed for application name GCC version 4.7.2
== 2015-12-21 02:17:12,687 runpy.easyblock INFO Obtained application instance of for GCC (easyblock: None)
== 2015-12-21 02:17:12,688 runpy.EB_GCC INFO building and installing GCC/
@nickvandewiele
nickvandewiele / Volunteer
Created June 18, 2015 13:19
A user (with e-mail) fills in its preferences to volunteer on one/more committees and submits the form. The event triggers userSubmitsForm which puts the user's e-mail in the appropriate column with all the other volunteers for that committee.
var sheet = SpreadsheetApp.getActive().getSheetByName('Overview');
function userSubmitsForm(e) {
var user = {name: e.namedValues['Full Name'][0], email: e.namedValues['E-mail'][0],
committees : e.namedValues['Which PDA Committee are you interested in to volunteer?'][0]
};
var committees = user.committees.split(', ');//space is important!
@nickvandewiele
nickvandewiele / reactants_sort.py
Last active August 29, 2015 14:21
Testing the random way of sorting reactants of reaction when calling Reaction.reactants.sort()
import cPickle
from rmgpy.species import Species
from rmgpy.reaction import Reaction
a = Species(...)
b = Species(...)
r = Reaction()
r.reactants = [a,b]
@nickvandewiele
nickvandewiele / gist:704f278ca3be4b58b7b7
Last active August 29, 2015 14:20
Chemoinformatics: A way to reconstruct an RMG mol from an obmol.
#!/usr/bin/python
import openbabel as ob
"""
This gist shows how to create a molecule from an OB mol.
OpenBabel does not have the obmol.GetAtomByIdx(int) method.
"""
@nickvandewiele
nickvandewiele / ob_test.py
Created April 29, 2015 14:34
Chemoinformatics: Differences between OB and RDKit IDx
import openbabel as ob
from rdkit import Chem
"""
This snippet shows that the IDx getter of OpenBabel and RDKit differ in implementation.
Openbabel IDx: starts at 1
RDKit IDx: starts at 0
from functools import wraps
#From High Performance Python
def timefn(fn):
@wraps(fn)
def measure_time(*args, **kwargs):
t1 = time.time()
result = fn(*args, **kwargs)
t2 = time.time()
print ("@timefn:" + fn.func_name + " took " + str(t2 - t1) + " seconds")
return result
@nickvandewiele
nickvandewiele / Parse Goldsmith Data
Last active August 29, 2015 14:05
parsing Goldsmith uncertainty data to DFT_QCI_thermo library
This gist parses the tab separated text file 'goldsmith_table3.tsv', adds the uncertainty data to the RMG thermo library 'DFT_QC_thermo.py' and saves it to a new library 'DFT_QC_thermo_new.py'