[yt-svn] commit/yt: xarthisius: Merged in ngoldbaum/yt (pull request #2038)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Mar 16 09:30:15 PDT 2016
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/8ff092a25522/
Changeset: 8ff092a25522
Branch: yt
User: xarthisius
Date: 2016-03-16 16:30:08+00:00
Summary: Merged in ngoldbaum/yt (pull request #2038)
Make `ds.field_list` sorted by default.
Affected #: 1 file
diff -r 14ef9ac4f402fe9d0ce249c001683cd6b87a5643 -r 8ff092a255228afab7cb3bef05cc12484a57fcd3 yt/data_objects/static_output.py
--- a/yt/data_objects/static_output.py
+++ b/yt/data_objects/static_output.py
@@ -451,6 +451,7 @@
deps, unloaded = self.field_info.check_derived_fields()
self.field_dependencies.update(deps)
self.fields = FieldTypeContainer(self)
+ self.index.field_list = sorted(self.field_list)
def setup_deprecated_fields(self):
from yt.fields.field_aliases import _field_name_aliases
@@ -520,7 +521,10 @@
self.particle_types += (union.name,)
self.particle_unions[union.name] = union
fields = [ (union.name, field) for field in fields]
- self.field_list.extend(fields)
+ new_fields = [_ for _ in fields if _ not in self.field_list]
+ self.field_list.extend(new_fields)
+ self.field_info.field_list.extend(new_fields)
+ self.index.field_list = sorted(self.field_list)
# Give ourselves a chance to add them here, first, then...
# ...if we can't find them, we set them up as defaults.
new_fields = self._setup_particle_types([union.name])
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