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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Sep 3 10:28:43 PDT 2015


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/d0195bd994ab/
Changeset:   d0195bd994ab
Branch:      yt
User:        ngoldbaum
Date:        2015-08-27 02:06:53+00:00
Summary:     Explicitly implement parallel loop for TimeSeriesData.piter()
Affected #:  1 file

diff -r 580e8d4ccc0ecd2f0d8198307cf0d074b0b735cb -r d0195bd994abaf925063f3d035096e5b310e035d yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -253,8 +253,14 @@
         else:
             if self.parallel == True: njobs = -1
             else: njobs = self.parallel
-        return parallel_objects(self, njobs=njobs, storage=storage,
-                                dynamic=dynamic)
+        for output in parallel_objects(self._pre_outputs, njobs=njobs,
+                                       storage=storage, dynamic=dynamic):
+            if isinstance(output, string_types):
+                ds = load(output, **self.kwargs)
+                self._setup_function(ds)
+                yield ds
+            else:
+                yield output
 
     def eval(self, tasks, obj=None):
         tasks = ensure_list(tasks)


https://bitbucket.org/yt_analysis/yt/commits/4960368a70ab/
Changeset:   4960368a70ab
Branch:      yt
User:        ngoldbaum
Date:        2015-08-27 02:07:09+00:00
Summary:     Use string_types in place of string in time_series.py
Affected #:  1 file

diff -r d0195bd994abaf925063f3d035096e5b310e035d -r 4960368a70abd5ec4f9b0931c7c02cd401a3c408 yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -156,7 +156,7 @@
     def __iter__(self):
         # We can make this fancier, but this works
         for o in self._pre_outputs:
-            if isinstance(o, str):
+            if isinstance(o, string_types):
                 ds = load(o, **self.kwargs)
                 self._setup_function(ds)
                 yield ds
@@ -170,7 +170,7 @@
             # This will return a sliced up object!
             return DatasetSeries(self._pre_outputs[key], self.parallel)
         o = self._pre_outputs[key]
-        if isinstance(o, str):
+        if isinstance(o, string_types):
             o = load(o, **self.kwargs)
             self._setup_function(o)
         return o
@@ -329,13 +329,13 @@
 
         """
         
-        if isinstance(filenames, str):
+        if isinstance(filenames, string_types):
             filenames = get_filenames_from_glob_pattern(filenames)
 
         # This will crash with a less informative error if filenames is not
         # iterable, but the plural keyword should give users a clue...
         for fn in filenames:
-            if not isinstance(fn, str):
+            if not isinstance(fn, string_types):
                 raise YTOutputNotIdentified("DataSeries accepts a list of "
                                             "strings, but "
                                             "received {0}".format(fn))


https://bitbucket.org/yt_analysis/yt/commits/532264c69fce/
Changeset:   532264c69fce
Branch:      yt
User:        ngoldbaum
Date:        2015-08-27 03:41:16+00:00
Summary:     Make piter work correctly when storage is True
Affected #:  1 file

diff -r 4960368a70abd5ec4f9b0931c7c02cd401a3c408 -r 532264c69fceeb464d004e94e861e2cada888c0a yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -255,12 +255,21 @@
             else: njobs = self.parallel
         for output in parallel_objects(self._pre_outputs, njobs=njobs,
                                        storage=storage, dynamic=dynamic):
+            if storage is not None:
+                sto, output = output
+
             if isinstance(output, string_types):
                 ds = load(output, **self.kwargs)
                 self._setup_function(ds)
-                yield ds
             else:
-                yield output
+                ds = output
+
+            if storage is not None:
+                next_ret = (sto, ds)
+            else:
+                next_ret = ds
+
+            yield next_ret
 
     def eval(self, tasks, obj=None):
         tasks = ensure_list(tasks)


https://bitbucket.org/yt_analysis/yt/commits/e98e563f64ea/
Changeset:   e98e563f64ea
Branch:      yt
User:        ngoldbaum
Date:        2015-08-27 03:41:29+00:00
Summary:     Fix minor style issues
Affected #:  1 file

diff -r 532264c69fceeb464d004e94e861e2cada888c0a -r e98e563f64ea87f8d0f6cd35e1d5ba9632128bd8 yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -248,11 +248,14 @@
 
         """
         dynamic = False
-        if self.parallel == False:
+        if self.parallel is False:
             njobs = 1
         else:
-            if self.parallel == True: njobs = -1
-            else: njobs = self.parallel
+            if self.parallel is True:
+                njobs = -1
+            else:
+                njobs = self.parallel
+
         for output in parallel_objects(self._pre_outputs, njobs=njobs,
                                        storage=storage, dynamic=dynamic):
             if storage is not None:


https://bitbucket.org/yt_analysis/yt/commits/a7c319c1f87d/
Changeset:   a7c319c1f87d
Branch:      yt
User:        xarthisius
Date:        2015-09-03 17:28:35+00:00
Summary:     Merged in ngoldbaum/yt (pull request #1727)

Explicitly implement parallel loop for TimeSeriesData.piter()
Affected #:  1 file

diff -r 7d5ab03e0df9cb25e4b5deb94145e610270163f0 -r a7c319c1f87d4b749aa6feb737da504e43a7defb yt/data_objects/time_series.py
--- a/yt/data_objects/time_series.py
+++ b/yt/data_objects/time_series.py
@@ -156,7 +156,7 @@
     def __iter__(self):
         # We can make this fancier, but this works
         for o in self._pre_outputs:
-            if isinstance(o, str):
+            if isinstance(o, string_types):
                 ds = load(o, **self.kwargs)
                 self._setup_function(ds)
                 yield ds
@@ -170,7 +170,7 @@
             # This will return a sliced up object!
             return DatasetSeries(self._pre_outputs[key], self.parallel)
         o = self._pre_outputs[key]
-        if isinstance(o, str):
+        if isinstance(o, string_types):
             o = load(o, **self.kwargs)
             self._setup_function(o)
         return o
@@ -248,13 +248,31 @@
 
         """
         dynamic = False
-        if self.parallel == False:
+        if self.parallel is False:
             njobs = 1
         else:
-            if self.parallel == True: njobs = -1
-            else: njobs = self.parallel
-        return parallel_objects(self, njobs=njobs, storage=storage,
-                                dynamic=dynamic)
+            if self.parallel is True:
+                njobs = -1
+            else:
+                njobs = self.parallel
+
+        for output in parallel_objects(self._pre_outputs, njobs=njobs,
+                                       storage=storage, dynamic=dynamic):
+            if storage is not None:
+                sto, output = output
+
+            if isinstance(output, string_types):
+                ds = load(output, **self.kwargs)
+                self._setup_function(ds)
+            else:
+                ds = output
+
+            if storage is not None:
+                next_ret = (sto, ds)
+            else:
+                next_ret = ds
+
+            yield next_ret
 
     def eval(self, tasks, obj=None):
         tasks = ensure_list(tasks)
@@ -323,13 +341,13 @@
 
         """
         
-        if isinstance(filenames, str):
+        if isinstance(filenames, string_types):
             filenames = get_filenames_from_glob_pattern(filenames)
 
         # This will crash with a less informative error if filenames is not
         # iterable, but the plural keyword should give users a clue...
         for fn in filenames:
-            if not isinstance(fn, str):
+            if not isinstance(fn, string_types):
                 raise YTOutputNotIdentified("DataSeries accepts a list of "
                                             "strings, but "
                                             "received {0}".format(fn))

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