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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Apr 23 06:05:36 PDT 2014


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/51fbd0cd8688/
Changeset:   51fbd0cd8688
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-04-17 16:07:06
Summary:     First pass at migrating our answer tests to rackspace.

Note that we replaced boto with pyrax, and the authentication system is
somewhat different.
Affected #:  1 file

diff -r 85aed0cda09466c9635c6539e36f8bd972ac0eaa -r 51fbd0cd86884de85a8b9c552fee5b909181ef44 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -45,7 +45,7 @@
 # Set the latest gold and local standard filenames
 _latest = ytcfg.get("yt", "gold_standard_filename")
 _latest_local = ytcfg.get("yt", "local_standard_filename")
-_url_path = "http://yt-answer-tests.s3-website-us-east-1.amazonaws.com/%s_%s"
+_url_path = "http://answers.yt-project.org/%s_%s"
 
 class AnswerTesting(Plugin):
     name = "answer-testing"
@@ -197,30 +197,20 @@
         if self.answer_name is None: return
         # This is where we dump our result storage up to Amazon, if we are able
         # to.
-        import boto
-        from boto.s3.key import Key
-        c = boto.connect_s3()
-        bucket = c.get_bucket("yt-answer-tests")
-        for pf_name in result_storage:
+        import pyrax
+        pyrax.set_credential_file(os.path.expanduser("~/.yt/rackspace"))
+        cf = pyrax.cloudfiles
+        c = cf.get_container("yt-answer-tests")
+        pb = get_pbar("Storing results ", len(result_storage))
+        for i, pf_name in enumerate(result_storage):
+            pb.update(i)
             rs = cPickle.dumps(result_storage[pf_name])
-            tk = bucket.get_key("%s_%s" % (self.answer_name, pf_name))
-            if tk is not None: tk.delete()
-            k = Key(bucket)
-            k.key = "%s_%s" % (self.answer_name, pf_name)
-
-            pb_widgets = [
-                unicode(k.key, errors='ignore').encode('utf-8'), ' ',
-                progressbar.FileTransferSpeed(),' <<<', progressbar.Bar(),
-                '>>> ', progressbar.Percentage(), ' ', progressbar.ETA()
-                ]
-            self.pbar = progressbar.ProgressBar(widgets=pb_widgets,
-                                                maxval=sys.getsizeof(rs))
-
-            self.pbar.start()
-            k.set_contents_from_string(rs, cb=self.progress_callback,
-                                       num_cb=100000)
-            k.set_acl("public-read")
-            self.pbar.finish()
+            object_name = "%s_%s" % (self.answer_name, pf_name)
+            if object_name in c.get_object_names():
+                obj = c.get_object(object_name)
+                c.delete_object(obj)
+            c.store_object(object_name, rs)
+        pb.finish()
 
 class AnswerTestLocalStorage(AnswerTestStorage):
     def dump(self, result_storage):


https://bitbucket.org/yt_analysis/yt/commits/5dfee8934f7a/
Changeset:   5dfee8934f7a
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-04-17 17:05:54
Summary:     Disable the CNAME path for now.
Affected #:  1 file

diff -r 51fbd0cd86884de85a8b9c552fee5b909181ef44 -r 5dfee8934f7afa8299179bde64b93935d9926a59 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -45,7 +45,8 @@
 # Set the latest gold and local standard filenames
 _latest = ytcfg.get("yt", "gold_standard_filename")
 _latest_local = ytcfg.get("yt", "local_standard_filename")
-_url_path = "http://answers.yt-project.org/%s_%s"
+#_url_path = "http://answers.yt-project.org/%s_%s"
+_url_path = "http://9d88c2cd8f0c0116ea28-349fe2bf24015151662504826db38f8b.r35.cf5.rackcdn.com/%s_%s"
 
 class AnswerTesting(Plugin):
     name = "answer-testing"


https://bitbucket.org/yt_analysis/yt/commits/b31211a9189c/
Changeset:   b31211a9189c
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-04-17 17:07:15
Summary:     Switch out the URL for a config option.
Affected #:  2 files

diff -r 5dfee8934f7afa8299179bde64b93935d9926a59 -r b31211a9189ce5f31df667c04188e7f57a6cffae yt/config.py
--- a/yt/config.py
+++ b/yt/config.py
@@ -53,6 +53,7 @@
     answer_testing_bitwise = 'False',
     gold_standard_filename = 'gold311',
     local_standard_filename = 'local001',
+    answer_tests_url = 'http://9d88c2cd8f0c0116ea28-349fe2bf24015151662504826db38f8b.r35.cf5.rackcdn.com/%s_%s',
     sketchfab_api_key = 'None',
     thread_field_detection = 'False',
     ignore_invalid_unit_operation_errors = 'False'

diff -r 5dfee8934f7afa8299179bde64b93935d9926a59 -r b31211a9189ce5f31df667c04188e7f57a6cffae yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -45,8 +45,7 @@
 # Set the latest gold and local standard filenames
 _latest = ytcfg.get("yt", "gold_standard_filename")
 _latest_local = ytcfg.get("yt", "local_standard_filename")
