[Yt-svn] commit/yt: 3 new changesets

Bitbucket commits-noreply at bitbucket.org
Wed Jun 8 10:30:50 PDT 2011


3 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/e43dd7f473db/
changeset:   e43dd7f473db
branch:      yt
user:        MatthewTurk
date:        2011-06-08 18:38:40
summary:     Make error handling in _MPL be a bit more graceful in Pixelize
affected #:  1 file (7 bytes)

--- a/yt/visualization/_MPL.c	Wed Jun 08 11:55:03 2011 -0400
+++ b/yt/visualization/_MPL.c	Wed Jun 08 09:38:40 2011 -0700
@@ -52,7 +52,9 @@
 static PyObject* Py_Pixelize(PyObject *obj, PyObject *args) {
 
   PyObject *xp, *yp, *dxp, *dyp, *dp;
+  PyArrayObject *x, *y, *dx, *dy, *d;
   xp = yp = dxp = dyp = dp = NULL;
+  x = y = dx = dy = d = NULL;
   unsigned int rows, cols;
   int antialias = 1;
   double x_min, x_max, y_min, y_max;
@@ -78,34 +80,34 @@
       PyErr_Format( _pixelizeError, "Cannot scale to zero size.");
 
   // Get numeric arrays
-  PyArrayObject *x = (PyArrayObject *) PyArray_FromAny(xp,
+  x = (PyArrayObject *) PyArray_FromAny(xp,
             PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
   if (x == NULL) {
       PyErr_Format( _pixelizeError, "x is of incorrect type (wanted 1D float)");
       goto _fail;
   }
 
-  PyArrayObject *y = (PyArrayObject *) PyArray_FromAny(yp,
+  y = (PyArrayObject *) PyArray_FromAny(yp,
             PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
   if ((y == NULL) || (PyArray_SIZE(y) != PyArray_SIZE(x))) {
       PyErr_Format( _pixelizeError, "y is of incorrect type (wanted 1D float)");
       goto _fail;
   }
 
-  PyArrayObject *d = (PyArrayObject *) PyArray_FromAny(dp,
+  d = (PyArrayObject *) PyArray_FromAny(dp,
             PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
   if ((d == NULL) || (PyArray_SIZE(d) != PyArray_SIZE(x))) {
       PyErr_Format( _pixelizeError, "data is of incorrect type (wanted 1D float)");
       goto _fail;
   }
 
-  PyArrayObject *dx = (PyArrayObject *) PyArray_FromAny(dxp,
+  dx = (PyArrayObject *) PyArray_FromAny(dxp,
             PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
   if ((dx == NULL) || (PyArray_SIZE(dx) != PyArray_SIZE(x))) {
       PyErr_Format( _pixelizeError, "dx is of incorrect type (wanted 1D float)");
       goto _fail;
   }
-  PyArrayObject *dy = (PyArrayObject *) PyArray_FromAny(dyp,
+  dy = (PyArrayObject *) PyArray_FromAny(dyp,
             PyArray_DescrFromType(NPY_FLOAT64), 1, 1, 0, NULL);
   if ((dy == NULL) || (PyArray_SIZE(dy) != PyArray_SIZE(x))) {
       PyErr_Format( _pixelizeError, "dy is of incorrect type (wanted 1D float)");


http://bitbucket.org/yt_analysis/yt/changeset/6ebb7e954049/
changeset:   6ebb7e954049
branch:      yt
user:        MatthewTurk
date:        2011-06-08 19:27:39
summary:     Merging
affected #:  1 file (124 bytes)

--- a/yt/frontends/ramses/data_structures.py	Wed Jun 08 09:38:40 2011 -0700
+++ b/yt/frontends/ramses/data_structures.py	Wed Jun 08 10:27:39 2011 -0700
@@ -34,7 +34,10 @@
       AMRHierarchy
 from yt.data_objects.static_output import \
       StaticOutput
-import _ramses_reader
+try:
+    import _ramses_reader
+except ImportError:
+    _ramses_reader = None
 from .fields import RAMSESFieldContainer
 from yt.utilities.definitions import \
     mpc_conversion
@@ -269,6 +272,8 @@
     
     def __init__(self, filename, data_style='ramses',
                  storage_filename = None):
+        if _ramses_reader is None:
+            import _ramses_reader
         StaticOutput.__init__(self, filename, data_style)
         self.storage_filename = storage_filename
 


http://bitbucket.org/yt_analysis/yt/changeset/749ce1a696de/
changeset:   749ce1a696de
branch:      yt
user:        MatthewTurk
date:        2011-06-08 19:30:38
summary:     Adding same silent-failure for ART as for Ramses.
affected #:  1 file (162 bytes)

--- a/yt/frontends/art/data_structures.py	Wed Jun 08 10:27:39 2011 -0700
+++ b/yt/frontends/art/data_structures.py	Wed Jun 08 10:30:38 2011 -0700
@@ -45,7 +45,10 @@
     io_registry
 import yt.utilities.amr_utils as amr_utils
 
-import yt.frontends.ramses._ramses_reader as _ramses_reader
+try:
+    import yt.frontends.ramses._ramses_reader as _ramses_reader
+except ImportError:
+    _ramses_reader = None
 
 from yt.utilities.physical_constants import \
     mass_hydrogen_cgs
@@ -373,6 +376,8 @@
     
     def __init__(self, filename, data_style='art',
                  storage_filename = None):
+        if _ramses_reader is None:
+            import yt.frontends.ramses._ramses_reader as _ramses_reader
         StaticOutput.__init__(self, filename, data_style)
         self.storage_filename = storage_filename

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list