Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jdev #284

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open

Jdev #284

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
63e500a
first week
Feb 23, 2017
63671dd
without indent
Feb 23, 2017
c63ecae
white space change
Feb 24, 2017
baae77a
indent
Feb 24, 2017
7137a2a
indent
Feb 24, 2017
1e9c97f
change
Feb 24, 2017
dc8b72b
change
Feb 24, 2017
e492739
change
Feb 24, 2017
5028121
change
Feb 24, 2017
5e78c5c
change
Feb 24, 2017
1beb70d
change
Feb 24, 2017
d285aa3
change
Feb 24, 2017
3ad3545
Merge branch 'jdev' of http://github.com/neurodata/ndio into jdev
Feb 25, 2017
67edc3a
add getURL
Feb 28, 2017
68b9a30
test update
Mar 1, 2017
30fa3fa
test
Mar 1, 2017
e9333ac
test
Mar 3, 2017
720f35e
Merge branch 'master' of https://github.com/neurodata/ndio into jdev
Mar 3, 2017
adfde46
changes
Mar 3, 2017
3ea3282
neurodata.py getURL update
Mar 3, 2017
e686391
Merge branch 'master' of http://github.com/neurodata/ndio into jdev
Mar 3, 2017
a003a96
update getURL
Mar 3, 2017
513e3b6
Merge remote-tracking branch 'origin/jdev' into jdev
Mar 3, 2017
c422186
Merge branch 'jdev' of http://github.com/neurodata/ndio into jdev
jyshin93 Mar 6, 2017
e7e18ef
add test_getURL.py
jyshin93 Mar 6, 2017
3721154
update test_getURL.py
jyshin93 Mar 6, 2017
8ea52c7
Forcing use of hostname from settings
Mar 6, 2017
f2234f1
Merge branch 'master' into jdev
Aeusman Mar 11, 2017
f54b6cb
update from the review on test_getURL.py and neurodata.py getURL func…
jyshin93 Mar 16, 2017
9cd6ff2
updated test_getURL.py
jyshin93 Mar 17, 2017
dbb1a5d
changed token textfile name
jyshin93 Mar 17, 2017
a19837f
resources api implemented in neurodata.py and test 4 methods
jyshin93 Mar 27, 2017
157fd70
Merge branch 'master' into jdev
Aeusman Apr 3, 2017
7da3ee4
Added the set up for the dataset/project/token so we can test. One fa…
Aeusman Apr 3, 2017
b9328f2
Corrections to resources test
Aeusman Apr 3, 2017
1364718
Fixing checkstyle issues
Aeusman Apr 3, 2017
ce5d589
Correcting pep8 in convert
Aeusman Apr 3, 2017
c96d228
pull
jyshin93 Apr 3, 2017
bf25525
pull req
jyshin93 Apr 3, 2017
52c8bab
test_propagate old -> test_propagate
jyshin93 Apr 7, 2017
e5f9048
Merge branch 'master' into jdev
Aeusman Apr 7, 2017
fb878a3
test_convert.old --> test_conver.py update
jyshin93 Apr 8, 2017
4ded9a8
u
jyshin93 Apr 13, 2017
b001d9f
update conver_image_export_import
jyshin93 Apr 13, 2017
f0de531
Merge branch 'master' into jdev
Aeusman Apr 17, 2017
f1166fc
commit before pull
jyshin93 Apr 19, 2017
af0151a
Merge branch 'master' of http://github.com/neurodata/ndio
jyshin93 Apr 19, 2017
a7480be
Merge branch 'master' into jdev
jyshin93 Apr 19, 2017
1556aaa
pudate post cutout to upload 4D but no time series yet
jyshin93 Apr 19, 2017
57cba68
changes on data api
jyshin93 Apr 19, 2017
1575818
Merge branch 'master' into jdev
Aeusman May 3, 2017
0c93012
middle of data
jyshin93 May 12, 2017
dd73414
middle
jyshin93 May 12, 2017
35c34d9
data
jyshin93 May 12, 2017
31acd93
Rebase abort and recommit
jyshin93 May 12, 2017
988696c
rebase master neurodata
jyshin93 May 12, 2017
de4c375
Update test_ramon_import_export.py
Aeusman May 23, 2017
b46e583
Merge branch 'master' into jdev
Aeusman May 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
209 changes: 0 additions & 209 deletions tests/data/test.graphml

This file was deleted.

52 changes: 52 additions & 0 deletions tests/test_convert_image_export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import unittest
import test_settings
import ndio.remote.neurodata as neurodata
import ndio.ramon
import ndio.convert.png as ndpng
import ndio.convert.tiff as ndtiff
import numpy as np
import os


class TestDownload(unittest.TestCase):

def setUp(self):
self.hostname = test_settings.HOSTNAME
self.token_user = test_settings.NEURODATA
self.nd = neurodata(user_token=self.token_user, hostname=self.hostname)
self.image_data = np.zeros((512,512), dtype=np.uint8)

# self.image_data = (255.0 / data.max() * (data - data.min())).astype(np.uint8)

def test_export_load_png(self):

# if returns string, successful export
self.assertEqual(
ndpng.save("download.png", self.image_data),
"download.png")

# now confirm import works too
self.assertEqual(ndpng.load("download.png")[0][0],
self.image_data[0][0])
self.assertEqual(ndpng.load("download.png")[10][10],
self.image_data[10][10])
os.system("rm ./download.png")

def test_export_load_tiff(self):
# if returns string, successful export
self.assertEqual(
ndtiff.save("download-1.tiff",
self.image_data),
"download-1.tiff")

# now confirm import works too
self.assertEqual(
ndtiff.load("download-1.tiff")[0][0],
self.image_data[0][0])
self.assertEqual(
ndtiff.load("download-1.tiff")[10][10],
self.image_data[10][10])
os.system("rm ./download-1.tiff")

if __name__ == '__main__':
unittest.main()
56 changes: 0 additions & 56 deletions tests/test_convert_image_export.py.old

This file was deleted.

50 changes: 50 additions & 0 deletions tests/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import unittest
import ndio.remote.neurodata as neurodata
import ndio.remote.errors
import numpy
import h5py
import os
import test_settings

HOSTNAME = test_settings.HOSTNAME
NEURODATA = test_settings.NEURODATA
TEST = test_settings.TEST

class TestData(unittest.TestCase):

def setUp(self):
self.token_user = NEURODATA
hostname = HOSTNAME
self.nd = neurodata(self.token_user,
hostname=hostname,
check_tokens=True)
self.ramon_id = 1
dataset_name = 'demo1'
project_name = 'ndio_demos'
self.t = 'test_token'
self.c = 'test_channel'
self.nd.create_dataset(dataset_name, 100, 100, 100, 1.0,
1.0,
1.0)
self.nd.create_project(project_name, dataset_name,
'localhost',
1, 1, 'localhost', 'Redis')
self.nd.create_token(self.t, project_name, dataset_name, 1)
try:
self.nd.create_channel(self.c, project_name,
dataset_name, 'timeseries',
'uint8', 0, 500, propagate=1)
except:
pass

#random 3-d array
self.data = numpy.arange(30).reshape(2,3,5)

def test_post_cutout(self):
self.nd.post_cutout(self.t, self.c, 0, 0, 0, 0, self.data)




if __name__ == '__main__':
unittest.main()
Loading