[yt-svn] commit/yt: MatthewTurk: Critical bug fix for fi changing size during iteration.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Dec 4 07:53:38 PST 2013


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/9537359f38e2/
Changeset:   9537359f38e2
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-12-04 16:53:16
Summary:     Critical bug fix for fi changing size during iteration.

This will fix behavior where the field_info dict changes size during iteration,
thus preventing "all" fields from being added in particle unions.
Affected #:  1 file

diff -r 24ea43ae2c7c9f70b35c5d13ee885a249d54d5ea -r 9537359f38e2c9f5245e7342bf0de2185e522f37 yt/geometry/geometry_handler.py
--- a/yt/geometry/geometry_handler.py
+++ b/yt/geometry/geometry_handler.py
@@ -252,6 +252,7 @@
         fi = self.parameter_file.field_info
         # First we construct our list of fields to check
         fields_to_check = []
+        fi_update = {}
         for field in fi:
             finfo = fi[field]
             # Explicitly defined
@@ -268,9 +269,11 @@
             for pt in self.parameter_file.particle_types:
                 new_fi = copy.copy(finfo)
                 new_fi.name = (pt, new_fi.name)
-                fi[new_fi.name] = new_fi
+                fi_update[new_fi.name] = new_fi
                 new_fields.append(new_fi.name)
             fields_to_check += new_fields
+        for field in fi_update:
+            fi[field] = fi_update[field]
         return fields_to_check
 
     def _derived_fields_add(self, fields_to_check = None):

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