[Yt-svn] yt-commit r1538 - in trunk/yt: . extensions

mturk at wrangler.dreamhost.com mturk at wrangler.dreamhost.com
Mon Nov 23 10:04:40 PST 2009


Author: mturk
Date: Mon Nov 23 10:04:37 2009
New Revision: 1538
URL: http://yt.enzotools.org/changeset/1538

Log:
Removed code review, added "yt analyze" which takes only ONE parameter and that
is an output.



Removed:
   trunk/yt/extensions/CodeReview.py
Modified:
   trunk/yt/commands.py

Modified: trunk/yt/commands.py
==============================================================================
--- trunk/yt/commands.py	(original)
+++ trunk/yt/commands.py	Mon Nov 23 10:04:37 2009
@@ -455,116 +455,68 @@
             t = pf["InitialTime"] * pf['years']
             open(opts.output, "a").write(
                 "%s (%0.5e years): %0.5e at %s\n" % (pf, t, v, c))
-    
-    # Normally the default comes from the .rc
-    @cmdln.option("-p", "--publish",
-                  dest="publish", action="store_true", default=False,
-                  help="publish the review request immediately after "
-                       "submitting")
-    @cmdln.option("-r", "--review-request-id",
-                  dest="rid", metavar="ID", default=None,
-                  help="existing review request ID to update")
-    # Normally the default comes from the .rc
-    @cmdln.option("-o", "--open",
-                  dest="open_browser", action="store_true",
-                  default=False,
-                  help="open a web browser to the review request page")
-    @cmdln.option("-n", "--output-diff",
-                  dest="output_diff_only", action="store_true",
-                  default=False,
-                  help="outputs a diff to the console and exits. "
-                       "Does not post")
-    # Normally the default comes from the .rc
-    @cmdln.option("", "--diff-only",
-                  dest="diff_only", action="store_true", default=False,
-                  help="uploads a new diff, but does not update "
-                       "info from changelist")
-    # Normally the default comes from the .rc
-    @cmdln.option("", "--target-groups",
-                  dest="target_groups", default="yt",
-                  help="names of the groups who will perform "
-                       "the review")
-    # Normally the default comes from the .rc
-    @cmdln.option("", "--target-people",
-                  dest="target_people", default="mturk",
-                  help="names of the people who will perform "
-                       "the review")
-    @cmdln.option("", "--summary",
-                  dest="summary", default=None,
-                  help="summary of the review ")
-    @cmdln.option("", "--description",
-                  dest="description", default=None,
-                  help="description of the review ")
-    @cmdln.option("", "--description-file",
-                  dest="description_file", default=None,
-                  help="text file containing a description of the review")
-    @cmdln.option("", "--testing-done",
-                  dest="testing_done", default=None,
-                  help="details of testing done ")
-    @cmdln.option("", "--testing-done-file",
-                  dest="testing_file", default=None,
-                  help="text file containing details of testing done ")
-    @cmdln.option("", "--branch",
-                  dest="branch", default=None,
-                  help="affected branch ")
-    @cmdln.option("", "--bugs-closed",
-                  dest="bugs_closed", default=None,
-                  help="list of bugs closed ")
-    @cmdln.option("", "--revision-range",
-                  dest="revision_range", default=None,
-                  help="generate the diff for review based on given "
-                       "revision range")
-    @cmdln.option("", "--label",
-                  dest="label", default=None,
-                  help="label (ClearCase Only) ")
-    # Normally the default comes from the .rc
-    @cmdln.option("", "--submit-as",
-                  dest="submit_as", default=None, metavar="USERNAME",
-                  help="user name to be recorded as the author of the "
-                       "review request, instead of the logged in user")
-    @cmdln.option("", "--username",
-                  dest="username", default=None, metavar="USERNAME",
-                  help="user name to be supplied to the reviewboard server")
-    @cmdln.option("", "--password",
-                  dest="password", default=None, metavar="PASSWORD",
-                  help="password to be supplied to the reviewboard server")
-    @cmdln.option("", "--change-only",
-                  dest="change_only", action="store_true",
-                  default=False,
-                  help="updates info from changelist, but does "
-                       "not upload a new diff (only available if your "
-                       "repository supports changesets)")
-    @cmdln.option("", "--parent",
-                  dest="parent_branch", default=None,
-                  metavar="PARENT_BRANCH",
-                  help="the parent branch this diff should be against "
-                       "(only available if your repository supports "
-                       "parent diffs)")
-    @cmdln.option("", "--repository-url",
-                  dest="repository_url", default=None,
-                  help="the url for a repository for creating a diff "
-                       "outside of a working copy (currently only supported "
-                       "by Subversion).  Requires --revision-range")
-    def do_review(self, subcmd, opts, *args):
+
+    @add_cmd_options([])
+    def do_analyze(self, subcmd, opts, arg):
         """
-        Submit a patch for review to review.enzotools.org
+        Produce a set of analysis for a given output.  This includes
+        HaloProfiler results with r200, as per the recipe file in the cookbook,
+        profiles of a number of fields, projections of average Density and
+        Temperature, and distribution functions for Density and Temperature.
 
         ${cmd_option_list}
         """