-#_url_path = "http://answers.yt-project.org/%s_%s"
-_url_path = "http://9d88c2cd8f0c0116ea28-349fe2bf24015151662504826db38f8b.r35.cf5.rackcdn.com/%s_%s"
+_url_path = ytcfg.get("yt", "answer_tests_url")
 
 class AnswerTesting(Plugin):
     name = "answer-testing"


https://bitbucket.org/yt_analysis/yt/commits/8edc68fd2c7d/
Changeset:   8edc68fd2c7d
Branch:      yt-3.0
User:        MatthewTurk
Date:        2014-04-23 14:03:19
Summary:     Switching back to answers.yt-project.org.
Affected #:  1 file

diff -r b31211a9189ce5f31df667c04188e7f57a6cffae -r 8edc68fd2c7d72c3e7ac16b90eb5dc75538a4ea5 yt/config.py
--- a/yt/config.py
+++ b/yt/config.py
@@ -53,7 +53,7 @@
     answer_testing_bitwise = 'False',
     gold_standard_filename = 'gold311',
     local_standard_filename = 'local001',
-    answer_tests_url = 'http://9d88c2cd8f0c0116ea28-349fe2bf24015151662504826db38f8b.r35.cf5.rackcdn.com/%s_%s',
+    answer_tests_url = 'http://answers.yt-project.org/%s_%s',
     sketchfab_api_key = 'None',
     thread_field_detection = 'False',
     ignore_invalid_unit_operation_errors = 'False'


https://bitbucket.org/yt_analysis/yt/commits/f0dcca6509b7/
Changeset:   f0dcca6509b7
Branch:      yt-3.0
User:        xarthisius
Date:        2014-04-23 15:05:28
Summary:     Merged in MatthewTurk/yt/yt-3.0 (pull request #832)

First pass at migrating our answer tests to rackspace.
Affected #:  2 files

diff -r 1fb43c387d932803cba2505a859eafe1a063e2c8 -r f0dcca6509b72331853fd900470a8ed10275cd62 yt/config.py
--- a/yt/config.py
+++ b/yt/config.py
@@ -53,6 +53,7 @@
     answer_testing_bitwise = 'False',
     gold_standard_filename = 'gold311',
     local_standard_filename = 'local001',
+    answer_tests_url = 'http://answers.yt-project.org/%s_%s',
     sketchfab_api_key = 'None',
     thread_field_detection = 'False',
     ignore_invalid_unit_operation_errors = 'False'

diff -r 1fb43c387d932803cba2505a859eafe1a063e2c8 -r f0dcca6509b72331853fd900470a8ed10275cd62 yt/utilities/answer_testing/framework.py
--- a/yt/utilities/answer_testing/framework.py
+++ b/yt/utilities/answer_testing/framework.py
@@ -45,7 +45,7 @@
 # Set the latest gold and local standard filenames
 _latest = ytcfg.get("yt", "gold_standard_filename")
 _latest_local = ytcfg.get("yt", "local_standard_filename")
-_url_path = "http://yt-answer-tests.s3-website-us-east-1.amazonaws.com/%s_%s"
+_url_path = ytcfg.get("yt", "answer_tests_url")
 
 class AnswerTesting(Plugin):
     name = "answer-testing"
@@ -197,30 +197,20 @@
         if self.answer_name is None: return
         # This is where we dump our result storage up to Amazon, if we are able
         # to.
-        import boto
-        from boto.s3.key import Key
-        c = boto.connect_s3()
-        bucket = c.get_bucket("yt-answer-tests")
-        for pf_name in result_storage:
+        import pyrax
+        pyrax.set_credential_file(os.path.expanduser("~/.yt/rackspace"))
+        cf = pyrax.cloudfiles
+        c = cf.get_container("yt-answer-tests")
+        pb = get_pbar("Storing results ", len(result_storage))
+        for i, pf_name in enumerate(result_storage):
+            pb.update(i)
             rs = cPickle.dumps(result_storage[pf_name])
-            tk = bucket.get_key("%s_%s" % (self.answer_name, pf_name))
-            if tk is not None: tk.delete()
-            k = Key(bucket)
-            k.key = "%s_%s" % (self.answer_name, pf_name)
-
-            pb_widgets = [
-                unicode(k.key, errors='ignore').encode('utf-8'), ' ',
-                progressbar.FileTransferSpeed(),' <<<', progressbar.Bar(),
-                '>>> ', progressbar.Percentage(), ' ', progressbar.ETA()
-                ]
-            self.pbar = progressbar.ProgressBar(widgets=pb_widgets,
-                                                maxval=sys.getsizeof(rs))
-
-            self.pbar.start()
-            k.set_contents_from_string(rs, cb=self.progress_callback,
-                                       num_cb=100000)
-            k.set_acl("public-read")
-            self.pbar.finish()
+            object_name = "%s_%s" % (self.answer_name, pf_name)
+            if object_name in c.get_object_names():
+                obj = c.get_object(object_name)
+                c.delete_object(obj)
+            c.store_object(object_name, rs)
+        pb.finish()
 
 class AnswerTestLocalStorage(AnswerTestStorage):
     def dump(self, result_storage):

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