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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jan 31 09:13:28 PST 2018


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/411442acedea/
Changeset:   411442acedea
User:        ngoldbaum
Date:        2017-12-22 16:11:29+00:00
Summary:     attempt to restore support for very old pickle files
Affected #:  1 file

diff -r 603ae9af03a73e3a843d94ba741bde062d98a1eb -r 411442acedeac9723e2179b18626281e483986ac yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -1438,7 +1438,10 @@
         metadata extracted in __reduce__ and then serialized by pickle.
         """
         super(YTArray, self).__setstate__(state[1:])
-        unit, lut = state[0]
+        try:
+            unit, lut = state[0]
+        except TypeError:
+            unit, lut = str(state[0]), default_unit_symbol_lut.copy()
         # need to fix up the lut if the pickle was saved prior to PR #1728
         # when the pickle format changed
         if len(lut['m']) == 2:


https://bitbucket.org/yt_analysis/yt/commits/561451315b43/
Changeset:   561451315b43
User:        ngoldbaum
Date:        2018-01-19 16:16:04+00:00
Summary:     add explanatory comment
Affected #:  1 file

diff -r 411442acedeac9723e2179b18626281e483986ac -r 561451315b430f304e5291288dec0e554f1b78ce yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -1441,6 +1441,9 @@
         try:
             unit, lut = state[0]
         except TypeError:
+            # this case happens when we try to load an old pickle file
+            # created before we serialized the unit symbol lookup table
+            # into the pickle file
             unit, lut = str(state[0]), default_unit_symbol_lut.copy()
         # need to fix up the lut if the pickle was saved prior to PR #1728
         # when the pickle format changed


https://bitbucket.org/yt_analysis/yt/commits/5e1b3f051627/
Changeset:   5e1b3f051627
User:        ngoldbaum
Date:        2018-01-31 17:12:44+00:00
Summary:     Merge pull request #1656 from ngoldbaum/pickle-old-format

attempt to restore support for very old pickle files
Affected #:  1 file

diff -r 1e9af38f22bd4386424f597fabcaf9b2e9a4de8a -r 5e1b3f05162773e0d549a5b4b384803054914b84 yt/units/yt_array.py
--- a/yt/units/yt_array.py
+++ b/yt/units/yt_array.py
@@ -1438,7 +1438,13 @@
         metadata extracted in __reduce__ and then serialized by pickle.
         """
         super(YTArray, self).__setstate__(state[1:])
-        unit, lut = state[0]
+        try:
+            unit, lut = state[0]
+        except TypeError:
+            # this case happens when we try to load an old pickle file
+            # created before we serialized the unit symbol lookup table
+            # into the pickle file
+            unit, lut = str(state[0]), default_unit_symbol_lut.copy()
         # need to fix up the lut if the pickle was saved prior to PR #1728
         # when the pickle format changed
         if len(lut['m']) == 2:

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