-        import yt.extensions.CodeReview as cr
-        if opts.summary is None:
-            summary = raw_input("Enter a summary of this patch: ")
-            if len(summary.strip()) == 0:
-                print "Refusing to upload patch without summary!"
-                sys.exit(1)
-            opts.summary = summary
-        cr.main(list(args), opts)
-        if opts.description is None and \
-           opts.description_file is None:
-            print "Your patch had an empty description."
-            print "It'd be awesome if you'd visit the review URL and add one."
-        
+        # We will do the following things:
+        #   Halo profiling (default parameters ONLY)
+        #   Projections: Density, Temperature
+        #   Full-box distribution functions
+        import yt.extensions.HaloProfiler as HP
+        hp = HP.HaloProfiler(arg)
+        # Add a filter to remove halos that have no profile points with overdensity
+        # above 200, and with virial masses less than 1e14 solar masses.
+        # Also, return the virial mass and radius to be written out to a file.
+        hp.add_halo_filter(HP.VirialFilter,must_be_virialized=True,
+                           overdensity_field='ActualOverdensity',
+                           virial_overdensity=200,
+                           virial_filters=[['TotalMassMsun','>=','1e14']],
+                           virial_quantities=['TotalMassMsun','RadiusMpc'])
+
+        # Add profile fields.
+        hp.add_profile('CellVolume',weight_field=None,accumulation=True)
+        hp.add_profile('TotalMassMsun',weight_field=None,accumulation=True)
+        hp.add_profile('Density',weight_field=None,accumulation=False)
+        hp.add_profile('Temperature',weight_field='CellMassMsun',accumulation=False)
+        hp.make_profiles(filename="FilteredQuantities.out")
+
+        # Add projection fields.
+        hp.add_projection('Density',weight_field=None)
+        hp.add_projection('Temperature',weight_field='Density')
+        hp.add_projection('Metallicity',weight_field='Density')
 
+        # Make projections for all three axes using the filtered halo list and
+        # save data to hdf5 files.
+        hp.make_projections(save_cube=True,save_images=True,
+                            halo_list='filtered',axes=[0,1,2])
+
+        # Now we make full-box projections.
+        pf = EnzoStaticOutput(arg)
+        c = 0.5*(pf["DomainRightEdge"] + pf["DomainLeftEdge"])
+        pc = PlotCollection(pf, center=c)
+        for ax in range(3):
+            pc.add_projection("Density", ax, "Density")
+            pc.add_projection("Temperature", ax, "Density")
+            pc.plots[-1].set_cmap("hot")
+
+        # Time to add some phase plots
+        dd = pf.h.all_data()
+        ph = pc.add_phase_object(dd, ["Density", "Temperature", "CellMassMsun"],
+                            weight=None)
+        pc_dummy = PlotCollection(pf, center=c)
+        pr = pc_dummy.add_profile_object(dd, ["Density", "Temperature"],
+                            weight="CellMassMsun")
+        ph.modify["line"](pr.data["Density"], pr.data["Temperature"])
+        pc.save()
+    
 def run_main():
     for co in ["--parallel", "--paste"]:
         if co in sys.argv: del sys.argv[sys.argv.index(co)]



More information about the yt-svn mailing list