import makeunitdb from ocptype import ANNOTATION, UINT32 from params import Params from ramon import H5AnnotationFile, setField, getField, queryField, makeAnno, createSpecificSynapse from postmethods import putAnnotation, getAnnotation, getURL, postURL import kvengine_to_test import site_to_test #from ocpgraph import genGraphRAMON SITE_HOST = site_to_test.site p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['ANNO1'] p.channel_type = ANNOTATION p.datatype = UINT32 class Test_GraphGen: def setup_class(self): """Create the unittest database""" makeunitdb.createTestDB(p.token, channel_list=p.channels, public=True, readonly=0) cutout1 = "0/2,5/1,3/0,2" cutout2 = "0/1,3/4,6/2,5" cutout3 = "0/4,6/2,5/5,7" cutout4 = "0/6,8/5,9/2,4" syn_segments1 = [[7, 3], ] syn_segments2 = [[7, 4], ]
os.environ['DJANGO_SETTINGS_MODULE'] = 'OCP.settings' from ocptype import IMAGE, UINT8 from params import Params from jsonproj import createJson from postmethods import getURL, postURL, postNPZ, getNPZ import makeunitdb import site_to_test SITE_HOST = site_to_test.site p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['CHAN1', 'CHAN2'] p.channel_type = IMAGE p.datatype = UINT8 p.dataset = 'unittest_ds' class Test_Project_Json(): def setup_class(self): """Setup Parameters""" pass def teardown_class(self): """Teardown Parameters""" makeunitdb.deleteTestDB('unittest') makeunitdb.deleteTestDB('unittest2') def test_basic_json(self):
os.environ['DJANGO_SETTINGS_MODULE'] = 'OCP.settings' from ocptype import IMAGE, UINT8 from params import Params from jsonproj import createJson from postmethods import getURL, postURL, postNPZ, getNPZ import makeunitdb import site_to_test SITE_HOST = site_to_test.site p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['CHAN1', 'CHAN2'] p.channel_type = IMAGE p.datatype = UINT8 p.dataset = 'unittest_ds' class Test_Project_Json(): def setup_class(self): """Setup Parameters""" pass def teardown_class(self): """Teardown Parameters""" #makeunitdb.deleteTestDB('unittest') #makeunitdb.deleteTestDB('unittest2') # calling a different fucntion for project list as django1.9 introduced new weirdness makeunitdb.deleteTestDBList(['unittest','unittest2'])
import blosc import time sys.path += [os.path.abspath('../django/')] import OCP.settings os.environ['DJANGO_SETTINGS_MODULE'] = 'ocpblaze.settings' from ocplib import MortonXYZ from params import Params p = Params() p.token = "blaze" p.resolution = 0 p.channels = ['image'] p.window = [0,0] p.channel_type = "image" p.datatype = "uint32" SIZE = 1024 ZSIZE = 16 def generateURL(zidx): """Run the Benchmark.""" i = zidx [x,y,z] = MortonXYZ(i) p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE) image_data = np.ones([1,ZSIZE,SIZE,SIZE], dtype=np.uint32) * random.randint(0,255) return postBlosc(p, image_data) def generateURL2(zidx): [x,y,z] = MortonXYZ(zidx)
from params import Params import kvengine_to_test import site_to_test import makeunitdb SITE_HOST = site_to_test.site # Test_Propagate # # 1 - test_update_propagate - Test the propagate service set values p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['chan1'] p.channel_type = "image" p.datatype = "uint8" class Test_Image_Zslice_Propagate: """Test image propagation""" def setup_class(self): """Create the unittest database""" makeunitdb.createTestDB(p.token, public=True, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype, ximagesize=1000, yimagesize=1000, zimagesize=10)
import numpy as np import pytest from contextlib import closing import networkx as nx import makeunitdb from ndlib.ndtype import ANNOTATION, UINT32 from params import Params from ramonmethods import H5AnnotationFile, setField, getField, queryField, makeAnno, createSpecificSynapse from postmethods import putAnnotation, getAnnotation, getURL, postURL from test_settings import * p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['ANNO1'] p.channel_type = ANNOTATION p.datatype = UINT32 @pytest.mark.skipif(True, reason='Test not necessary for dev mode') class Test_GraphGen: def setup_class(self): """Create the unittest database""" makeunitdb.createTestDB(p.token, channel_list=p.channels, public=True, readonly=0, ximagesize=100, yimagesize=100, zimagesize=100)
# Test_Image_Post # 1 - test_npz # 2 - test_npz_incorrect_region # 3 - test_npz_incorrect_datatype # 4 - test_hdf5 # 5 - test_hdf5_incorrect_region # 6 - test_hdf5_incorrect_datatype # 7 - test_npz_incorrect_channel # 8 - test_hdf5_incorrect_channel p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['IMAGE1', 'IMAGE2'] p.window = [0, 500] p.channel_type = TIMESERIES p.datatype = UINT8 p.voxel = [4.0, 4.0, 3.0] #p.args = (3000,3100,4000,4100,500,510) class Test_Image_Slice: def setup_class(self): """Setup class parameters""" makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype) def teardown_class(self): """Cleanup class parameters"""
import makeunitdb from ndlib.ndtype import * from params import Params from postmethods import * from test_settings import * # Test_Blosc # 1 - test_get_blosc # 2 - test_post_blosc p = Params() p.token = 'unittest' p.resolution = 0 p.channels = ['IMAGE1', 'IMAGE2'] p.window = [0,500] p.channel_type = TIMESERIES p.datatype = UINT8 p.voxel = [4.0,4.0,3.0] class Test_Blosc: def setup_class(self): makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype) def teardown_class(self): makeunitdb.deleteTestDB(p.token) def test_get_blosc (self): """Test the xy slice cutout"""