This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
@package | |
@file objgraph_utils | |
@author Christopher Mueller | |
@brief | |
""" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from coverage_model import * | |
import numpy as np | |
import time | |
import objgraph | |
import gevent | |
from clint.textui import progress | |
from guppy import hpy | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
><> from scratch.brick_helpers import * | |
bh=BrickHelp() | |
val_arr = np.arange(100).reshape(10,10) | |
#sl = (slice(2,7),slice(3,8)) | |
sl = (slice(1,None),slice(4,8)) | |
bh.put_values_to_bricks(sl, val_arr[sl]) | |
><> bh=BrickHelp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def benchmark_value_sets(num_params=10, num_insertions=100): | |
# Instantiate a ParameterDictionary | |
pdict = ParameterDictionary() | |
# Create a set of ParameterContext objects to define the parameters in the coverage, add each to the ParameterDictionary | |
t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.dtype('int64'))) | |
t_ctxt.axis = AxisTypeEnum.TIME | |
t_ctxt.uom = 'seconds since 01-01-1970' | |
pdict.add_context(t_ctxt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
><> from coverage_model.test.examples import * | |
><> cov=oneparamcov(False,False) | |
><> cov.insert_timesteps(100) | |
><> cov.num_timesteps | |
--> 110 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR: test_dm_end_2_end (ion.services.dm.test.test_dm_end_2_end.TestDMEnd2End) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/cmueller/Development/OOI/Dev/code/coi-services/ion/services/dm/test/test_dm_end_2_end.py", line 249, in test_dm_end_2_end | |
dataset_id = self.create_dataset() | |
File "/Users/cmueller/Development/OOI/Dev/code/coi-services/ion/services/dm/test/test_dm_end_2_end.py", line 167, in create_dataset | |
dataset_id = self.dataset_management.create_dataset('test_dataset', parameter_dict=pdict, spatial_domain=sdom, temporal_domain=tdom) | |
File "/Users/cmueller/Development/OOI/Dev/code/coi-services/interface/services/dm/idataset_management_service.py", line 267, in create_dataset | |
return self.request(IonObject('dataset_management_create_dataset_in', **{'name': name,'datastore_name': datastore_name,'view_name': view_name,'stream_id': stream_id,'parameter_dict': parameter_dict or None,'spatial_domain': spatial_domain or |