Giter VIP home page Giter VIP logo

Comments (5)

arokem avatar arokem commented on May 22, 2024

Thanks for reporting. I just put in that change today - I was wondering
what happened. I guess this is a new thing in ipython 3.

I'll go ahead and fix that and ping you when I am done.

On Mon, Aug 18, 2014 at 4:23 PM, eendebakpt [email protected]
wrote:

Any command related to plotting, e.g.

%%matlab
a = linspace(0.01,6*pi,100);
plot(sin(a));

fails with the following error message:

...
/usr/local//python2.7/dist-packages/pymatbridge/matlab_magic.pyc in
matlab(self, line, cell, local_ns)
235
236 for disp_d in display_data:
--> 237 publish_display_data(disp_d)
238
239 # Delete the temporary data files created by matlab:

TypeError: publish_display_data() takes at least 2 arguments (1 given)

This is for Ipython 1.2 and IPython 2.1. I checked the source code of
IPython and the publish_display_data function requires 2 arguments.

Replacing the following code in matlab_magic.py solves the problem:

for disp_d in display_data:
publish_display_data(disp_d)

with
for disp_d in display_data:
publish_display_data("dummy", disp_d)

This fix should probably be adapted such that older version of IPython
also work


Reply to this email directly or view it on GitHub
#80.

from python-matlab-bridge.

arokem avatar arokem commented on May 22, 2024

OK - done. Does installing it from master work for you now?

On Mon, Aug 18, 2014 at 5:20 PM, Ariel Rokem [email protected] wrote:

Thanks for reporting. I just put in that change today - I was wondering
what happened. I guess this is a new thing in ipython 3.

I'll go ahead and fix that and ping you when I am done.

On Mon, Aug 18, 2014 at 4:23 PM, eendebakpt [email protected]
wrote:

Any command related to plotting, e.g.

%%matlab
a = linspace(0.01,6*pi,100);
plot(sin(a));

fails with the following error message:

...
/usr/local//python2.7/dist-packages/pymatbridge/matlab_magic.pyc in
matlab(self, line, cell, local_ns)
235
236 for disp_d in display_data:
--> 237 publish_display_data(disp_d)
238
239 # Delete the temporary data files created by matlab:

TypeError: publish_display_data() takes at least 2 arguments (1 given)

This is for Ipython 1.2 and IPython 2.1. I checked the source code of
IPython and the publish_display_data function requires 2 arguments.

Replacing the following code in matlab_magic.py solves the problem:

for disp_d in display_data:
publish_display_data(disp_d)

with
for disp_d in display_data:
publish_display_data("dummy", disp_d)

This fix should probably be adapted such that older version of IPython
also work


Reply to this email directly or view it on GitHub
#80.

from python-matlab-bridge.

isbadawi avatar isbadawi commented on May 22, 2024

I haven't tried the code in the OP, but from master the test_magic tests are failing with the same error, e.g.:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/Users/isbadawi/code/py/python-matlab-bridge/pymatbridge/tests/test_magic.py", line 60, in test_line_magic
    self.ip.run_line_magic('matlab', 'a = [1 2 3]')
  File "/usr/local/lib/python3.4/site-packages/IPython/core/interactiveshell.py", line 2126, in run_line_magic
    result = fn(*args,**kwargs)
  File "<string>", line 2, in matlab
  File "/usr/local/lib/python3.4/site-packages/IPython/core/magic.py", line 193, in <lambda>
    call = lambda f, *a, **k: f(*a, **k)
  File "/Users/isbadawi/code/py/python-matlab-bridge/pymatbridge/matlab_magic.py", line 249, in matlab
    publish_display_data(disp_d)
TypeError: publish_display_data() missing 1 required positional argument: 'data'

I'm using IPython 2.2.0.

from python-matlab-bridge.

arokem avatar arokem commented on May 22, 2024

Yes - you're right. I didn't properly test it. Should work now (?), and
tested on IPython 3.0.dev and IPython 2.2.0

On Tue, Aug 19, 2014 at 10:23 AM, Ismail Badawi [email protected]
wrote:

I haven't tried the code in the OP, but from master the test_magic tests
are failing with the same error, e.g.:

Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/nose/case.py", line 198, in runTest
self.test(_self.arg)
File "/Users/isbadawi/code/py/python-matlab-bridge/pymatbridge/tests/test_magic.py", line 60, in test_line_magic
self.ip.run_line_magic('matlab', 'a = [1 2 3]')
File "/usr/local/lib/python3.4/site-packages/IPython/core/interactiveshell.py", line 2126, in run_line_magic
result = fn(_args,*_kwargs)
File "", line 2, in matlab
File "/usr/local/lib/python3.4/site-packages/IPython/core/magic.py", line 193, in
call = lambda f, *a, *_k: f(_a, *_k)
File "/Users/isbadawi/code/py/python-matlab-bridge/pymatbridge/matlab_magic.py", line 249, in matlab
publish_display_data(disp_d)
TypeError: publish_display_data() missing 1 required positional argument: 'data'

I'm using IPython 2.2.0.


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

from python-matlab-bridge.

isbadawi avatar isbadawi commented on May 22, 2024

Yep, looks fine now.

from python-matlab-bridge.

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.