Skip to content

Instantly share code, notes, and snippets.

View blazetopher's full-sized avatar

Christopher Mueller blazetopher

View GitHub Profile
#!/usr/bin/env python
# https://gist.github.com/4438441
import os
from coverage_model import *
import numpy as np
import time
import objgraph
import gevent
@blazetopher
blazetopher / memory_trials.py
Last active December 17, 2015 08:08
Trying to track down the apparent memory leak in the coverage model
#!/usr/bin/env python
"""
@package
@file memory_trials.py
@author Christopher Mueller
@brief
"""
from coverage_model import *
# IPython log file
from ion.services.dm.utility.granule_utils import time_series_domain
from interface.services.dm.ipubsub_management_service import PubsubManagementServiceClient
from interface.services.dm.idataset_management_service import DatasetManagementServiceClient
from interface.services.dm.iingestion_management_service import IngestionManagementServiceClient
from interface.services.sa.idata_product_management_service import DataProductManagementServiceClient
from interface.services.dm.idata_retriever_service import DataRetrieverServiceClient
from ion.services.dm.inventory.dataset_management_service import DatasetManagementService
from ion.services.dm.utility.granule import RecordDictionaryTool
@blazetopher
blazetopher / 00_coi-services.py
Last active December 15, 2015 20:29
Read OOI Notebook Walkthrough.md below for instructions. NOTE: There are unresolved issues with gevent. Also, this has not been tested with any kind of service/deploy support in coi-services.
# Fix the ipython path
project_path = '/Users/cmueller/Development/OOI/Dev/code/coi-services'
virtualenv_path = '/Users/cmueller/Development/OOI/Dev/virtenvs/clean27'
import IPython
IPython.sys.path = ['',
'{0}/eggs/gevent-0.13.7-py2.7-macosx-10.6-intel.egg'.format(project_path),
'{0}/eggs/coverage-3.5.2-py2.7-macosx-10.6-intel.egg'.format(project_path),
'{0}'.format(project_path),
'{0}/eggs/objgraph-1.7.2-py2.7.egg'.format(project_path),
@blazetopher
blazetopher / git-wip
Created March 5, 2013 14:30
A git command for creating and popping a WIP (Work In Progress) commit. Install by placing somewhere on your PATH. Invoke with "git wip" or "git wip pop"
#!/bin/sh
DO_POP=False
if [ "$1" = "pop" ]; then
DO_POP=True
fi
LAST_NAME=$(git log -1 --pretty=%B 2> /dev/null | awk "{ print \$1 }")
if [ "$LAST_NAME" = "WIP" ]; then
if $DO_POP; then
@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
@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
#!/usr/bin/env python
"""
@package
@file data_proc_poc
@author Christopher Mueller
@brief
"""
# IPython log file
@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'
><> 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')