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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Sep 24 14:54:14 PDT 2016


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/790361450245/
Changeset:   790361450245
Branch:      yt
User:        brittonsmith
Date:        2016-09-12 15:40:12+00:00
Summary:     Do not take absolute value of redshift for plot modification.
Affected #:  1 file

diff -r c07d12bf5903b40c0c6e65a8ea8f28a82f142e1d -r 790361450245fe682e01e78f614e646b5c462eee yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -1953,7 +1953,7 @@
         # If we're annotating the redshift, put it in the correct format
         if self.redshift:
             try:
-                z = np.abs(plot.data.ds.current_redshift)
+                z = plot.data.ds.current_redshift
             except AttributeError:
                 raise AttributeError("Dataset does not have current_redshift. "
                                      "Set redshift=False.")


https://bitbucket.org/yt_analysis/yt/commits/7ae9ac6884c0/
Changeset:   7ae9ac6884c0
Branch:      yt
User:        brittonsmith
Date:        2016-09-15 10:15:02+00:00
Summary:     Adding regex to convert -0.00 to 0.00.
Affected #:  1 file

diff -r 790361450245fe682e01e78f614e646b5c462eee -r 7ae9ac6884c0c589da175f3724f53d8845d59b99 yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -19,6 +19,7 @@
 
 import matplotlib
 import numpy as np
+import re
 
 from distutils.version import LooseVersion
 from functools import wraps
@@ -1957,7 +1958,10 @@
             except AttributeError:
                 raise AttributeError("Dataset does not have current_redshift. "
                                      "Set redshift=False.")
+            # Replace instances of -0.0* with 0.0* to avoid
+            # negative null redshifts (e.g., "-0.00").
             self.text += self.redshift_format.format(redshift=float(z))
+            self.text = re.sub('-(0.0*)$', "\g<1>", self.text)
 
         # This is just a fancy wrapper around the TextLabelCallback
         tcb = TextLabelCallback(self.pos, self.text,


https://bitbucket.org/yt_analysis/yt/commits/5a08f4cc1af1/
Changeset:   5a08f4cc1af1
Branch:      yt
User:        ngoldbaum
Date:        2016-09-24 21:53:47+00:00
Summary:     Merged in brittonsmith/yt (pull request #2373)

[bugfix] Do not take absolute value of redshift for plot modification.
Affected #:  1 file

diff -r 6d05ffb05f3fbe2295f0fcce5db0b82837b03401 -r 5a08f4cc1af1a18889e0dc93cb3afa908f2d3d2f yt/visualization/plot_modifications.py
--- a/yt/visualization/plot_modifications.py
+++ b/yt/visualization/plot_modifications.py
@@ -19,6 +19,7 @@
 
 import matplotlib
 import numpy as np
+import re
 
 from distutils.version import LooseVersion
 from functools import wraps
@@ -1953,11 +1954,14 @@
         # If we're annotating the redshift, put it in the correct format
         if self.redshift:
             try:
-                z = np.abs(plot.data.ds.current_redshift)
+                z = plot.data.ds.current_redshift
             except AttributeError:
                 raise AttributeError("Dataset does not have current_redshift. "
                                      "Set redshift=False.")
+            # Replace instances of -0.0* with 0.0* to avoid
+            # negative null redshifts (e.g., "-0.00").
             self.text += self.redshift_format.format(redshift=float(z))
+            self.text = re.sub('-(0.0*)$', "\g<1>", self.text)
 
         # This is just a fancy wrapper around the TextLabelCallback
         tcb = TextLabelCallback(self.pos, self.text,

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