[yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Oct 30 12:18:44 PDT 2012
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/changeset/f77b0a03975d/
changeset: f77b0a03975d
branch: yt
user: chiffre
date: 2012-10-30 19:58:19
summary: Added a if-sequence for units
affected #: 1 file
diff -r 5736bc9e7f29ccc6b997a4e18a9bb8aac55d46c7 -r f77b0a03975db973274ca3aeccc7765b840f45c4 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -783,10 +783,11 @@
except ParseFatalException, err:
raise YTCannotParseFieldDisplayName(f,field_name,str(err))
- try:
- parser.parse(r'$'+md['units']+r'$')
- except ParseFatalException, err:
- raise YTCannotParseUnitDisplayName(f, md['units'],str(err))
+ if md['units'] != None and md['units'] != '':
+ try:
+ parser.parse(r'$'+md['units']+r'$')
+ except ParseFatalException, err:
+ raise YTCannotParseUnitDisplayName(f, md['units'],str(err))
if md['units'] == None or md['units'] == '':
label = field_name
https://bitbucket.org/yt_analysis/yt/changeset/8db15e870d38/
changeset: 8db15e870d38
branch: yt
user: chiffre
date: 2012-10-30 20:15:50
summary: Combined if-statement
affected #: 1 file
diff -r f77b0a03975db973274ca3aeccc7765b840f45c4 -r 8db15e870d38beaf2ee597db41f076dc0b946aa4 yt/visualization/plot_window.py
--- a/yt/visualization/plot_window.py
+++ b/yt/visualization/plot_window.py
@@ -783,15 +783,13 @@
except ParseFatalException, err:
raise YTCannotParseFieldDisplayName(f,field_name,str(err))
- if md['units'] != None and md['units'] != '':
+ if md['units'] == None or md['units'] == '':
+ label = field_name
+ else:
try:
parser.parse(r'$'+md['units']+r'$')
except ParseFatalException, err:
raise YTCannotParseUnitDisplayName(f, md['units'],str(err))
-
- if md['units'] == None or md['units'] == '':
- label = field_name
- else:
label = field_name+r'$\/\/('+md['units']+r')$'
self.plots[f].cb.set_label(label)
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