Commits

John ZuHone committed 787cf88

Decided to move this to StreamHierarchy. It now loops over all grids in the hierarchy.

  • Participants
  • Parent commits 22db916

Comments (0)

Files changed (2)

File yt/frontends/stream/data_structures.py

         else:
             self.io = io_registry[self.data_style](self.stream_handler)
 
+    def update_data(self, data) :
+
+        for key in data[0].keys() :
+
+            if key not in self.field_list: self.field_list.append(key)
+            
+        for i, grid in enumerate(self.grids) :
+            
+            for key in data[i].keys() :
+
+                self.stream_handler.fields[grid.id][key] = data[i][key]
+
+        self._detect_fields()
+        
 class StreamStaticOutput(StaticOutput):
     _hierarchy_class = StreamHierarchy
     _fieldinfo_fallback = StreamFieldInfo

File yt/frontends/stream/io.py

         # In-place unit conversion requires we return a copy
         return tr.copy()
 
-    def update_data(self, grid, data) :
-
-        for key in data.keys() :
-            
-            self.fields[grid.id][key] = data[key]
-                        
     @property
     def _read_exception(self):
         return KeyError