[Yt-svn] yt-commit r1666 - trunk/yt

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Wed Mar 17 12:49:22 PDT 2010


Author: mturk
Date: Wed Mar 17 12:49:21 2010
New Revision: 1666
URL: http://yt.enzotools.org/changeset/1666

Log:
Forgot to add the exceptions module



Added:
   trunk/yt/exceptions.py

Added: trunk/yt/exceptions.py
==============================================================================
--- (empty file)
+++ trunk/yt/exceptions.py	Wed Mar 17 12:49:21 2010
@@ -0,0 +1,43 @@
+"""
+This is a library of yt-defined exceptions
+
+Author: Matthew Turk <matthewturk at gmail.com>
+Affiliation: KIPAC/SLAC/Stanford
+Homepage: http://yt.enzotools.org/
+License:
+  Copyright (C) 2009 Matthew Turk.  All Rights Reserved.
+
+  This file is part of yt.
+
+  yt is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+"""
+
+# We don't need to import 'exceptions'
+#import exceptions
+
+class YTException(Exception):
+    def __init__(self, pf = None):
+        Exception.__init__(self)
+        self.pf = pf
+
+# Data access exceptions:
+
+class YTSphereTooSmall(YTException):
+    def __init__(self, pf, radius, smallest_cell):
+        YTException.__init__(self, pf)
+        self.radius = radius
+        self.smallest_cell = smallest_cell
+
+    def __str__(self):
+        return "%0.5e < %0.5e" % (self.radius, self.smallest_cell)



More information about the yt-svn mailing list