← Back to team overview

yade-dev team mailing list archive

[Bug 1774065] Re: doctests fail with numpy 1.14

 

I do not confirm it:

jerome.duriez@AXP17003:~$ yadedaily
Welcome to Yade 2018.02b-1270674828~xenial 
TCP python prompt on localhost:9000, auth cookie `dckayu'
XMLRPC info provider on http://localhost:21000
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view (use h-key for showing help), F10 both, F9 generator, F8 plot. ]]

Yade [1]: from yade import plot

Yade [2]: plot.reset()

Yade [3]: plot.addData(a=1,b=11,c=21,d=31)  # add some data here

Yade [4]: plot.saveDataTxt('/tmp/dataFile.txt.bz2',vars=('a','b','c'))

Yade [5]: import numpy

Yade [6]:
d=numpy.genfromtxt('/tmp/dataFile.txt.bz2',dtype=None,names=True)

Yade [7]: d
 ->  [7]: 
array((1, 11, 21), 
      dtype=[('a', '<i8'), ('b', '<i8'), ('c', '<i8')])


I have Python 2.7.12 on my machine (in case it matters)

-- 
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/1774065

Title:
  doctests fail with numpy 1.14

Status in Yade:
  New
Status in Debian:
  Confirmed

Bug description:
  ======================================================================
  FAIL: saveDataTxt (yade.plot)
  Doctest: yade.plot.saveDataTxt
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib/python2.7/doctest.py", line 2226, in runTest
      raise self.failureException(self.format_failure(new.getvalue()))
  AssertionError: Failed doctest test for yade.plot.saveDataTxt
    File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 614, in saveDataTxt

  ----------------------------------------------------------------------
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 626, in yade.plot.saveDataTxt
  Failed example:
      d=numpy.genfromtxt('/tmp/dataFile.txt.bz2',dtype=None,names=True)
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
          compileflags, 1) in test.globs
        File "<doctest yade.plot.saveDataTxt[8]>", line 1, in <module>
          d=numpy.genfromtxt('/tmp/dataFile.txt.bz2',dtype=None,names=True)
        File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 1689, in genfromtxt
          fhd = iter(np.lib._datasource.open(fname, 'rt', encoding=encoding))
        File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 260, in open
          return ds.open(path, mode, encoding=encoding, newline=newline)
        File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 614, in open
          encoding=encoding, newline=newline)
        File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 88, in _python2_bz2open
          raise ValueError("bz2 text files not supported in python2")
      ValueError: bz2 text files not supported in python2
  ----------------------------------------------------------------------
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 627, in yade.plot.saveDataTxt
  Failed example:
      d['a']
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
          compileflags, 1) in test.globs
        File "<doctest yade.plot.saveDataTxt[9]>", line 1, in <module>
          d['a']
      NameError: name 'd' is not defined
  ----------------------------------------------------------------------
  File "/usr/lib/x86_64-linux-gnu/yade/py/yade/plot.py", line 629, in yade.plot.saveDataTxt
  Failed example:
      d['b']
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib/python2.7/doctest.py", line 1315, in __run
          compileflags, 1) in test.globs
        File "<doctest yade.plot.saveDataTxt[10]>", line 1, in <module>
          d['b']
      NameError: name 'd' is not defined

  
  ----------------------------------------------------------------------
  Ran 58 tests in 1.063s

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/1774065/+subscriptions


References