[yt-svn] commit/yt: MatthewTurk: Merged in ngoldbaum/yt (pull request #2559)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Mar 27 12:08:26 PDT 2017


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/e265191afc16/
Changeset:   e265191afc16
Branch:      yt
User:        MatthewTurk
Date:        2017-03-27 19:08:20+00:00
Summary:     Merged in ngoldbaum/yt (pull request #2559)

Ensure inferring field names is deterministic

Approved-by: Matt Turk <matthewturk at gmail.com>
Affected #:  2 files

diff -r 07a9a1ec3496b1b859bb8a3dcc0cf6ab9aefd3c3 -r e265191afc164152ef482e861826d6dc877e6893 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -567,6 +567,7 @@
         self.field_dependencies.update(deps)
         self.fields = FieldTypeContainer(self)
         self.index.field_list = sorted(self.field_list)
+        self._last_freq = (None, None)
 
     def setup_deprecated_fields(self):
         from yt.fields.field_aliases import _field_name_aliases

diff -r 07a9a1ec3496b1b859bb8a3dcc0cf6ab9aefd3c3 -r e265191afc164152ef482e861826d6dc877e6893 yt/fields/tests/test_fields.py
--- a/yt/fields/tests/test_fields.py
+++ b/yt/fields/tests/test_fields.py
@@ -317,3 +317,11 @@
     a1 = np.argsort(mi)
     a2 = np.argsort(mi2)
     assert_array_equal(a1, a2)
+
+
+def test_field_inference():
+    ds = fake_random_ds(16)
+    ds.index
+    # If this is not true this means the result of field inference depends
+    # on the order we did field detection, which is random in Python3
+    assert_equal(ds._last_freq, (None, None))

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