[yt-svn] commit/yt: ngoldbaum: Fixing set_axes_unit. Closes #534.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Mar 22 14:56:11 PDT 2013


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/7a62187ba23c/
Changeset:   7a62187ba23c
Branch:      yt
User:        ngoldbaum
Date:        2013-03-22 22:41:20
Summary:     Fixing set_axes_unit.  Closes #534.
Affected #:  2 files

diff -r 592dbaec8a44664b878b286a23a14095ce1b694e -r 7a62187ba23c171db740b23d0f44169e264283d7 yt/utilities/definitions.py
--- a/yt/utilities/definitions.py
+++ b/yt/utilities/definitions.py
@@ -48,7 +48,8 @@
 y_names = ['z','z','y']
 
 # How many of each thing are in an Mpc
-mpc_conversion = {'mpc'   : mpc_per_mpc,
+mpc_conversion = {'Mpc'   : mpc_per_mpc,
+                  'mpc'   : mpc_per_mpc,
                   'kpc'   : kpc_per_mpc,
                   'pc'    : pc_per_mpc,
                   'au'    : au_per_mpc,
@@ -56,7 +57,7 @@
                   'miles' : miles_per_mpc,
                   'cm'    : cm_per_mpc}
 
-# How many seconds are in each thig
+# How many seconds are in each thing
 sec_conversion = {'Gyr'   : sec_per_Gyr,
                   'Myr'   : sec_per_Myr,
                   'years' : sec_per_year,

diff -r 592dbaec8a44664b878b286a23a14095ce1b694e -r 7a62187ba23c171db740b23d0f44169e264283d7 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -65,6 +65,7 @@
     ortho_find
 from yt.utilities.parallel_tools.parallel_analysis_interface import \
     GroupOwnership
+from yt.utilities.exceptions import YTUnitNotRecognized
 from yt.data_objects.time_series import \
     TimeSeriesData
 
@@ -726,6 +727,8 @@
         """
         # blind except because it could be in conversion_factors or units
         if unit_name is not None:
+            if isinstance(unit_name, str):
+                unit_name = (unit_name, unit_name)
             for un in unit_name:
                 try:
                     self.pf[un]

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