[yt-svn] commit/yt: MatthewTurk: Fix lextra and extra in ART frontend.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Nov 19 10:39:32 PST 2015


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/f0e05114dfdc/
Changeset:   f0e05114dfdc
Branch:      yt
User:        MatthewTurk
Date:        2015-11-19 03:25:16+00:00
Summary:     Fix lextra and extra in ART frontend.
Affected #:  1 file

diff -r 90f900be7a36433fdd48941cae4bc91066ff5c76 -r f0e05114dfdc9a068d78373311336b5f6fa14578 yt/frontends/art/data_structures.py
--- a/yt/frontends/art/data_structures.py
+++ b/yt/frontends/art/data_structures.py
@@ -293,6 +293,11 @@
                                      self.root_ncells)
             self.iOctFree, self.nOct = fpu.read_vector(f, 'i', '>')
             self.child_grid_offset = f.tell()
+            # lextra needs to be loaded as a string, but it's actually
+            # array values.  So pop it off here, and then re-insert.
+            lextra = amr_header_vals.pop("lextra")
+            amr_header_vals['lextra'] = np.fromstring(
+                lextra, '>f4')
             self.parameters.update(amr_header_vals)
             amr_header_vals = None
             # estimate the root level
@@ -314,6 +319,11 @@
                 n = particle_header_vals['Nspecies']
                 wspecies = np.fromfile(fh, dtype='>f', count=10)
                 lspecies = np.fromfile(fh, dtype='>i', count=10)
+                # extras needs to be loaded as a string, but it's actually
+                # array values.  So pop it off here, and then re-insert.
+                extras = particle_header_vals.pop("extras")
+                particle_header_vals['extras'] = np.fromstring(
+                    extras, '>f4')
             self.parameters['wspecies'] = wspecies[:n]
             self.parameters['lspecies'] = lspecies[:n]
             for specie in range(n):

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