[yt-svn] commit/yt-3.0: MatthewTurk: Add a double-check for Tipsy datasets.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Nov 27 11:06:49 PST 2013


1 new commit in yt-3.0:

https://bitbucket.org/yt_analysis/yt-3.0/commits/d0546b049240/
Changeset:   d0546b049240
Branch:      yt-3.0
User:        MatthewTurk
Date:        2013-11-27 20:06:12
Summary:     Add a double-check for Tipsy datasets.
Affected #:  1 file

diff -r 3ecddcf90d39dcb55ed7bb16cbc28076b326f536 -r d0546b0492408854ce4e133c0c2aed4a5a15ce75 yt/frontends/sph/data_structures.py
--- a/yt/frontends/sph/data_structures.py
+++ b/yt/frontends/sph/data_structures.py
@@ -503,7 +503,19 @@
             self.periodicity = (True, True, True)
         else:
             self.periodicity = (False, False, False)
-
+        tot = sum(self.parameters[ptype] for ptype
+                  in ('nsph', 'ndark', 'nstar'))
+        if tot != self.parameters['nbodies']:
+            print "SOMETHING HAS GONE WRONG.  NBODIES != SUM PARTICLES."
+            print "%s != (%s == %s + %s + %s)" % (
+                self.parameters['nbodies'],
+                tot,
+                self.parameters['nsph'],
+                self.parameters['ndark'],
+                self.parameters['nstar'])
+            print "Often this can be fixed by changing the 'endian' parameter."
+            print "This defaults to '>' but may in fact be '<'."
+            raise RuntimeError
         if self.parameters.get('bComove', True):
             self.cosmological_simulation = 1
             cosm = self._cosmology_parameters or {}

Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/

--

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