[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed May 3 11:53:13 PDT 2017


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/9faf2e72b209/
Changeset:   9faf2e72b209
User:        ngoldbaum
Date:        2017-05-02 19:30:18+00:00
Summary:     [BUG] fix I/O for enzo Dark_Matter_Density field. Closes #1359

Rather than returning None, we need to return an array filled with zeros. If we
don't do this then arrays with partially uninitialized data can find their way
back to the user.
Affected #:  1 file

diff -r 8f01bbe64d90b35ea7d65e2918791cdbec362ccb -r 9faf2e72b2092e0bb370a793652d09b6c94c52c8 yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -151,7 +151,9 @@
             node = "/Grid%08i/%s" % (obj.id, fname)
             dg = h5py.h5d.open(fid, b(node))
         except KeyError:
-            if fname == "Dark_Matter_Density": return None
+            if fname == "Dark_Matter_Density":
+                data[:] = 0
+                return data.T
             raise
         dg.read(h5py.h5s.ALL, h5py.h5s.ALL, data)
         # I don't know why, but on some installations of h5py this works, but


https://bitbucket.org/yt_analysis/yt/commits/b7d2eda68cec/
Changeset:   b7d2eda68cec
User:        ngoldbaum
Date:        2017-05-03 18:53:00+00:00
Summary:     Merge pull request #1360 from ngoldbaum/dmd-io-fix

[BUG] fix I/O for enzo Dark_Matter_Density field. Closes #1359
Affected #:  1 file

diff -r 1da4a169ce6e44d59d643b8704bc6ffa11db5600 -r b7d2eda68cece815b0332beb2aa42851b23f2dc4 yt/frontends/enzo/io.py
--- a/yt/frontends/enzo/io.py
+++ b/yt/frontends/enzo/io.py
@@ -151,7 +151,9 @@
             node = "/Grid%08i/%s" % (obj.id, fname)
             dg = h5py.h5d.open(fid, b(node))
         except KeyError:
-            if fname == "Dark_Matter_Density": return None
+            if fname == "Dark_Matter_Density":
+                data[:] = 0
+                return data.T
             raise
         dg.read(h5py.h5s.ALL, h5py.h5s.ALL, data)
         # I don't know why, but on some installations of h5py this works, but

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