[yt-svn] [yt_analysis/yt] deceptive errors after a load(NonExistentFile) (issue #475)

Cameron Hummels issues-reply at bitbucket.org
Mon Dec 10 17:13:27 PST 2012


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

New issue 475: deceptive errors after a load(NonExistentFile)
https://bitbucket.org/yt_analysis/yt/issue/475/deceptive-errors-after-a-load

Cameron Hummels:

When one loads a non-existent file, yt happily does this with no errors.  However, if one tries to use that pf to then set a metric (or something else, presumably), one gets misleading errors.  Example:

from yt.mods import *
pf = load("nonexistentfile")
W = 200./pf['kpc']

This will bail with the error:
  File "test.py", line 3, in <module>
    W = 200./pf['kpc']
  File "/nics/b/home/chummels/src/yt-x86_64/src/yt-hg/yt/data_objects/time_series.py", line 126, in __ge
titem__
    o = self._pre_outputs[key]
TypeError: list indices must be integers, not str

---

Which can be a bit confusing.  Perhaps when a load occurs, yt can make sure this file exists before accepting it?  If not there, throw a YTFileNoExist exception?


--

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