
Dear Devs, Has anyone tried to get IPython working with cctbx? I'd really like to be able to use IPython notebooks for examples/tutorials/documented experiments, and was wondering if anyone else had thought the same thing. Cheers, Oli

On Mon, Sep 8, 2014 at 1:19 PM, Oliver Zeldin
Has anyone tried to get IPython working with cctbx?
I'd really like to be able to use IPython notebooks for examples/tutorials/documented experiments, and was wondering if anyone else had thought the same thing.
Apparently Ralf did this years ago: if you have IPython installed with the Python that you're using, then re-running the configuration (or libtbx.refresh) will result in a command named "libtbx.ipython" being created. I confirmed that this does in fact seem to work, although since I've never used Ipython I'm not sure what to expect. If this is something that would be generally useful we could add it to the dependencies build script (and the new improved plus bundles, which I will be sending an email about RSN). -Nat

Thanks Nat.
I have ipython with my usual python build, yet libtbx.ipython does not
exist. I've tried libtbx.refresh, and this doesn't give me anything. What
should I re-configure with libtbx.configure?
If I can get this working I'll create and share an IPython notebook to
demonstrate a use case for it.
Cheers,
Oli
On Mon, Sep 8, 2014 at 1:45 PM, Nathaniel Echols
On Mon, Sep 8, 2014 at 1:19 PM, Oliver Zeldin
wrote: Has anyone tried to get IPython working with cctbx?
I'd really like to be able to use IPython notebooks for examples/tutorials/documented experiments, and was wondering if anyone else had thought the same thing.
Apparently Ralf did this years ago: if you have IPython installed with the Python that you're using, then re-running the configuration (or libtbx.refresh) will result in a command named "libtbx.ipython" being created. I confirmed that this does in fact seem to work, although since I've never used Ipython I'm not sure what to expect.
If this is something that would be generally useful we could add it to the dependencies build script (and the new improved plus bundles, which I will be sending an email about RSN).
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University

On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
What happens when you run this? python -c "import IPython" -Nat

Nothing (it works). Further bits and bobs (my python is installed via Homebrew) $python
import IPython IPython.__file__ '/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.pyc'
Also how I normally launch IPython:
$ cat `which IPython`
#!/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# -*- coding: utf-8 -*-
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())
On Mon, Sep 8, 2014 at 2:01 PM, Nathaniel Echols
On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
wrote: I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
What happens when you run this?
python -c "import IPython"
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University

Try editing libtbx/env_config.py and replace lines 1676-7:
try: import IPython
except ImportError: return
with simply "import IPython", then run libtbx.refresh and see what happens.
-Nat
On Mon, Sep 8, 2014 at 2:09 PM, Oliver Zeldin
Nothing (it works).
Further bits and bobs (my python is installed via Homebrew)
$python
import IPython IPython.__file__
'/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.pyc'
Also how I normally launch IPython: $ cat `which IPython`
#!/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# -*- coding: utf-8 -*- import re import sys
from IPython import start_ipython
if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
On Mon, Sep 8, 2014 at 2:01 PM, Nathaniel Echols
wrote: On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
wrote: I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
What happens when you run this?
python -c "import IPython"
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb

Working now. I have no idea what just happened.
That is odd in the extreme...
On Mon, Sep 8, 2014 at 2:15 PM, Nathaniel Echols
Try editing libtbx/env_config.py and replace lines 1676-7:
try: import IPython except ImportError: return
with simply "import IPython", then run libtbx.refresh and see what happens.
-Nat
On Mon, Sep 8, 2014 at 2:09 PM, Oliver Zeldin
wrote: Nothing (it works).
Further bits and bobs (my python is installed via Homebrew)
$python
import IPython IPython.__file__
'/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.pyc'
Also how I normally launch IPython: $ cat `which IPython`
#!/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# -*- coding: utf-8 -*- import re import sys
from IPython import start_ipython
if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
On Mon, Sep 8, 2014 at 2:01 PM, Nathaniel Echols
wrote: On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
wrote: I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
What happens when you run this?
python -c "import IPython"
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University

