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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Dec 16 17:54:42 PST 2015


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/3e3ac54aed92/
Changeset:   3e3ac54aed92
Branch:      yt
User:        atmyers
Date:        2015-12-17 00:35:20+00:00
Summary:     a version of sanitize_string that works in py3
Affected #:  1 file

diff -r 94620b14f97b4ad1ea497c782128eb2f967998a7 -r 3e3ac54aed921f2fc0c0434c4282a81a8a3f3843 yt/frontends/exodus_ii/util.py
--- a/yt/frontends/exodus_ii/util.py
+++ b/yt/frontends/exodus_ii/util.py
@@ -1,10 +1,12 @@
-import string
+import sys
 from itertools import takewhile
 from collections import OrderedDict
 import re
 
 def sanitize_string(s):
-    return "".join(_ for _ in takewhile(lambda a: a in string.printable, s))
+    if sys.version_info > (3, ):
+        return "".join([chr(_) for _ in takewhile(lambda a: a, s)])
+    return "".join([_ for _ in takewhile(lambda a: a, s)])
 
 def load_info_records(info_records):
     info_records_parsed = [sanitize_string(line_chars) for line_chars in info_records]


https://bitbucket.org/yt_analysis/yt/commits/3c01fa1531ea/
Changeset:   3c01fa1531ea
Branch:      yt
User:        atmyers
Date:        2015-12-17 00:39:09+00:00
Summary:     use the parameter filename as the unique id
Affected #:  2 files

diff -r 3e3ac54aed921f2fc0c0434c4282a81a8a3f3843 -r 3c01fa1531ea55ecb3f41eb72072994d3ac12d6b yt/frontends/exodus_ii/data_structures.py
--- a/yt/frontends/exodus_ii/data_structures.py
+++ b/yt/frontends/exodus_ii/data_structures.py
@@ -158,7 +158,7 @@
             return []
 
     def _get_unique_identifier(self):
-        return self.parameter_filename.__hash__()
+        return self.parameter_filename
 
     def _get_current_time(self):
         try:

diff -r 3e3ac54aed921f2fc0c0434c4282a81a8a3f3843 -r 3c01fa1531ea55ecb3f41eb72072994d3ac12d6b yt/frontends/exodus_ii/tests/test_outputs.py
--- a/yt/frontends/exodus_ii/tests/test_outputs.py
+++ b/yt/frontends/exodus_ii/tests/test_outputs.py
@@ -28,7 +28,6 @@
     ds = data_dir_load(out)
     yield assert_equal, str(ds), "out.e"
     yield assert_equal, ds.dimensionality, 3
-    yield assert_equal, ds.unique_identifier, 5081193338833632556
     yield assert_equal, ds.current_time, 0.0
     yield assert_array_equal, ds.parameters['nod_names'], ['convected', 'diffused']
     yield assert_equal, ds.parameters['num_meshes'], 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