by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 28 18:02
    pitrish commented #252
  • Apr 28 18:01
    pitrish commented #253
  • Apr 28 18:00
    pitrish commented #253
  • Apr 14 18:45
    DeepGravity commented #123
  • Feb 07 17:34
    SirBenedick commented #246
  • Feb 06 19:57
    SirBenedick commented #246
  • Nov 21 2019 17:00
    lrq3000 commented #242
  • Nov 21 2019 16:57
    lrq3000 commented #242
  • May 15 2019 18:12
    AhmadChaiban commented #220
  • Apr 30 2019 10:58
    sh3raawii closed #256
  • Apr 24 2019 04:36
    lrq3000 opened #260
  • Apr 24 2019 04:32
    lrq3000 commented #239
  • Apr 24 2019 04:22
    lrq3000 commented #256
  • Mar 15 2019 02:40
    happyalfred2016 commented #227
  • Jan 17 2019 13:00
    reinout91 commented #131
  • Jul 31 2018 13:14

    arokem on master

    Update README.md Including REA… Merge pull request #259 from ma… (compare)

  • Jul 31 2018 13:14
    arokem closed #259
  • Jul 31 2018 13:14
    arokem commented #259
  • Jul 31 2018 01:36
    mateusz-was opened #259
  • Jun 24 2018 14:39
    matthias-k commented #255
