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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 9 11:14:29 PST 2015


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/633b94462530/
Changeset:   633b94462530
Branch:      yt
User:        ngoldbaum
Date:        2015-11-02 22:31:33+00:00
Summary:     Fix issues with loading tipsy files in python3
Affected #:  1 file

diff -r f264885c3fb49044ba653bf1b29e2eb46e99db24 -r 633b944625307dc76fea56881c5c4324204ace29 yt/frontends/tipsy/io.py
--- a/yt/frontends/tipsy/io.py
+++ b/yt/frontends/tipsy/io.py
@@ -241,7 +241,7 @@
 
     def _initialize_index(self, data_file, regions):
         ds = data_file.ds
-        morton = np.empty(sum(data_file.total_particles.values()),
+        morton = np.empty(sum(list(data_file.total_particles.values())),
                           dtype="uint64")
         ind = 0
         DLE, DRE = ds.domain_left_edge, ds.domain_right_edge
@@ -318,7 +318,7 @@
             self._field_list.append((ptype, field))
 
         # Find out which auxiliaries we have and what is their format
-        tot_parts = np.sum(data_file.total_particles.values())
+        tot_parts = np.sum(list(data_file.total_particles.values()))
         endian = data_file.ds.endian
         self._aux_pdtypes = {}
         self._aux_fields = [f.rsplit('.')[-1]
@@ -332,8 +332,9 @@
             filesize = os.stat(filename).st_size
             if np.fromfile(filename, np.dtype(endian + 'i4'),
                            count=1) != tot_parts:
-                with open(filename) as f:
-                    if int(f.readline()) != tot_parts:
+                with open(filename, 'rb') as f:
+                    header_nparts = f.readline()
+                    if int(header_nparts) != tot_parts:
                         raise RuntimeError
                 self._aux_pdtypes[afield] = "ascii"
             elif (filesize - 4) / 8 == tot_parts:


https://bitbucket.org/yt_analysis/yt/commits/8695789ff8e3/
Changeset:   8695789ff8e3
Branch:      yt
User:        ngoldbaum
Date:        2015-11-09 19:14:23+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1842)

Fix issues with loading tipsy files in python3
Affected #:  1 file

diff -r 7e0882aabe367104e53e790c732ede84d4c9ab1a -r 8695789ff8e331072dfd65d4d21691d4f30dcdfa yt/frontends/tipsy/io.py
--- a/yt/frontends/tipsy/io.py
+++ b/yt/frontends/tipsy/io.py
@@ -241,7 +241,7 @@
 
     def _initialize_index(self, data_file, regions):
         ds = data_file.ds
-        morton = np.empty(sum(data_file.total_particles.values()),
+        morton = np.empty(sum(list(data_file.total_particles.values())),
                           dtype="uint64")
         ind = 0
         DLE, DRE = ds.domain_left_edge, ds.domain_right_edge
@@ -318,7 +318,7 @@
             self._field_list.append((ptype, field))
 
         # Find out which auxiliaries we have and what is their format
-        tot_parts = np.sum(data_file.total_particles.values())
+        tot_parts = np.sum(list(data_file.total_particles.values()))
         endian = data_file.ds.endian
         self._aux_pdtypes = {}
         self._aux_fields = [f.rsplit('.')[-1]
@@ -332,8 +332,9 @@
             filesize = os.stat(filename).st_size
             if np.fromfile(filename, np.dtype(endian + 'i4'),
                            count=1) != tot_parts:
-                with open(filename) as f:
-                    if int(f.readline()) != tot_parts:
+                with open(filename, 'rb') as f:
+                    header_nparts = f.readline()
+                    if int(header_nparts) != tot_parts:
                         raise RuntimeError
                 self._aux_pdtypes[afield] = "ascii"
             elif (filesize - 4) / 8 == tot_parts:

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