[yt-svn] commit/yt: ngoldbaum: Ensuring that prefix is set for PhasePlot.save
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon May 12 16:51:13 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/849ef318fc59/
Changeset: 849ef318fc59
Branch: yt-3.0
User: ngoldbaum
Date: 2014-05-13 01:50:07
Summary: Ensuring that prefix is set for PhasePlot.save
Affected #: 1 file
diff -r 80b6a3399f45da6e13828a947813cbe0e057f63d -r 849ef318fc593409bd3c7c3cf646e9b9eccf8af8 yt/visualization/profile_plotter.py
--- a/yt/visualization/profile_plotter.py
+++ b/yt/visualization/profile_plotter.py
@@ -761,12 +761,15 @@
if isinstance(f, types.TupleType):
_f = _f[1]
middle = "2d-Profile_%s_%s_%s" % (xfn, yfn, _f)
+ if name[-1] == os.sep and not os.path.isdir(name):
+ os.mkdir(name)
if name is None:
prefix = self.profile.pf
- if name[-1] == os.sep and not os.path.isdir(name):
- os.mkdir(name)
- if os.path.isdir(name) and name != str(self.pf):
- prefix = name + (os.sep if name[-1] != os.sep else '') + str(self.pf)
+ elif os.path.isdir(name) and name != str(self.profile.pf):
+ prefix = name + (os.sep if name[-1] != os.sep else '')
+ prefix += str(self.profile.pf)
+ else:
+ prefix = name
suffix = get_image_suffix(name)
if suffix != '':
for k, v in self.plots.iteritems():
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