<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import tempfile <EOL> import os <EOL> import numpy as np <EOL> from numpy . testing import assert_array_equal <EOL> import nmrglue as ng <EOL> from nose . plugins . attrib import attr <EOL> from setup import DATA_DIR <EOL> def write_readback ( dic , data ) : <EOL> """<STR_LIT>""" <EOL> tf = tempfile . mktemp ( suffix = '<STR_LIT>' , dir = '<STR_LIT:.>' ) <EOL> ng . rnmrtk . write ( tf , dic , data ) <EOL> rdic , rdata = ng . rnmrtk . read ( tf ) <EOL> os . remove ( tf ) <EOL> os . remove ( tf . replace ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> assert_array_equal ( data , rdata ) <EOL> assert dic == rdic <EOL> def lowmem_write_readback ( dic , data ) : <EOL> """<STR_LIT>""" <EOL> tf = tempfile . mktemp ( suffix = '<STR_LIT>' , dir = '<STR_LIT:.>' ) <EOL> ng . rnmrtk . write_lowmem ( tf , dic , data ) <EOL> rdic , rdata = ng . rnmrtk . read_lowmem ( tf ) <EOL> s = tuple ( range ( data . ndim ) ) <EOL> assert data [ s ] == rdata [ s ] <EOL> assert dic == rdic <EOL> print ( tf ) <EOL> os . remove ( tf ) <EOL> os . remove ( tf . replace ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_1d_time ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> assert data . shape == ( <NUM_LIT> , ) <EOL> assert np . abs ( data [ <NUM_LIT:0> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:0> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:1> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:1> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_1d_freq ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> assert data . shape == ( <NUM_LIT> , ) <EOL> assert np . abs ( data [ <NUM_LIT:0> ] - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:1> ] - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_2d_time ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_2d_freq ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_2d_time_lowmem ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read_lowmem ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> lowmem_write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_2d_freq_lowmem ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read_lowmem ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> ] - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> lowmem_write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_time ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] . imag - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_freq ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_time_lowmem ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read_lowmem ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] . real - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] . imag - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] . imag - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> lowmem_write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_freq_lowmem ( ) : <EOL> """<STR_LIT>""" <EOL> dic , data = ng . rnmrtk . read_lowmem ( <EOL> os . path . join ( DATA_DIR , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert np . abs ( data [ <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT> ] - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:2> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:1> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] [ <NUM_LIT:0> ] == <NUM_LIT> <EOL> lowmem_write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_transpose ( ) : <EOL> """<STR_LIT>""" <EOL> dir_3d = os . path . join ( DATA_DIR , '<STR_LIT>' ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:4> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:2> , <NUM_LIT:8> , <NUM_LIT:3> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:4> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:64> ) <EOL> assert np . abs ( data [ <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:1> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:3> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read ( os . path . join ( dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:64> ) <EOL> assert np . abs ( data [ <NUM_LIT:8> , <NUM_LIT:6> , <NUM_LIT:1> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> write_readback ( dic , data ) <EOL> @ attr ( speed = '<STR_LIT>' ) <EOL> def test_3d_transpose_lowmem ( ) : <EOL> """<STR_LIT>""" <EOL> dir_3d = os . path . join ( DATA_DIR , '<STR_LIT>' ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:4> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:2> , <NUM_LIT:8> , <NUM_LIT:3> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:4> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:64> ) <EOL> assert np . abs ( data [ <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:1> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assert np . abs ( data [ <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:3> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) <EOL> dic , data = ng . rnmrtk . read_lowmem ( os . path . join ( <EOL> dir_3d , "<STR_LIT>" ) ) <EOL> assert data . shape == ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:64> ) <EOL> assert np . abs ( data [ <NUM_LIT:8> , <NUM_LIT:6> , <NUM_LIT:1> ] . real - - <NUM_LIT> ) <= <NUM_LIT> <EOL> assert dic [ '<STR_LIT>' ] == [ <NUM_LIT:64> , <NUM_LIT> , <NUM_LIT> ] <EOL> lowmem_write_readback ( dic , data ) </s>
