sip-aau / magni Goto Github PK
View Code? Open in Web Editor NEWA package for AFM image reconstruction and compressed sensing in general
Home Page: http://magni.readthedocs.io
License: Other
A package for AFM image reconstruction and compressed sensing in general
Home Page: http://magni.readthedocs.io
License: Other
This bug is not caused by magni
but rather numpy
(or multiprocessing
). It is present on Mac OS X for versions of Python and numpy
that have not been compiled against MKL. The following piece of code illustrates the problem:
import multiprocessing as mp
import numpy as np
def compute(n):
print('Enter')
np.dot(np.eye(n), np.eye(n))
print('Exit')
print('\nWithout multiprocessing:')
compute(1000)
print('\nWith multiprocessing:')
workers = mp.Pool(1)
results = workers.map(compute, (1000, 1000))
The above code hangs in the workers.map
call when executing np.dot(np.eye(n), np.eye(n))
. Strangely, there is no problem if the non-multiprocessing call to compute
is ommitted, or the value of n
is reduced sufficiently.
I'm seeing a number of “not defined” errors in the doctests, in both Python 3.3 and 2.7, when run with nosetests:
$ nosetests --with-doctest --doctest-tests magni
FFFFF..FFF....F...........F...FFF..FF...F..
======================================================================
FAIL: Doctest: magni.afm.io.read_mi_file
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.afm.io.read_mi_file
File "/.../magni/afm/io.py", line 46, in read_mi_file
----------------------------------------------------------------------
File "/.../magni/afm/io.py", line 73, in magni.afm.io.read_mi_file
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.io.read_mi_file[1]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/io.py", line 74, in magni.afm.io.read_mi_file
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.io.read_mi_file[2]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/io.py", line 75, in magni.afm.io.read_mi_file
Failed example:
mi_file = read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.io.read_mi_file[3]>", line 1, in <module>
mi_file = read_mi_file(path)
NameError: name 'path' is not defined
======================================================================
FAIL: Doctest: magni.afm.reconstruction.analyse
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.afm.reconstruction.analyse
File "/.../magni/afm/reconstruction.py", line 63, in analyse
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 93, in magni.afm.reconstruction.analyse
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[1]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 94, in magni.afm.reconstruction.analyse
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[2]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 95, in magni.afm.reconstruction.analyse
Failed example:
mi_file = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[3]>", line 1, in <module>
mi_file = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 96, in magni.afm.reconstruction.analyse
Failed example:
mi_buffer = mi_file.get_buffer('Topography')[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[4]>", line 1, in <module>
mi_buffer = mi_file.get_buffer('Topography')[0]
NameError: name 'mi_file' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 97, in magni.afm.reconstruction.analyse
Failed example:
mi_data = mi_buffer.get_data()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[5]>", line 1, in <module>
mi_data = mi_buffer.get_data()
NameError: name 'mi_buffer' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 98, in magni.afm.reconstruction.analyse
Failed example:
x = magni.imaging.mat2vec(mi_data)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[6]>", line 1, in <module>
x = magni.imaging.mat2vec(mi_data)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 111, in magni.afm.reconstruction.analyse
Failed example:
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
(int(len(x) / 2), len(x)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[9]>", line 1, in <module>
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 117, in magni.afm.reconstruction.analyse
Failed example:
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[10]>", line 1, in <module>
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 121, in magni.afm.reconstruction.analyse
Failed example:
print('MSE: {:.2f}, PSNR: {:.2f}'.format(*analyse(x, Phi, Psi)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.analyse[11]>", line 1, in <module>
print('MSE: {:.2f}, PSNR: {:.2f}'.format(*analyse(x, Phi, Psi)))
NameError: name 'x' is not defined
======================================================================
FAIL: Doctest: magni.afm.reconstruction.reconstruct
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.afm.reconstruction.reconstruct
File "/.../magni/afm/reconstruction.py", line 168, in reconstruct
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 198, in magni.afm.reconstruction.reconstruct
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[1]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 199, in magni.afm.reconstruction.reconstruct
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[2]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 200, in magni.afm.reconstruction.reconstruct
Failed example:
mi_file = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[3]>", line 1, in <module>
mi_file = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 201, in magni.afm.reconstruction.reconstruct
Failed example:
mi_buffer = mi_file.get_buffer('Topography')[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[4]>", line 1, in <module>
mi_buffer = mi_file.get_buffer('Topography')[0]
NameError: name 'mi_file' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 202, in magni.afm.reconstruction.reconstruct
Failed example:
mi_data = mi_buffer.get_data()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[5]>", line 1, in <module>
mi_data = mi_buffer.get_data()
NameError: name 'mi_buffer' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 203, in magni.afm.reconstruction.reconstruct
Failed example:
x = magni.imaging.mat2vec(mi_data)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[6]>", line 1, in <module>
x = magni.imaging.mat2vec(mi_data)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 216, in magni.afm.reconstruction.reconstruct
Failed example:
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
(int(len(x) / 2), len(x)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[9]>", line 1, in <module>
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 222, in magni.afm.reconstruction.reconstruct
Failed example:
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[10]>", line 1, in <module>
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 226, in magni.afm.reconstruction.reconstruct
Failed example:
y = Phi.dot(x)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[11]>", line 1, in <module>
y = Phi.dot(x)
NameError: name 'Phi' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/reconstruction.py", line 227, in magni.afm.reconstruction.reconstruct
Failed example:
print('Maximum absolute pixel error: {:.3f}'
.format(np.abs(reconstruct(y, Phi, Psi) - x).max()))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.reconstruction.reconstruct[12]>", line 2, in <module>
.format(np.abs(reconstruct(y, Phi, Psi) - x).max()))
NameError: name 'y' is not defined
======================================================================
FAIL: Doctest: magni.afm.types.Buffer
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.afm.types.Buffer
File "/.../magni/afm/types.py", line 35, in Buffer
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 62, in magni.afm.types.Buffer
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[0]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 63, in magni.afm.types.Buffer
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[1]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 64, in magni.afm.types.Buffer
Failed example:
mi_file = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[2]>", line 1, in <module>
mi_file = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 65, in magni.afm.types.Buffer
Failed example:
mi_buffer = mi_file.get_buffer()[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[3]>", line 1, in <module>
mi_buffer = mi_file.get_buffer()[0]
NameError: name 'mi_file' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 70, in magni.afm.types.Buffer
Failed example:
print(mi_buffer.get_attr('bufferLabel'))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[4]>", line 1, in <module>
print(mi_buffer.get_attr('bufferLabel'))
NameError: name 'mi_buffer' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 76, in magni.afm.types.Buffer
Failed example:
data = mi_buffer.get_data()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[5]>", line 1, in <module>
data = mi_buffer.get_data()
NameError: name 'mi_buffer' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 77, in magni.afm.types.Buffer
Failed example:
print('Buffer, Type: {}, Shape: {}'.format(str(type(data))[-15:-2],
data.shape))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Buffer[6]>", line 1, in <module>
print('Buffer, Type: {}, Shape: {}'.format(str(type(data))[-15:-2],
NameError: name 'data' is not defined
======================================================================
FAIL: Doctest: magni.afm.types.Image
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.afm.types.Image
File "/.../magni/afm/types.py", line 199, in Image
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 222, in magni.afm.types.Image
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[0]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 223, in magni.afm.types.Image
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[1]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 224, in magni.afm.types.Image
Failed example:
image = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[2]>", line 1, in <module>
image = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 229, in magni.afm.types.Image
Failed example:
print('{:5.2f}'.format(image.get_attr('scanSpeed')))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[3]>", line 1, in <module>
print('{:5.2f}'.format(image.get_attr('scanSpeed')))
NameError: name 'image' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 235, in magni.afm.types.Image
Failed example:
buffers = image.get_buffer()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[4]>", line 1, in <module>
buffers = image.get_buffer()
NameError: name 'image' is not defined
----------------------------------------------------------------------
File "/.../magni/afm/types.py", line 236, in magni.afm.types.Image
Failed example:
for b in buffers[0:5:2]:
print('Buffer: {}'.format(b.get_attr('bufferLabel')))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.afm.types.Image[5]>", line 1, in <module>
for b in buffers[0:5:2]:
NameError: name 'buffers' is not defined
======================================================================
FAIL: Doctest: magni.imaging.dictionaries.get_DCT
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.imaging.dictionaries.get_DCT
File "/.../magni/imaging/dictionaries.py", line 47, in get_DCT
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 69, in magni.imaging.dictionaries.get_DCT
Failed example:
img = np.random.randn(64, 64)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[0]>", line 1, in <module>
img = np.random.randn(64, 64)
NameError: name 'np' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 70, in magni.imaging.dictionaries.get_DCT
Failed example:
vec = magni.imaging.mat2vec(img)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[1]>", line 1, in <module>
vec = magni.imaging.mat2vec(img)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 74, in magni.imaging.dictionaries.get_DCT
Failed example:
dct_normal = magni.imaging._fastops.dct2(vec, *img.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[2]>", line 1, in <module>
dct_normal = magni.imaging._fastops.dct2(vec, *img.shape)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 79, in magni.imaging.dictionaries.get_DCT
Failed example:
matrix = get_DCT(img.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[4]>", line 1, in <module>
matrix = get_DCT(img.shape)
NameError: name 'img' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 80, in magni.imaging.dictionaries.get_DCT
Failed example:
dct_matrix = matrix.T.dot(vec)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[5]>", line 1, in <module>
dct_matrix = matrix.T.dot(vec)
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 84, in magni.imaging.dictionaries.get_DCT
Failed example:
np.allclose(dct_matrix, dct_normal)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DCT[6]>", line 1, in <module>
np.allclose(dct_matrix, dct_normal)
NameError: name 'np' is not defined
======================================================================
FAIL: Doctest: magni.imaging.dictionaries.get_DFT
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.imaging.dictionaries.get_DFT
File "/.../magni/imaging/dictionaries.py", line 111, in get_DFT
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 133, in magni.imaging.dictionaries.get_DFT
Failed example:
img = np.random.randn(64, 64)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[0]>", line 1, in <module>
img = np.random.randn(64, 64)
NameError: name 'np' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 134, in magni.imaging.dictionaries.get_DFT
Failed example:
vec = magni.imaging.mat2vec(img)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[1]>", line 1, in <module>
vec = magni.imaging.mat2vec(img)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 138, in magni.imaging.dictionaries.get_DFT
Failed example:
dft_normal = magni.imaging._fastops.dft2(vec, *img.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[2]>", line 1, in <module>
dft_normal = magni.imaging._fastops.dft2(vec, *img.shape)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 143, in magni.imaging.dictionaries.get_DFT
Failed example:
matrix = get_DFT(img.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[4]>", line 1, in <module>
matrix = get_DFT(img.shape)
NameError: name 'img' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 144, in magni.imaging.dictionaries.get_DFT
Failed example:
dft_matrix = matrix.T.dot(vec)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[5]>", line 1, in <module>
dft_matrix = matrix.T.dot(vec)
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/dictionaries.py", line 148, in magni.imaging.dictionaries.get_DFT
Failed example:
np.allclose(dft_matrix, dft_normal)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.dictionaries.get_DFT[6]>", line 1, in <module>
np.allclose(dft_matrix, dft_normal)
NameError: name 'np' is not defined
======================================================================
FAIL: Doctest: magni.imaging.domains.MultiDomainImage
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.imaging.domains.MultiDomainImage
File "/.../magni/imaging/domains.py", line 24, in MultiDomainImage
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 54, in magni.imaging.domains.MultiDomainImage
Failed example:
Phi = magni.utils.matrices.Matrix(func, func_T, (), (2, 3))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[2]>", line 1, in <module>
Phi = magni.utils.matrices.Matrix(func, func_T, (), (2, 3))
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 58, in magni.imaging.domains.MultiDomainImage
Failed example:
v = np.sqrt(0.5)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[3]>", line 1, in <module>
v = np.sqrt(0.5)
NameError: name 'np' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 59, in magni.imaging.domains.MultiDomainImage
Failed example:
Psi = np.float64([[ v, -v, 0],
[ v, v, 0],
[ 0, 0, 1]])
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[4]>", line 1, in <module>
Psi = np.float64([[ v, -v, 0],
NameError: name 'np' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 66, in magni.imaging.domains.MultiDomainImage
Failed example:
domains = MultiDomainImage(Phi, Psi)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[6]>", line 1, in <module>
domains = MultiDomainImage(Phi, Psi)
NameError: name 'Phi' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 71, in magni.imaging.domains.MultiDomainImage
Failed example:
domains.image = np.ones(3).reshape(3, 1)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[7]>", line 1, in <module>
domains.image = np.ones(3).reshape(3, 1)
NameError: name 'np' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 75, in magni.imaging.domains.MultiDomainImage
Failed example:
domains.measurements
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[8]>", line 1, in <module>
domains.measurements
NameError: name 'domains' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/domains.py", line 81, in magni.imaging.domains.MultiDomainImage
Failed example:
domains.coefficients
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.domains.MultiDomainImage[9]>", line 1, in <module>
domains.coefficients
NameError: name 'domains' is not defined
======================================================================
FAIL: Doctest: magni.imaging.measurements.construct_measurement_matrix
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.imaging.measurements.construct_measurement_matrix
File "/.../magni/imaging/measurements.py", line 130, in construct_measurement_matrix
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 160, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
vec = magni.imaging.mat2vec(img)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[1]>", line 1, in <module>
vec = magni.imaging.mat2vec(img)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 161, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
coords = magni.imaging.measurements.uniform_line_sample_image(
5, 5, 16., 17)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[2]>", line 1, in <module>
coords = magni.imaging.measurements.uniform_line_sample_image(
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 166, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
unique = magni.imaging.measurements.unique_pixels(coords)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[3]>", line 1, in <module>
unique = magni.imaging.measurements.unique_pixels(coords)
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 167, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
samples_normal = img[unique[:, 1], unique[:, 0]]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[4]>", line 1, in <module>
samples_normal = img[unique[:, 1], unique[:, 0]]
NameError: name 'unique' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 168, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
samples_normal = samples_normal.reshape((len(unique), 1))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[5]>", line 1, in <module>
samples_normal = samples_normal.reshape((len(unique), 1))
NameError: name 'samples_normal' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 173, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
matrix = construct_measurement_matrix(coords, *img.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[7]>", line 1, in <module>
matrix = construct_measurement_matrix(coords, *img.shape)
NameError: name 'coords' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 174, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
samples_matrix = matrix.dot(vec)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[8]>", line 1, in <module>
samples_matrix = matrix.dot(vec)
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/imaging/measurements.py", line 178, in magni.imaging.measurements.construct_measurement_matrix
Failed example:
np.allclose(samples_matrix, samples_normal)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.imaging.measurements.construct_measurement_matrix[9]>", line 1, in <module>
np.allclose(samples_matrix, samples_normal)
NameError: name 'samples_matrix' is not defined
======================================================================
FAIL: Doctest: magni.imaging.preprocessing.detilt
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.imaging.preprocessing.detilt
File "/.../magni/imaging/preprocessing.py", line 46, in detilt
----------------------------------------------------------------------
File "/.../magni/imaging/preprocessing.py", line 99, in magni.imaging.preprocessing.detilt
Failed example:
im
Expected:
array([[ 3.33333333e-01, -3.33333333e-01, -2.00000000e+00],
[ -3.33333333e-01, 1.00000000e+00, 3.33333333e-01],
[ -2.66453526e-15, 3.33333333e-01, -3.33333333e-01]])
Got:
array([[ 3.33333333e-01, -3.33333333e-01, -2.00000000e+00],
[ -3.33333333e-01, 1.00000000e+00, 3.33333333e-01],
[ 1.77635684e-15, 3.33333333e-01, -3.33333333e-01]])
======================================================================
FAIL: Doctest: magni.reproducibility.io.annotate_database
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.reproducibility.io.annotate_database
File "/.../magni/reproducibility/io.py", line 55, in annotate_database
----------------------------------------------------------------------
File "/.../magni/reproducibility/io.py", line 94, in magni.reproducibility.io.annotate_database
Failed example:
with magni.utils.multiprocessing.File('db.hdf5', mode='a') as h5file:
annotate_database(h5file)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.reproducibility.io.annotate_database[1]>", line 1, in <module>
with magni.utils.multiprocessing.File('db.hdf5', mode='a') as h5file:
NameError: name 'magni' is not defined
======================================================================
FAIL: Doctest: magni.reproducibility.io.read_annotations
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.reproducibility.io.read_annotations
File "/.../magni/reproducibility/io.py", line 136, in read_annotations
----------------------------------------------------------------------
File "/.../magni/reproducibility/io.py", line 167, in magni.reproducibility.io.read_annotations
Failed example:
with magni.utils.multiprocessing.File('db.hdf5', mode='r') as h5file:
annotations = read_annotations(h5file)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.reproducibility.io.read_annotations[1]>", line 1, in <module>
with magni.utils.multiprocessing.File('db.hdf5', mode='r') as h5file:
NameError: name 'magni' is not defined
======================================================================
FAIL: Doctest: magni.reproducibility.io.remove_annotations
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.reproducibility.io.remove_annotations
File "/.../magni/reproducibility/io.py", line 209, in remove_annotations
----------------------------------------------------------------------
File "/.../magni/reproducibility/io.py", line 223, in magni.reproducibility.io.remove_annotations
Failed example:
with magni.utils.multiprocessing.File('db.hdf5', mode='a') as h5file:
remove_annotations(h5file)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.reproducibility.io.remove_annotations[1]>", line 1, in <module>
with magni.utils.multiprocessing.File('db.hdf5', mode='a') as h5file:
NameError: name 'magni' is not defined
======================================================================
FAIL: Doctest: magni.utils.matrices.MatrixCollection
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.utils.matrices.MatrixCollection
File "/.../magni/utils/matrices.py", line 228, in MatrixCollection
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 253, in magni.utils.matrices.MatrixCollection
Failed example:
negate = magni.utils.matrices.Matrix(func, func, (), (3, 3))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[1]>", line 1, in <module>
negate = magni.utils.matrices.Matrix(func, func, (), (3, 3))
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 254, in magni.utils.matrices.MatrixCollection
Failed example:
negate.A
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[2]>", line 1, in <module>
negate.A
NameError: name 'negate' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 262, in magni.utils.matrices.MatrixCollection
Failed example:
reverse = magni.utils.matrices.Matrix(func, func, (), (3, 3))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[4]>", line 1, in <module>
reverse = magni.utils.matrices.Matrix(func, func, (), (3, 3))
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 263, in magni.utils.matrices.MatrixCollection
Failed example:
reverse.A
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[5]>", line 1, in <module>
reverse.A
NameError: name 'reverse' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 271, in magni.utils.matrices.MatrixCollection
Failed example:
matrix = MatrixCollection((negate, reverse))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[7]>", line 1, in <module>
matrix = MatrixCollection((negate, reverse))
NameError: name 'negate' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 275, in magni.utils.matrices.MatrixCollection
Failed example:
matrix.shape
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[8]>", line 1, in <module>
matrix.shape
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 281, in magni.utils.matrices.MatrixCollection
Failed example:
matrix.dot(vec)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[10]>", line 1, in <module>
matrix.dot(vec)
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 289, in magni.utils.matrices.MatrixCollection
Failed example:
matrix.A
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[11]>", line 1, in <module>
matrix.A
NameError: name 'matrix' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/matrices.py", line 296, in magni.utils.matrices.MatrixCollection
Failed example:
matrix.T.A
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.matrices.MatrixCollection[12]>", line 1, in <module>
matrix.T.A
NameError: name 'matrix' is not defined
======================================================================
FAIL: Doctest: magni.utils.plotting
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.utils.plotting
File "/.../magni/utils/plotting.py", line 0, in plotting
----------------------------------------------------------------------
File "/.../magni/utils/plotting.py", line 33, in magni.utils.plotting
Failed example:
magni.utils.plotting.setup_matplotlib()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.plotting[0]>", line 1, in <module>
magni.utils.plotting.setup_matplotlib()
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/plotting.py", line 37, in magni.utils.plotting
Failed example:
magni.utils.plotting.colour_collections['psp']['Blue']
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.plotting[1]>", line 1, in <module>
magni.utils.plotting.colour_collections['psp']['Blue']
NameError: name 'magni' is not defined
======================================================================
FAIL: Doctest: magni.utils.validation.disable_validation
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 2179, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for magni.utils.validation.disable_validation
File "/.../magni/utils/validation.py", line 124, in disable_validation
----------------------------------------------------------------------
File "/.../magni/utils/validation.py", line 135, in magni.utils.validation.disable_validation
Failed example:
@magni.utils.validation.decorate_validation
def _validate_test(arg):
magni.utils.validation.validate(arg, 'arg', {'type': int})
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest magni.utils.validation.disable_validation[0]>", line 1, in <module>
@magni.utils.validation.decorate_validation
NameError: name 'magni' is not defined
----------------------------------------------------------------------
File "/.../magni/utils/validation.py", line 155, in magni.utils.validation.disable_validation
Failed example:
try:
test('string')
print('No exception occured')
except BaseException:
print('An exception occured')
Expected:
No exception occured
Got:
An exception occured
----------------------------------------------------------------------
Ran 43 tests in 5.640s
FAILED (failures=16)
Using doctest directly, some of these pass, but some of them still fail:
$ python3.3 -m doctest magni/afm/reconstruction.py
**********************************************************************
File "magni/afm/reconstruction.py", line 93, in reconstruction.analyse
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[1]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 94, in reconstruction.analyse
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[2]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 95, in reconstruction.analyse
Failed example:
mi_file = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[3]>", line 1, in <module>
mi_file = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 96, in reconstruction.analyse
Failed example:
mi_buffer = mi_file.get_buffer('Topography')[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[4]>", line 1, in <module>
mi_buffer = mi_file.get_buffer('Topography')[0]
NameError: name 'mi_file' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 97, in reconstruction.analyse
Failed example:
mi_data = mi_buffer.get_data()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[5]>", line 1, in <module>
mi_data = mi_buffer.get_data()
NameError: name 'mi_buffer' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 98, in reconstruction.analyse
Failed example:
x = magni.imaging.mat2vec(mi_data)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[6]>", line 1, in <module>
x = magni.imaging.mat2vec(mi_data)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 111, in reconstruction.analyse
Failed example:
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
(int(len(x) / 2), len(x)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[9]>", line 1, in <module>
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 117, in reconstruction.analyse
Failed example:
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[10]>", line 1, in <module>
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 121, in reconstruction.analyse
Failed example:
print('MSE: {:.2f}, PSNR: {:.2f}'.format(*analyse(x, Phi, Psi)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.analyse[11]>", line 1, in <module>
print('MSE: {:.2f}, PSNR: {:.2f}'.format(*analyse(x, Phi, Psi)))
NameError: name 'x' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 198, in reconstruction.reconstruct
Failed example:
path = magni.utils.split_path(magni.__path__[0])[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[1]>", line 1, in <module>
path = magni.utils.split_path(magni.__path__[0])[0]
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 199, in reconstruction.reconstruct
Failed example:
path = path + 'examples' + os.sep + 'example.mi'
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[2]>", line 1, in <module>
path = path + 'examples' + os.sep + 'example.mi'
NameError: name 'path' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 200, in reconstruction.reconstruct
Failed example:
mi_file = magni.afm.io.read_mi_file(path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[3]>", line 1, in <module>
mi_file = magni.afm.io.read_mi_file(path)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 201, in reconstruction.reconstruct
Failed example:
mi_buffer = mi_file.get_buffer('Topography')[0]
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[4]>", line 1, in <module>
mi_buffer = mi_file.get_buffer('Topography')[0]
NameError: name 'mi_file' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 202, in reconstruction.reconstruct
Failed example:
mi_data = mi_buffer.get_data()
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[5]>", line 1, in <module>
mi_data = mi_buffer.get_data()
NameError: name 'mi_buffer' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 203, in reconstruction.reconstruct
Failed example:
x = magni.imaging.mat2vec(mi_data)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[6]>", line 1, in <module>
x = magni.imaging.mat2vec(mi_data)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 216, in reconstruction.reconstruct
Failed example:
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
(int(len(x) / 2), len(x)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[9]>", line 1, in <module>
Phi = magni.utils.matrices.Matrix(Phi_A, Phi_T, (),
NameError: name 'magni' is not defined
�[?1034h**********************************************************************
File "magni/afm/reconstruction.py", line 222, in reconstruction.reconstruct
Failed example:
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[10]>", line 1, in <module>
Psi = magni.imaging.dictionaries.get_DCT(mi_data.shape)
NameError: name 'magni' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 226, in reconstruction.reconstruct
Failed example:
y = Phi.dot(x)
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[11]>", line 1, in <module>
y = Phi.dot(x)
NameError: name 'Phi' is not defined
**********************************************************************
File "magni/afm/reconstruction.py", line 227, in reconstruction.reconstruct
Failed example:
print('Maximum absolute pixel error: {:.3f}'
.format(np.abs(reconstruct(y, Phi, Psi) - x).max()))
Exception raised:
Traceback (most recent call last):
File "/usr/lib64/python3.3/doctest.py", line 1313, in __run
compileflags, 1), test.globs)
File "<doctest reconstruction.reconstruct[12]>", line 2, in <module>
.format(np.abs(reconstruct(y, Phi, Psi) - x).max()))
NameError: name 'y' is not defined
**********************************************************************
2 items had failures:
9 of 12 in reconstruction.analyse
10 of 13 in reconstruction.reconstruct
***Test Failed*** 19 failures.
Maybe I'm just invoking these wrong?
Integers and long integers are different types in Python 2 on Windows. This causes exceptions to be raised when the current type validation only allows integers and not long integers.
The issue causes the following examples to fail:
When run on Windows, Python 2 prints integer types as part of the value, e.g.:
>>> import numpy as np
>>> A = np.zeros((256, 256))
>>> print(A.shape)
(256L, 256L)
This results in 5 failed doctests in magni
1.0.0.
Furthermore, when run on Windows, Python (both 2 and 3) prints integer dtypes along with arrays, e.g.:
>>> import numpy as np
>>> print(np.arange(4, dtype=np.int64))
array([0, 1, 2, 3], dtype=int64)
This results in 1 failed doctest in magni
1.0.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.