[yt-svn] [yt_analysis/yt] iyt is hard coded to only work with ipython 0.10 or 0.11 and crashes with 0.12 (issue #375)

astrofrog issues-reply at bitbucket.org
Mon Mar 26 07:59:39 PDT 2012


--- you can reply above this line ---

New issue 375: iyt is hard coded to only work with ipython 0.10 or 0.11 and crashes with 0.12
https://bitbucket.org/yt_analysis/yt/issue/375/iyt-is-hard-coded-to-only-work-with

astrofrog on Mon, 26 Mar 2012 16:59:39 +0200:

Description:
  The iyt script raises an exception if the ipython version is not 0.10 or 0.11 (0.12 is out already, and 0.13 is the current dev version):

{{{
Traceback (most recent call last):
  File "/opt/local/bin/iyt-2.7", line 30, in <module>
    if api_version == "0.10" and "DISPLAY" in os.environ:
NameError: name 'api_version' is not defined
}}}

This is due to the following if-statement, which has no else clause:

{{{
if IPython.__version__.startswith("0.10"):
    api_version = '0.10'
elif IPython.__version__.startswith("0.11"):
    api_version = '0.11'
}}}

I think there was an API overhaul in 0.11, but 0.12 and subsequent versions should keep that API, so I think you could add an else:

{{{
else:
    api_version = '0.11'
}}}

This seems to do the trick for me. The reason I came across this is that I am maintaining yt in MacPorts, and ipython in there is already at 0.12, so I am going to have to patch the iyt script as above so that it works.


--

This is an issue notification from bitbucket.org. You are receiving
this either because you are the owner of the issue, or you are
following the issue.



More information about the yt-svn mailing list