Skip to content

Instantly share code, notes, and snippets.

View blazetopher's full-sized avatar

Christopher Mueller blazetopher

View GitHub Profile
@blazetopher
blazetopher / gist:4226235
Created December 6, 2012 17:19
hdf leak output
(cm)DEV014MAC001{09:15}::~/Development/OOI/Dev/code/coverage-model (extends_cat_type %) cmueller: bin/python hdf_leak.py -v
Pid: 66614
h5py Version: 2.1.0
Starting Memory: 16.35546875 MB
Running variable length string datatype
......
Ending Memory: 27.59375 MB
Consumption: 11.23828125 MB
Starting Memory: 27.59375 MB
@blazetopher
blazetopher / perf_trials.py
Last active December 10, 2015 13:08
Performance Trials for Coverage Model
#!/usr/bin/env python
# https://gist.github.com/4438441
from coverage_model import *
import numpy as np
import time
import objgraph
import gevent
from clint.textui import progress
@blazetopher
blazetopher / objgraph_utils.py
Created January 7, 2013 18:58
Utilities for working with objgraph
#!/usr/bin/env python
"""
@package
@file objgraph_utils
@author Christopher Mueller
@brief
"""
@blazetopher
blazetopher / monitor_dict_to_csv.py
Last active December 10, 2015 22:29
Convert data output from process monitor webapp to csv
def monitor_dict_to_csv(data_dict, outfile):
import csv, os
if isinstance(data_dict, str) and os.path.exists(data_dict):
import json
data_dict = json.load(open(data_dict))
if os.path.exists(outfile):
os.remove(outfile)
with open(outfile, 'a') as f:
@blazetopher
blazetopher / hdf_leak.py
Last active December 11, 2015 02:38
Demonstrates memory leak when writing attributes using h5py & HDF
if __name__ == '__main__':
import time
import h5py
import os
rng = range(1000)
reps = range(3)
op = 'test.h5py'
if os.path.exists(op): os.remove(op)
><> from coverage_model import *
><> from coverage_model.recovery import CoverageDoctor
><> cov=SimplexCoverage.load('test_data/6eced7e8466f4d70a5d8febe0b9178f2')
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
/Users/cmueller/Development/OOI/Dev/code/coverage-model/extern/pyon/scripts/pycc.pyc in <module>()
----> 1 cov=SimplexCoverage.load('test_data/6eced7e8466f4d70a5d8febe0b9178f2')
@blazetopher
blazetopher / logging_latency.py
Created January 31, 2013 12:45
Demonstrates apparent latency with logging that is below the desired level
# Run from bin/pycc using the %run magic command
# %run logging_latency.py
if __name__ == '__main__':
import time
from ooi.logging import log
# Using the base logging.yml, no logging.local.yml
# So we're set to logging of INFO
print 'Check that we\'re at the expected logging level\n'
#!/usr/bin/env python
"""
@package
@file data_proc_poc
@author Christopher Mueller
@brief
"""
# IPython log file
@blazetopher
blazetopher / pfunc_validation.py
Last active December 13, 2015 19:38
psudo testing of ParameterFunctionValidator
#!/usr/bin/env python
from coverage_model import *
import networkx as nx
import numpy as np
import os
'''
from scratch import pfunc_validation as pfv
@blazetopher
blazetopher / repack_trial.py
Created February 27, 2013 17:46
tests async repack
#!/usr/bin/env python
import os
import shutil
import re
import time
import gevent
import h5py
import numpy as np
from coverage_model.utils import prod