Ariel Rokem
@arokem
What's up @gtzinos ?
Siddharth
@bollu
hey, is anyone around? :)
I was wondering as to how the test cases for this is written. Since it's an iPython binding, how do you check / write test cases for these extensions?
I'm working on Vispy, and I'm trying to write iPython extensions for it. I wasn't sure as to how you test it
Ariel Rokem
@arokem
Oh cool . Happy to help. Which test case exactly?
Siddharth
@bollu
I meant the general structure. Like, we initialize webgl bindings with the extension. So, I was wondering how you guys go about testing. Do you instantiate an iPython interpreter and then use it? or..?
Ariel Rokem
@arokem
Siddharth
@bollu
I'd like to know what the high level approach is
oh, thanks!
whoa, that's of great help. Thanks a lot :)
Ariel Rokem
@arokem
yeah - get_ipython will give you an IPython thing.
happy to help!
Let us know how you get on!
Siddharth
@bollu
will do :)
Siddharth
@bollu
how do you get the output of a cell?
Siddharth
@bollu
I got it, you bind what you want to a variable and access the namespace. Very cool. thanks a lot!
Ariel Rokem
@arokem
Sorry - went out for coffee. Glad you found that. TBH, I didn't write that test, so I would also probably have to dig a bit to answer your questions.
Steven Silvester
@blink1073
Ariel Rokem
@arokem
Yes - interesting. It doesn't support any interaction with numpy. Furthermore, it only works with the system python (for example on Mac). The core of the interaction is done through a compiled component, so there's no way to tell how it works
Steven Silvester
@blink1073
I didn't say I liked it. :wink:
LukasDrude
@LukasDrude
Do you use the bridge to develop Matlab code within an IPython Notebook or do you use it to use cod written in Matlab in a larger Python project?
Ariel Rokem
@arokem
I usually use it to write small matlab scripts in the notebook (as a kernel, using https://pypi.python.org/pypi/matlab_kernel). I'd actually be curious to know what others are doing with this, so hoping that more people will answer your question
LukasDrude
@LukasDrude
When I use pymatbridge an issue several matlab commands with results = matlab.run_code('timeSignal = randn(512, 1)'), I very often run in ipython waiting forever. I can then only interupt the call with a KeyboardInterrupt. How can I track down the cause?
Ariel Rokem
@arokem
Do you have a sense for the conditions under which it runs faster or slower? Does it matter if you put a ; at the end of your matlab code?
LukasDrude
@LukasDrude
When I use the command with ; in the Matlab code string, I the ipython shell returns immediately (good!). It appears to loose connection, when I use the command without ; a few times. The only option is to use matlab.start() again to restart the engine.
Ariel Rokem
@arokem
Huh. Looks like passing large messages through the messenger is not working that great. I am not sure what could be done to make that better.
Yassine Benhajali
@yassinebha

Hi,
I was trying the octave integration, but after successfully installed pymatbridge and connected Octave with

from pymatbridge import Octave
octave = Octave()
octave.start()

Starting Octave on ZMQ socket ipc:///tmp/pymatbridge-ad728a8c-93d8-4f42-9395-822a9a2b3bdf
Send 'exit' command to kill the server
.Octave started and connected!
Out[1]:
<pymatbridge.pymatbridge.Octave at 0x7f3b94668b50>

then I wasn't able to start the matlab magic integration %load_ext pymatbridge, it start to look for matlab installation which it doesn't exist.

do you have any idea how to make it works
Thanks a lot

LukasDrude
@LukasDrude
@yassinebha Did you try to pass the path of the executable? I.e. mlab = Matlab(executable='/opt/MATLAB/R2014a/bin/matlab')
Ariel Rokem
@arokem
That is, when loading the extension, use something like: %load_ext pymatbridge executable='/path/to/octave'
Yassine Benhajali
@yassinebha
@LukasDrude actually I don't have matlab installed in the machine
@arokem I've tried %load_ext pymatbridge executable='/usr/bin/octave' but it kept failing: http://nbviewer.ipython.org/github/yassinebha/tmp_pymatbridge/blob/master/pymatbridge_test.ipynb
LukasDrude
@LukasDrude
@yassinebha I was mainly suggesting to provide the path explicitly. You can surely replace the Matlab path by any other.
Ariel Rokem
@arokem
@LukasDrude : that would work with the python API, but in this case @yassinebha is trying to use the IPython %%matlab magic in the notebook. It's all about passing the full path to your octave to the extension
Could you please try matlab='/usr/bin/octave' instead of exectuable=...
?
Yassine Benhajali
@yassinebha
It doesn't work neither, I am pushing the image to dockerhub, you will be able to pull it and try it . I'l point you the link soon... and thanks a lots @LukasDrude and @arokem
Steven Silvester
@blink1073
You could add a symlink to Octave
Yassine Benhajali
@yassinebha
I've tried to create a matlab sim-link that point to octave in /usr/bin/ but it still fail to find it

the docker image is ready to pull:

  • Pull the image docker pull yassinebha/niak_notebook_test
  • Create a shared folder in you home directory mkdir $HOME/notebooks
  • Run the image
docker run --name notebook_test -d -p 443:8888  -v $HOME/notebooks/:/notebooks  -e "PASSWORD=password" yassinebha/ipython_notebook:0.0.1
  • Head to your browser then type https://localhost then over pass warning message then type the password which is password in this case ( you can choose your own ).
  • On OSX and Windows, extra steps are required to find the address and the port that the container has been forwarded to. In a Boot2Docker shell, run: boot2docker ip This should return an address like 192.168.59.103. Next, find the port in the docker environment with: docker port notebook_test 8888. This should return a port like 0.0.0.0.:443.
    Port your browser to the resulting address and port; for example: https://192.168.59.103:443.

  • Open a new ipython notebook then choose python 2 not 3 as kernel

  • In the first cell put this code to start octave interfacing:
from pymatbridge import Octave
octave = Octave()
octave.start()
%load_ext pymatbridge
LukasDrude
@LukasDrude
Does the Matlab kernel support %%bash magic?
Yassine Benhajali
@yassinebha
yes:
%%bash
whereis octave
octave: /usr/bin/octave /etc/octave.conf /usr/bin/X11/octave /usr/share/octave /usr/share/man/man1/octave.1.gz
LukasDrude
@LukasDrude
Ok, I think that is within a Python kernel. You can start a dedicated Matlab/Octave kernel (https://pypi.python.org/pypi/matlab_kernel) which is based on python-matlab-bridge.
Yassine Benhajali
@yassinebha
thanks @LukasDrude
eranna eru
@Erannaannigeri_twitter
Hey somebody plz help me with 3d mri denoising codes
In python
Ariel Rokem
@arokem
@Erannaannigeri_twitter: Are you sure you are in the right gitter channel?
eranna eru
@Erannaannigeri_twitter
Hey any idea on texture analysis of gray scale co-occurance matrix
I am using mammographic images
alvipat
@alvipat

Pymatbridge ERROR: 'numpy.ndarray' object has no attribute 'todok'
Hello
I'm trying to use a Cobra toolbox (in matlab code) in Jupyter Python notebook.
But I have an error using pymatbrigde.

I can connect matlab using magic command

%load_ext pymatbridge
Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge-b2ebed23-7ab3-4368-8fec-652a366b03b5
Send 'exit' command to kill the server
...........MATLAB started and connected!

I also can read a model test:

import cobra.test
m = cobra.test.create_test_model("textbook")

But model_to_pymatbridge doesn't work, and I can't parse the matlab model object to python format.

from cobra.io.mat import model_to_pymatbridge
model_to_pymatbridge(model, variable_name="modelTest")

AttributeError Traceback (most recent call last)

<ipython-input-11-dd83acd3bd47> in <module>()
1 from cobra.io.mat import model_to_pymatbridge
----> 2 model_to_pymatbridge(m, variable_name="model")

/home/user/anaconda2/lib/python2.7/site-packages/cobra/io/mat.pyc in model_to_pymatbridge(model, variable_name, matlab)
288 matlab = get_ipython().magics_manager.registry["MatlabMagics"].Matlab
289 model_info = create_mat_dict(model)
--> 290 S = model_info["S"].todok()
291 model_info["S"] = 0
292 temp_S_name = "cobra_pymatbridgetemp" + uuid4().hex

AttributeError: 'numpy.ndarray' object has no attribute 'todok'

I will be grateful for any help you can provide.
Thank you in advance for your time.

Vishesh Mangla
@XtremeGood
is this a matlab and python chanel?