Jupyter notebook support

Asked by ar115

As Yade is already supporting Ipython it would be very very useful to support jupyter notebook as well. Will make working with Yade much more user friendly....

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

I am sorry, but this message seems to me like an (actually not very good) advertisement.. Put here by "Ask a question" button, but there is no question, just a (IMO not true) statement.
Do you want to create the support yourself? Do you want somebody else to create it?

> Will make working with Yade much more user friendly

Yade uses plain Python scripts for serious work, IPython is a sugar for testing and playing around, not the main user interface. So improving user friendliness is independent on IPython.
IMO, documentation and support from the community is more valuable for the users than IPython or similar

> it would be very very useful to support jupyter notebook as well

"The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text"
I see no point how it would be "very very useful". But maybe I am just too old school..

anyway, Yade is open source, so if somebody wants/needs to use a different user interface, he/she is free to do so / ask somebody else to do so

I apologize if I got something wrong
cheers
Jan

Revision history for this message
ar115 (ali-rostai) said :
#2

Hi Jan,

I understand from the standpoint of a developer who has much experience maybe jupyter is not important. But I think supporting jupyter would help to promote and advertise Yade more. And I thought that it should be trivial to include support for it as jupyeter is basically python and yade is nothing but python script.

Revision history for this message
Jan Stránský (honzik) said :
#3

Hello,

you used "Ask a question" interface, wrote already two comments and there is not a single question.

> But I think supporting jupyter would help to promote and advertise Yade more.

I agree with this point, but so far from your messages it is the only relevant reason.. Before it was vague "it would be very very useful" and "Will make working with Yade much more user friendly" without any specification.

If you are a Yade user and know jupyter, please write us specific reasons why we should spend time to create support for jupyter (from a quick look at jupyter web site, I see no reason. Without reason, nobody would have time/will to do it). I am not sure if mere advertising would be enough..
If you are not a Yade user and just wants to advertise jupyter (which is ok), please next time use different channel (like writing email to yade developers, not "ask a question"). Again, specific reasons would increase the chance to succeed.

> yade is nothing but python script

well, just from very specific and simplified point of view :-)

cheers
Jan

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

I don't understand the initial statement. Is there a compatibility problem when running yade on jupyter?
Bruno

Revision history for this message
ar115 (ali-rostai) said :
#5

Not really, I'm not affiliated with jupyter at all :)

Just I'm totally new to both python and yade. The reason I've found jupyter useful is mainly due to it's cell mode which makes is easy to explore. I can run a cell which does some heavy loading/initialization once and then experiment without the need to run that time consuming again ...

what should I do if I want to run a yade script directly with python instead of yade command? jupyter knows only how to run python on a piece of code and this is the problem of using jupyter for yade...

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

You can "import yade" in a python module, if you have a symlink "yade.py" in your path pointing to the actual yade executable.
Besides, there is nothing like "yade command", this is just ordinary python, and the yade CLI is actually ipython with custom decorations.
Bruno

Revision history for this message
ar115 (ali-rostai) said :
#7

This is good news. I have installed yadedaily actually. When I open interactive prompt get this error:

Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yadedaily
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/yadedaily/__init__.py", line 66, in <module>
    boot.initialize(plugins,config.confDir)
ImportError: No module named yade.wrapper
>>>

Revision history for this message
Jan Stránský (honzik) said :
#8

Hello,

> Not really, I'm not affiliated with jupyter at all :)

then I am sorry, it really looked like you are :-)

To use yade in python, install python-yade package (supposing you use ubuntu or similar)
sudo apt-get install python-yade

then in python:
import yade

cheers
Jan

Revision history for this message
ar115 (ali-rostai) said :
#9

Thanks Jan, I was adventurous and installed yadedaily instead of yade. So I don't have yade and have yadedaily instead. But I get the error which I mentioned in my previous post when I do

>>> import yadedaily

in my python prompt. Any way to fix that one?

Revision history for this message
Jan Stránský (honzik) said :
#10

Just a note, you can have installed both yadedaily and yade alongside

Concerning the import error, I got completely different error :-)
as a workaround, try to use symbolic link:
mkdir /some/path/for/the/link # like /home/USERNAME/include
ln -s /usr/bin/yadedaily /some/path/for/the/link/myyade.py #
python
>>> import sys; sys.path.append('/some/path/for/the/link')
>>> import myyade

It worked for me

cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask ar115 for more information if necessary.

To post a message you must log in.