mailRe: [task #7873] Write wrapper function to nmrglue, to read .ft2 files and process them.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels Emtekær Linnet on January 15, 2015 - 09:27:
So this has nothing to do with nmrglue, I guess?

But to the base64 module of python.

Best
Troels

2015-01-14 19:13 GMT+01:00 Edward d Auvergne <
NO-REPLY.INVALID-ADDRESS@xxxxxxx>:

Follow-up Comment #94, task #7873 (project relax):

When I run the Nmrglue system tests in Python 2, they pass.  However in
Python
3 I see:

$ python3 ./relax -s --time Nmrglue
Echoing of user function calls has been enabled.


=============================
= System / functional tests =
=============================

.     0.00 s for Nmrglue.test_nmrglue_read
.     0.00 s for Nmrglue.test_nmrglue_read_several
.     0.16 s for Nmrglue.test_plot_contour
.     0.10 s for Nmrglue.test_plot_contour_cpmg
.     0.12 s for Nmrglue.test_plot_correlation
.     2.90 s for Nmrglue.test_plot_hist_cpmg
.     3.44 s for Nmrglue.test_plot_hist_cpmg_several
E     0.00 s for Nmrglue.test_save_state
.     0.00 s for Nmrglue.test_version

======================================================================
ERROR: test_save_state (test_suite.system_tests.nmrglue.Nmrglue)
Test saving a state with numpy arrays, reset relax, and read the state
again.
----------------------------------------------------------------------

relax> pipe.create(pipe_name='mf', pipe_type='mf', bundle=None)

relax> spectrum.nmrglue_read(file='128_0_FT.ft2',

dir='/data/relax/branches/nmrglue/test_suite/shared_data/dispersion/repeated_analysis/SOD1/cpmg_disp_sod1d90a_060518/cpmg_disp_sod1d90a_060518_normal.fid/ft2_data',
nmrglue_id='test')
Filesize of .ft2 file is: 527360
Type of encoding is: <class 'numpy.ndarray'>
Storing numpy array to: /tmp/tmpl4p2zk/data.npy
Filesize of .npy file is: 525392
Shape of data is 256x513
dtype of data is float32
Type of data[0][0]:  <class 'numpy.float32'>

relax> state.save(state='state', dir='/tmp/tmpl4p2zk', compress_type=1,
force=True)
Opening the file '/tmp/tmpl4p2zk/state.bz2' for writing.
Traceback (most recent call last):
  File "/data/relax/branches/nmrglue/test_suite/system_tests/nmrglue.py",
line
569, in test_save_state
    self.interpreter.state.save('state', dir=dirpath, compress_type=1,
force=True)
  File "/data/relax/branches/nmrglue/prompt/uf_objects.py", line 225, in
__call__
    self._backend(*new_args, **uf_kargs)
  File "/data/relax/branches/nmrglue/pipe_control/state.py", line 128, in
save_state
    ds.to_xml(file)
  File "/data/relax/branches/nmrglue/data_store/__init__.py", line 643, in
to_xml
    self[pipe].to_xml(xmldoc, pipe_element, pipe_type=self[pipe].pipe_type)
  File "/data/relax/branches/nmrglue/data_store/pipe_container.py", line
335,
in to_xml
    self.nmrglue.to_xml(doc, element)
  File "/data/relax/branches/nmrglue/data_store/data_classes.py", line
244, in
to_xml
    self[key].to_xml(doc, dict_item_element)
  File "/data/relax/branches/nmrglue/data_store/nmrglue.py", line 138, in
to_xml
    string = b64encode(self.data)
  File "/usr/lib64/python3.3/base64.py", line 58, in b64encode
    raise TypeError("expected bytes, not %s" % s.__class__.__name__)
TypeError: expected bytes, not ndarray

----------------------------------------------------------------------
Ran 9 tests in 6.725s

FAILED (errors=1)

    _______________________________________________________

Reply to this item at:

  <http://gna.org/task/?7873>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/




Related Messages


Powered by MHonArc, Updated Thu Jan 15 09:40:12 2015