Comments (5)
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.
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.
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.
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.
Yep, looks fine now.
from python-matlab-bridge.
Related Issues (20)
- stdout not returned if stderr is populated by matlab
- 32 bit Matlab Messenger File not a valid Win32 application HOT 3
- Floating figures don't work on Windows HOT 2
- Unable to add folder using `addpath` HOT 1
- Python stalls and throws a Java exception whenever plotting functions are called. HOT 12
- Cannot use plot() on MacOS & Matlab R2016b HOT 3
- Cannot specify location of matlab executable HOT 3
- pymatbridge returns unwritable array
- Install fails on Windows Python 3.6
- Silent crash when passing numpy array into mlab.run_func HOT 1
- gmake install
- Errors with Pymatbridge HOT 2
- Pymatbridge starting but exhibiting weird behavior HOT 1
- Error pymatbridge: 'numpy.ndarray' object has no attribute 'todok' HOT 1
- Matlab function not responding after certain times of calls. HOT 6
- using run_func() to run a function in .m file,, my octave code can't access any session variables HOT 1
- OS X Sierra: Can't make the magic commands work HOT 8
- Make implicit non-blocking calls explicitly blocking
- macOS Monterey: Undefined function pops up when a python string is inserted as an argument. HOT 3
- Add dependencies to setup.py HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-matlab-bridge.