Code Monkey home page Code Monkey logo

Comments (6)

blink1073 avatar blink1073 commented on July 19, 2024

Can you try running nosetests from the oct2py directory and posting those results?

from oct2py.

andrewclegg avatar andrewclegg commented on July 19, 2024

Hmm -- very different results like that. Failures, but different ones. And it hung on test_plot, no progress for about 20 minutes, so I interrupted it with ctrl-c.

I forgot to say, this is with Octave 3.2.4 64-bit, installed from standard Ubuntu repository.

vagrant@charmed34:/usr/local/lib/python3.4/dist-packages/oct2py$ nosetests -v
Start a number of threads and verify each has a unique Octave session. ... ok
Checks the speed penalty of the Python to Octave bridge. ... ok
test_octave_cell_magic (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octave_error (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octave_inline (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octave_plot (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octave_roundtrip (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octave_syntax_error (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
test_octavemagic_localscope (oct2py.ipython.tests.test_octavemagic.OctaveMagicTest) ... ok
Test the call command ... ok
Test the creation of a dynamic function ... ok
Testing help command ... FAIL
test_octave_error (oct2py.tests.test_oct2py.BasicUsageTest) ... ok
Test opening and closing the Octave session ... ok
Test putting and getting values ... ok
Test the run command ... ok
Test Struct construct ... ok
Make sure a syntax error in Octave throws an Oct2PyError ... ok
Test boolean values ... ok
Test python dictionary ... ok
Test python list type ... ok
Test python list of tuples ... ok
Test python dictionary ... ok
Test python list type ... ok
Test python list of tuples ... ok
Test nested python dictionary ... ok
Test python nested lists ... ok
Test sending None type ... ok
Test python numeric types ... ok
Test python set type ... ok
Test python str and unicode types ... ok
Test python tuple type ... ok
Test incoming cell array types ... ok
Test incoming float types ... ok
Test incoming integer types ... ok
Test incoming logical type ... ok
Test incoming misc numeric types ... ok
Test mixed struct type ... ok
Test incoming string types ... ok
Test incoming struct array types ... ok
Test roundtrip empty matrices ... ok
Test support for masked arrays ... ok
Verify support for matrix type ... ok
Send ndarrays and make sure we get the same array back ... ok
Send scalar numpy types and make sure we get the same number back. ... ok
Test roundtrip sparse matrices ... ok
Test roundtrip value and type preservation for cell array types ... ok
Test roundtrip value and type preservation for float types ... ok
Test roundtrip value and type preservation for integer types ... ok
Test roundtrip value and type preservation for logical type ... ok
Test roundtrip value and type preservation for misc numeric types ... ok
Test all of the types, originating in octave, and returning ... ok
Test roundtrip value and type preservation for string types ... ok
Test roundtrip value and type preservation for struct array types ... ok
Test roundtrip python type conversions ... ok
Make sure unicode docstrings in Octave functions work ... ok
Make sure oct2py works within a context manager ... ok
Make sure a singleton sparse matrix works ... ok
oct2py.tests.test_oct2py.test_logging ... ok
oct2py.tests.test_oct2py.test_demo ... ok
oct2py.tests.test_oct2py.test_lookfor ... ERROR
oct2py.tests.test_oct2py.test_remove_files ... ok
oct2py.tests.test_oct2py.test_threads ... ok
oct2py.tests.test_oct2py.test_plot ...
======================================================================
ERROR: oct2py.tests.test_oct2py.test_lookfor
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.4/dist-packages/oct2py/tests/test_oct2py.py", line 736, in test_lookfor
    assert 'cosd' in octave.lookfor('cos')
  File "/usr/local/lib/python3.4/dist-packages/oct2py/session.py", line 355, in lookfor
    timeout=timeout)
  File "/usr/local/lib/python3.4/dist-packages/oct2py/session.py", line 126, in run
    return self.call(script, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/oct2py/session.py", line 240, in call
    resp = self._eval(cmd, verbose=verbose, timeout=timeout)
  File "/usr/local/lib/python3.4/dist-packages/oct2py/session.py", line 395, in _eval
    timeout=timeout)
  File "/usr/local/lib/python3.4/dist-packages/oct2py/session.py", line 647, in evaluate
    raise Oct2PyError(msg)
oct2py.utils.Oct2PyError: Oct2Py tried to run:
"""
lookfor -all cos
"""
Octave returned:
fwrite: invalid stream number = -1

======================================================================
FAIL: Testing help command
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/oct2py/tests/test_oct2py.py", line 591, in test_help
    assert 'Compute the cosine for each element of X in radians.' in doc
AssertionError

----------------------------------------------------------------------
Ran 61 tests in 2288.362s

FAILED (errors=1, failures=1)

from oct2py.

blink1073 avatar blink1073 commented on July 19, 2024

If you install gnuplot (sudo apt-get install gnuplot-qt), that should prevent test_plot from hanging. I tested this with Python 3.4 and Octave 3.2 on Ubuntu 12.04 64bit (using Travis CI), and all tests pass. I'm not sure why your other tests are failing.

from oct2py.

andrewclegg avatar andrewclegg commented on July 19, 2024

Sorry about slow reply - holidays. I don't see a gnuplot-qt package in 12.04:

vagrant@charmed34:~$ apt-cache madison gnuplot*
   gnuplot | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
python-gnuplot |    1.8-1.1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-doc | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgnuplot-ruby | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-x11 | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-nox | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgnuplot-ruby1.8 | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
ruby-gnuplot | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-mode |  1:0.6.0-7 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libchart-gnuplot-perl |     0.17-1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgraphics-gnuplotif-perl |      1.6-1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages

I already have gnuplot-x11 installed.

I get the same error and failure as above whether I have X forwarding enabled or disabled (on my ssh session into the machine running the tests). When it's enabled, I see a plot briefly flash up on screen in an X11 window, but I get the same issues nonetheless.

from oct2py.

blink1073 avatar blink1073 commented on July 19, 2024

Hmm, I'm not sure how to reproduce these errors. I tried installing
snake-charmer to test myself but I ran into problems with the virtualbox
guest additions. What versions of virtualbox/guest additions are you using?

On Mon, Jun 30, 2014 at 1:51 PM, Andrew Clegg [email protected]
wrote:

Sorry about slow reply - holidays. I don't see a gnuplot-qt package in
12.04:

vagrant@charmed34:~$ apt-cache madison gnuplot*
gnuplot | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
python-gnuplot | 1.8-1.1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-doc | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgnuplot-ruby | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-x11 | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-nox | 4.4.3-0ubuntu3 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgnuplot-ruby1.8 | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
ruby-gnuplot | 2.3.6-1build1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
gnuplot-mode | 1:0.6.0-7 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libchart-gnuplot-perl | 0.17-1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
libgraphics-gnuplotif-perl | 1.6-1 | http://us.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages

I already have gnuplot-x11 installed.

I get the same error and failure as above whether I have X forwarding
enabled or disabled (on my ssh session into the machine running the tests).
When it's enabled, I see a plot briefly flash up on screen in an X11
window, but I get the same issues nonetheless.


Reply to this email directly or view it on GitHub
#44 (comment).

from oct2py.

blink1073 avatar blink1073 commented on July 19, 2024

Fixed upstream.

from oct2py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.