Now.. can we make it take arguments from the command line? This way we can
do things like
$libtbx.ipython notebook --matplotib
(or whatever)
For reference, the default ipython launcher does:
import re
import sys
from IPython import start_ipython
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(start_ipython())
On Mon, Sep 8, 2014 at 2:26 PM, Oliver Zeldin
Working now. I have no idea what just happened.
That is odd in the extreme...
On Mon, Sep 8, 2014 at 2:15 PM, Nathaniel Echols
wrote: Try editing libtbx/env_config.py and replace lines 1676-7:
try: import IPython except ImportError: return
with simply "import IPython", then run libtbx.refresh and see what happens.
-Nat
On Mon, Sep 8, 2014 at 2:09 PM, Oliver Zeldin
wrote: Nothing (it works).
Further bits and bobs (my python is installed via Homebrew)
$python
import IPython IPython.__file__
'/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/__init__.pyc'
Also how I normally launch IPython: $ cat `which IPython`
#!/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# -*- coding: utf-8 -*- import re import sys
from IPython import start_ipython
if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
On Mon, Sep 8, 2014 at 2:01 PM, Nathaniel Echols
wrote: On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
wrote: I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
What happens when you run this?
python -c "import IPython"
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University
-- Dr. Oliver B. Zeldin Brunger Group Stanford University

On Mon, Sep 8, 2014 at 2:32 PM, Oliver Zeldin
Now.. can we make it take arguments from the command line? This way we can do things like
$libtbx.ipython notebook --matplotib
(or whatever)
For reference, the default ipython launcher does:
import re import sys
from IPython import start_ipython
if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
Ralf's launcher (libtbx/command_line/ipython_shell_start.py) is from 2007 and I don't know of anyone else using it, so feel free to modify it if you think it could be made more useful. -Nat

Here's an example of an IPython notebook for CCTBX:
http://nbviewer.ipython.org/github/zeldebeest/public-notebooks/blob/master/C...
Basically, it combines a notebook and an interactive python environment.
Awesome times for command-line based analysis sessions, so you can keep
track of everything you do, and easily share your work.
On Mon, Sep 8, 2014 at 2:36 PM, Nathaniel Echols
On Mon, Sep 8, 2014 at 2:32 PM, Oliver Zeldin
wrote: Now.. can we make it take arguments from the command line? This way we can do things like
$libtbx.ipython notebook --matplotib
(or whatever)
For reference, the default ipython launcher does:
import re import sys
from IPython import start_ipython
if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython())
Ralf's launcher (libtbx/command_line/ipython_shell_start.py) is from 2007 and I don't know of anyone else using it, so feel free to modify it if you think it could be made more useful.
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University

Agreed. This would be a simple and useful thing to add to the builds.
Oliver, it should work fine if you install it into cctbx's python
interpreter. Can you "import IPython" ?
Ian
On Mon, Sep 8, 2014 at 1:58 PM, Oliver Zeldin
Thanks Nat.
I have ipython with my usual python build, yet libtbx.ipython does not exist. I've tried libtbx.refresh, and this doesn't give me anything. What should I re-configure with libtbx.configure?
If I can get this working I'll create and share an IPython notebook to demonstrate a use case for it.
Cheers,
Oli
On Mon, Sep 8, 2014 at 1:45 PM, Nathaniel Echols
wrote: On Mon, Sep 8, 2014 at 1:19 PM, Oliver Zeldin
wrote: Has anyone tried to get IPython working with cctbx?
I'd really like to be able to use IPython notebooks for examples/tutorials/documented experiments, and was wondering if anyone else had thought the same thing.
Apparently Ralf did this years ago: if you have IPython installed with the Python that you're using, then re-running the configuration (or libtbx.refresh) will result in a command named "libtbx.ipython" being created. I confirmed that this does in fact seem to work, although since I've never used Ipython I'm not sure what to expect.
If this is something that would be generally useful we could add it to the dependencies build script (and the new improved plus bundles, which I will be sending an email about RSN).
-Nat
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
-- Dr. Oliver B. Zeldin Brunger Group Stanford University
_______________________________________________ cctbxbb mailing list [email protected] http://phenix-online.org/mailman/listinfo/cctbxbb
participants (3)
-
Ian Rees
-
Nathaniel Echols
-
Oliver Zeldin