[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Sep 5 17:26:57 PDT 2013
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/712eb7af5ff1/
Changeset: 712eb7af5ff1
Branch: yt
User: MatthewTurk
Date: 2013-09-06 02:03:17
Summary: This adds output for when --max or --min is not specified.
Closes #648 .
Affected #: 1 file
diff -r 994425eb17ef80372efb8f63e73be209f9a0edb9 -r 712eb7af5ff156e2d4754ffd6757429ba8c6411f yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1589,17 +1589,26 @@
def __call__(self, args):
pf = args.pf
pf.h.print_stats()
+ vals = {}
if args.field in pf.h.derived_field_list:
if args.max == True:
- v, c = pf.h.find_max(args.field)
- print "Maximum %s: %0.5e at %s" % (args.field, v, c)
+ vals['min'] = pf.h.find_max(args.field)
+ print "Maximum %s: %0.5e at %s" % (args.field,
+ vals['min'][0], vals['min'][1])
if args.min == True:
- v, c = pf.h.find_min(args.field)
- print "Minimum %s: %0.5e at %s" % (args.field, v, c)
+ vals['max'] = pf.h.find_min(args.field)
+ print "Minimum %s: %0.5e at %s" % (args.field,
+ vals['max'][0], vals['max'][1])
if args.output is not None:
t = pf.current_time * pf['years']
- open(args.output, "a").write(
- "%s (%0.5e years): %0.5e at %s\n" % (pf, t, v, c))
+ with open(args.output, "a") as f:
+ f.write("%s (%0.5e years)\n" % (pf, t))
+ if 'min' in vals:
+ f.write('Minimum %s is %0.5e at %s' % (
+ args.field, vals['min'][0], vals['min'][1]))
+ if 'max' in vals:
+ f.write('Maximum %s is %0.5e at %s' % (
+ args.field, vals['max'][0], vals['max'][1]))
class YTUpdateCmd(YTCommand):
args = ("all", )
https://bitbucket.org/yt_analysis/yt/commits/82c39f067798/
Changeset: 82c39f067798
Branch: yt
User: MatthewTurk
Date: 2013-09-06 02:21:49
Summary: Adding newlines
Affected #: 1 file
diff -r 712eb7af5ff156e2d4754ffd6757429ba8c6411f -r 82c39f06779818dc31a267c38f7f0adbc079705b yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -1604,10 +1604,10 @@
with open(args.output, "a") as f:
f.write("%s (%0.5e years)\n" % (pf, t))
if 'min' in vals:
- f.write('Minimum %s is %0.5e at %s' % (
+ f.write('Minimum %s is %0.5e at %s\n' % (
args.field, vals['min'][0], vals['min'][1]))
if 'max' in vals:
- f.write('Maximum %s is %0.5e at %s' % (
+ f.write('Maximum %s is %0.5e at %s\n' % (
args.field, vals['max'][0], vals['max'][1]))
class YTUpdateCmd(YTCommand):
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