[yt-svn] commit/yt: ngoldbaum: Merged in cphyc/yt (pull request #2447)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Dec 1 07:38:49 PST 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/bb7f23a27456/
Changeset:   bb7f23a27456
Branch:      yt
User:        ngoldbaum
Date:        2016-12-01 15:38:23+00:00
Summary:     Merged in cphyc/yt (pull request #2447)

add CLI option for field unit + update CLI time option
Affected #:  1 file

diff -r a2ecef680eba44be8240df896cb4b178046d9c58 -r bb7f23a27456bed189cbd20b0b5cdc968a2f31e0 yt/utilities/command_line.py
--- a/yt/utilities/command_line.py
+++ b/yt/utilities/command_line.py
@@ -272,7 +272,7 @@
     unit    = dict(short="-u", longname="--unit",
                    action="store", type=str,
                    dest="unit", default='1',
-                   help="Desired units"),
+                   help="Desired axes units"),
     center  = dict(short="-c", longname="--center",
                    action="store", type=float,
                    dest="center", default=None,
@@ -908,7 +908,11 @@
 class YTPlotCmd(YTCommand):
     args = ("width", "unit", "bn", "proj", "center", "zlim", "axis", "field",
             "weight", "skip", "cmap", "output", "grids", "time", "ds", "max",
-            "log", "linear")
+            "log", "linear",
+            dict(short="-fu", longname="--field-unit",
+                 action="store", type=str,
+                 dest="field_unit", default=None,
+                 help="Desired field units"))
 
     name = "plot"
 
@@ -957,8 +961,10 @@
             if args.grids:
                 plt.annotate_grids()
             if args.time:
-                time = ds.current_time.in_units("yr")
-                plt.annotate_text((0.2,0.8), 't = %5.2e yr'%time)
+                plt.annotate_timestamp()
+
+            if args.field_unit:
+                plt.set_unit(args.field, args.field_unit)
 
             plt.set_cmap(args.field, args.cmap)
             plt.set_log(args.field, args.takelog)

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