[Yt-svn] commit/yt: 21 new changesets

Bitbucket commits-noreply at bitbucket.org
Tue Mar 22 18:19:25 PDT 2011


21 new changesets in yt:

http://bitbucket.org/yt_analysis/yt/changeset/a0dbcb019165/
changeset:   r3861:a0dbcb019165
branch:      yt
user:        MatthewTurk
date:        2011-03-17 03:14:44
summary:     Removing the vcs stuff for SVN; we no longer need it.
affected #:  1 file (897 bytes)

--- a/yt/utilities/command_line.py	Wed Mar 16 14:13:20 2011 -0700
+++ b/yt/utilities/command_line.py	Wed Mar 16 19:14:44 2011 -0700
@@ -224,42 +224,7 @@
             func(self, subcmd, opts, arg)
     return arg_iterate
 
-def _get_vcs_type(path):
-    if os.path.exists(os.path.join(path, ".hg")):
-        return "hg"
-    if os.path.exists(os.path.join(path, ".svn")):
-        return "svn"
-    return None
-
-def _get_svn_version(path):
-    p = subprocess.Popen(["svn", "info", path], stdout = subprocess.PIPE,
-                                               stderr = subprocess.STDOUT)
-    stdout, stderr = p.communicate()
-    return stdout
-
-def _update_svn(path):
-    f = open(os.path.join(path, "yt_updater.log"), "a")
-    f.write("\n\nUPDATE PROCESS: %s\n\n" % (time.asctime()))
-    p = subprocess.Popen(["svn", "up", path], stdout = subprocess.PIPE,
-                                              stderr = subprocess.STDOUT)
-    stdout, stderr = p.communicate()
-    f.write(stdout)
-    f.write("\n\n")
-    if p.returncode:
-        print "BROKEN: See %s" % (os.path.join(path, "yt_updater.log"))
-        sys.exit(1)
-    f.write("Rebuilding modules\n\n")
-    p = subprocess.Popen([sys.executable, "setup.py", "build_ext", "-i"], cwd=path,
-                        stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
-    stdout, stderr = p.communicate()
-    f.write(stdout)
-    f.write("\n\n")
-    if p.returncode:
-        print "BROKEN: See %s" % (os.path.join(path, "yt_updater.log"))
-        sys.exit(1)
-    f.write("Successful!\n")
-
-def _update_hg(path):
+def _update_hg(path, skip_rebuild = False):
     from mercurial import hg, ui, commands
     f = open(os.path.join(path, "yt_updater.log"), "a")
     u = ui.ui()
@@ -280,10 +245,11 @@
         print "    $ cd %s" % (path)
         print "    $ hg up"
         print "    $ %s setup.py develop" % (sys.executable)
-        sys.exit(1)
+        return 1
     print "Updating the repository"
     f.write("Updating the repository\n\n")
     commands.update(u, repo, check=True)
+    if skip_rebuild: return
     f.write("Rebuilding modules\n\n")
     p = subprocess.Popen([sys.executable, "setup.py", "build_ext", "-i"], cwd=path,
                         stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
@@ -294,6 +260,7 @@
         print "BROKEN: See %s" % (os.path.join(path, "yt_updater.log"))
         sys.exit(1)
     f.write("Successful!\n")
+    print "Updated successfully."
 
 def _get_hg_version(path):
     from mercurial import hg, ui, commands
@@ -303,11 +270,6 @@
     commands.identify(u, repo)
     return u.popbuffer()
 
-_vcs_identifier = dict(svn = _get_svn_version,
-                        hg = _get_hg_version)
-_vcs_updater = dict(svn = _update_svn,
-                     hg = _update_hg)
-
 class YTCommands(cmdln.Cmdln):
     name="yt"
 
@@ -342,20 +304,31 @@
         print
         print "yt module located at:"
         print "    %s" % (path)
+        update_supp = False
+        if "YT_DEST" in os.environ:
+            spath = os.path.join(
+                     os.environ["YT_DEST"], "src", "yt-supplemental")
+            if os.path.isdir(spath):
+                print "The supplemental repositories are located at:"
+                print "    %s" % (spath)
+                update_supp = True
         if "site-packages" not in path:
-            vc_type = _get_vcs_type(path)
-            vstring = _vcs_identifier[vc_type](path)
+            vstring = _get_hg_version(path)
             print
             print "The current version of the code is:"
             print
             print "---"
-            print vstring
+            print vstring.strip()
             print "---"
             print
-            print "This installation CAN be automatically updated."
-            if opts.update_source:  
-                _vcs_updater[vc_type](path)
-            print "Updated successfully."
+            if "+" not in vstring:
+                print "We CAN attempt an auto-update of this version."
+            else:
+                print "There are local changes to this repository, and it",
+                print "cannot be auto-updated."
+            if opts.update_source:
+                _update_hg(path)
+                if update_supp == True: _update_hg(spath, skip_rebuild=True)
         if vstring is not None and opts.outputfile is not None:
             open(opts.outputfile, "w").write(vstring)
 
@@ -610,7 +583,7 @@
     def do_pastegrab(self, subcmd, opts, username, paste_id):
         from yt.utilities.pasteboard import retrieve_pastefile
         retrieve_pastefile(username, paste_id, opts.output_fn)
-    
+
 def run_main():
     for co in ["--parallel", "--paste"]:
         if co in sys.argv: del sys.argv[sys.argv.index(co)]


http://bitbucket.org/yt_analysis/yt/changeset/2e7b60cd9058/
changeset:   r3862:2e7b60cd9058
branch:      yt
user:        MatthewTurk
date:        2011-03-17 03:15:12
summary:     Adding in some info about the last user to modify a file; this will be for
aggregation.
affected #:  1 file (246 bytes)

--- a/yt/utilities/pasteboard.py	Wed Mar 16 19:14:44 2011 -0700
+++ b/yt/utilities/pasteboard.py	Wed Mar 16 19:15:12 2011 -0700
@@ -103,7 +103,9 @@
             dfn = pfn + ".desc"
             if dfn in tip:
                 d = tip[dfn].data()
-                uname = _get_last_mod(tip[dfn]).user()
+                last_mod =_get_last_mod(tip[dfn])
+                last_hash = last_mod.hex()
+                uname = last_mod.user()
             elif pfn not in tip:
                 abs_pfn = os.path.join(self.repo_fn, pfn)
                 uname = self.uu.config("ui","username")
@@ -111,13 +113,17 @@
                     d = open(abs_pfn + ".desc").read()
                 else:
                     d = open(abs_pfn).read()
+                last_hash = "tip"
             else:
                 d = tip[pfn].data()
-                uname = _get_last_mod(tip[pfn]).user()
+                last_mod = _get_last_mod(tip[pfn])
+                last_hash = last_mod.hex()
+                uname = last_mod.user()
             if len(d) > 80: d = d[:77] + "..."
             name_noext = pfn[6:].replace(".","-")
             vals.append(dict(modified = time.ctime(t),
                              modtime = t,
+                             lastmod_hash = last_hash,
                              fullname = pfn,
                              htmlname = "html/%s.html" % name_noext,
                              name = pfn[43:], # 6 for posts/ then 36 for UUID


http://bitbucket.org/yt_analysis/yt/changeset/af594c397971/
changeset:   r3863:af594c397971
branch:      yt
user:        MatthewTurk
date:        2011-03-17 03:15:24
summary:     Starting the bootstrap_dev script
affected #:  1 file (4.1 KB)

--- a/yt/utilities/command_line.py	Wed Mar 16 19:15:12 2011 -0700
+++ b/yt/utilities/command_line.py	Wed Mar 16 19:15:24 2011 -0700
@@ -584,6 +584,102 @@
         from yt.utilities.pasteboard import retrieve_pastefile
         retrieve_pastefile(username, paste_id, opts.output_fn)
 
+    def do_bootstrap_dev(self, subcmd, opts):
+        """
+        Bootstrap a yt development environment
+        """
+        from mercurial import hg, ui, commands
+        import imp
+        uu = ui.ui()
+        print
+        print "Hi there!  Welcome to the yt development bootstrap tool."
+        print
+        print "This should get you started with mercurial as well as a few"
+        print "other handy things, like a pasteboard of your very own."
+        print
+        # We have to do a couple things.
+        # First, we check that YT_DEST is set.
+        if "YT_DEST" not in os.environ:
+            print
+            print "*** You must set the environment variable YT_DEST ***"
+            print "*** to point to the installation location!        ***"
+            print
+            sys.exit(1)
+        supp_path = os.path.join(os.environ["YT_DEST"], "src",
+                                 "yt-supplemental")
+        # Now we check that the supplemental repository is checked out.
+        if not os.path.isdir(supp_path):
+            print
+            print "*** The yt-supplemental repository is not checked ***"
+            print "*** out.  I can do this for you, but because this ***"
+            print "*** is a delicate act, I require you to respond   ***"
+            print "*** to the prompt with the word 'yes'.            ***"
+            print
+            response = raw_input("Do you want me to try to check it out? ")
+            if response != "yes":
+                print
+                print "Okay, I understand.  You can check it out yourself."
+                print "This command will do it:"
+                print
+                print "$ hg clone http://hg.enzotools.org/yt-supplemental/ ",
+                print "%s" % (supp_path)
+                print
+                sys.exit(1)
+            rv = commands.clone(uu,
+                    "http://hg.enzotools.org/yt-supplemental/", supp_path)
+            if rv:
+                print "Something has gone wrong.  Quitting."
+                sys.exit(1)
+        # Now we think we have our supplemental repository.
+        print
+        print "I have found the yt-supplemental repository at %s" % (supp_path)
+        print
+        print "Let's load up and check what we need to do to get up and"
+        print "running."
+        print
+        print "There are three stages:"
+        print
+        print " 1. Setting up your ~/.hgrc to have a username."
+        print " 2. Setting up a new pasteboard repository."
+        print " 3. Setting up your bitbucket user account and the hgbb"
+        print "    extension."
+        print
+        firstname = lastname = email_address = bbusername = None
+        # Now we try to import the cedit extension.
+        try:
+            result = imp.find_module("cedit", [supp_path])
+        except ImportError:
+            print "I was unable to find the 'cedit' module in %s" % (supp_path)
+            print "This may be due to a broken checkout."
+            print "Sorry, but I'm going to bail."
+            sys.exit(1)
+        cedit = imp.load_module("cedit", *result)
+        if uu.config("ui","username",None) is None:
+            print "You don't have a username specified in your ~/.hgrc."
+            print "Let's set this up.  If you would like to quit at any time,"
+            print "hit Ctrl-C."
+            print
+            firstname = raw_input("What is your first name? ")
+            lastname = raw_input("What is your last name? ")
+            email_address = raw_input("What is your email address? ")
+            print
+            print "Thanks.  I will now add a username of this form to your"
+            print "~/.hgrc file:"
+            print
+            print "    %s %s <%s>" % (firstname, lastname, email_address)
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            print
+            cedit.setuser(uu, name="%s %s" % (firstname, lastname),
+                              email="%s" % (email_address),
+                              local=False, username=False)
+            print
+        else:
+            print "Looks like you already have a username!"
+            print "We'll skip that step, then."
+            print
+        print
+
 def run_main():
     for co in ["--parallel", "--paste"]:
         if co in sys.argv: del sys.argv[sys.argv.index(co)]


http://bitbucket.org/yt_analysis/yt/changeset/2958e56f8532/
changeset:   r3864:2958e56f8532
branch:      yt
user:        MatthewTurk
date:        2011-03-17 03:36:30
summary:     First pass at new user registration for BitBucket.  Seems to work.
affected #:  1 file (2.9 KB)

--- a/yt/utilities/command_line.py	Wed Mar 16 19:15:24 2011 -0700
+++ b/yt/utilities/command_line.py	Wed Mar 16 19:36:30 2011 -0700
@@ -590,6 +590,7 @@
         """
         from mercurial import hg, ui, commands
         import imp
+        import getpass
         uu = ui.ui()
         print
         print "Hi there!  Welcome to the yt development bootstrap tool."
@@ -640,9 +641,9 @@
         print "There are three stages:"
         print
         print " 1. Setting up your ~/.hgrc to have a username."
-        print " 2. Setting up a new pasteboard repository."
-        print " 3. Setting up your bitbucket user account and the hgbb"
+        print " 2. Setting up your bitbucket user account and the hgbb"
         print "    extension."
+        print " 3. Setting up a new pasteboard repository."
         print
         firstname = lastname = email_address = bbusername = None
         # Now we try to import the cedit extension.
@@ -654,6 +655,14 @@
             print "Sorry, but I'm going to bail."
             sys.exit(1)
         cedit = imp.load_module("cedit", *result)
+        try:
+            result = imp.find_module("hgbb", [supp_path + "/hgbb"])
+        except ImportError:
+            print "I was unable to find the 'hgbb' module in %s" % (supp_path)
+            print "This may be due to a broken checkout."
+            print "Sorry, but I'm going to bail."
+            sys.exit(1)
+        hgbb = imp.load_module("hgbb", *result)
         if uu.config("ui","username",None) is None:
             print "You don't have a username specified in your ~/.hgrc."
             print "Let's set this up.  If you would like to quit at any time,"
@@ -678,7 +687,55 @@
             print "Looks like you already have a username!"
             print "We'll skip that step, then."
             print
+        print "Now we'll set up BitBucket user."
         print
+        loki = raw_input("Do you have a BitBucket.org user already? [yes/no]")
+        if loki.strip().upper() == "YES":
+            bbusername = raw_input("Okay, cool.  What is your username?  ").strip()
+        elif loki.strip().upper() == "NO":
+            print "Okay, we can set you up with one.  It's probably better for"
+            print "it to be all lowercase letter."
+            print
+            bbusername = raw_input("What is your desired username? ").strip()
+            if firstname is None:
+                firstname = raw_input("What's your first name? ").strip()
+            if lastname is None:
+                lastname = raw_input("What's your last name? ").strip()
+            if email_address is None:
+                email_address = raw_input("What's your email address? ").strip()
+            print
+            print "Okay, I'll see if I can create a user with this information:"
+            print "  username:   %s" % (bbusername)
+            print "  first name: %s" % (firstname)
+            print "  last name:  %s" % (lastname)
+            print "  email:      %s" % (email_address)
+            print
+            print "Now, I'm going to ask for a password.  This password will"
+            print "be transmitted over HTTPS (not HTTP) and will not be stored"
+            print "in any local file.  But, it will be stored in memory for"
+            print "the duration of the user-creation process."
+            print
+            while 1:
+                password1 = getpass.getpass("Password? ")
+                password2 = getpass.getpass("Confirm? ")
+                if password1 == password2: break
+                print "Sorry, they didn't match!  Let's try again."
+                print
+            rv = hgbb._bb_apicall(uu, "newuser",
+                                    dict(username=bbusername,
+                                         password=password1,
+                                         email=email_address,
+                                         first_name = firstname,
+                                         last_name = lastname),
+                                   False)
+            del password1, password2
+            if str(rv['username']) == bbusername:
+                print "Successful!  You probably just got an email asking you"
+                print "to confirm this."
+        else:
+            print "Not really sure what you replied with.  Quitting!"
+            sys.exit(1)
+        # Now we set up the hgbb extension
 
 def run_main():
     for co in ["--parallel", "--paste"]:


http://bitbucket.org/yt_analysis/yt/changeset/1af1c8dc0789/
changeset:   r3865:1af1c8dc0789
branch:      yt
user:        MatthewTurk
date:        2011-03-17 03:37:42
summary:     Fixing a JSON error
affected #:  1 file (32 bytes)

--- a/yt/utilities/command_line.py	Wed Mar 16 19:36:30 2011 -0700
+++ b/yt/utilities/command_line.py	Wed Mar 16 19:37:42 2011 -0700
@@ -591,6 +591,7 @@
         from mercurial import hg, ui, commands
         import imp
         import getpass
+        import json
         uu = ui.ui()
         print
         print "Hi there!  Welcome to the yt development bootstrap tool."
@@ -729,7 +730,7 @@
                                          last_name = lastname),
                                    False)
             del password1, password2
-            if str(rv['username']) == bbusername:
+            if str(json.loads(rv)['username']) == bbusername:
                 print "Successful!  You probably just got an email asking you"
                 print "to confirm this."
         else:


http://bitbucket.org/yt_analysis/yt/changeset/0646082fcd67/
changeset:   r3866:0646082fcd67
branch:      yt
user:        MatthewTurk
date:        2011-03-17 18:38:26
summary:     More error checking, and setting up the hgbb extension.
affected #:  1 file (2.4 KB)

--- a/yt/utilities/command_line.py	Wed Mar 16 19:37:42 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 10:38:26 2011 -0700
@@ -688,11 +688,24 @@
             print "Looks like you already have a username!"
             print "We'll skip that step, then."
             print
-        print "Now we'll set up BitBucket user."
+        print "Now we'll set up BitBucket user.  If you would like to do this"
+        print "yourself, please visit:"
+        print " https://bitbucket.org/account/signup/?plan=5_users"
+        print "for a free account."
         print
         loki = raw_input("Do you have a BitBucket.org user already? [yes/no]")
         if loki.strip().upper() == "YES":
             bbusername = raw_input("Okay, cool.  What is your username?  ").strip()
+            # Now we get information about the username.
+            if firstname is None or lastname is None:
+                rv = hgbb._bb_apicall(uu, "users/%s" % bbusername, None, False)
+                rv = json.loads(rv)
+                firstname = rv['user']["first_name"]
+                lastname = rv['user']["last_name"]
+                print "Retrieved your info:"
+                print "  username:   %s" % (bbusername)
+                print "  first name: %s" % (firstname)
+                print "  last name:  %s" % (lastname)
         elif loki.strip().upper() == "NO":
             print "Okay, we can set you up with one.  It's probably better for"
             print "it to be all lowercase letter."
@@ -733,10 +746,45 @@
             if str(json.loads(rv)['username']) == bbusername:
                 print "Successful!  You probably just got an email asking you"
                 print "to confirm this."
+            else:
+                print "Okay, something is wrong.  Quitting!"
+                sys.exit(1)
         else:
             print "Not really sure what you replied with.  Quitting!"
             sys.exit(1)
+        # We're now going to do some modification of the hgrc.
+        # We need an hgrc first.
+        hgrc_path = [cedit.config.defaultpath("user", uu)]
+        hgrc_path = cedit.config.verifypaths(hgrc_path)
         # Now we set up the hgbb extension
+        if uu.config("extensions","hgbb",None) is None:
+            hgbb_path = hgbb.__file__
+            if hgbb_path.endswith(".pyc"): hgbb_path = hgbb_path[:-1]
+            print "Now we're going to turn on the hgbb extension in:"
+            print "    ", hgrc_path
+            print "This will enable you to access BitBucket more easily, as well"
+            print "as create repositories from the command line."
+            print
+            print "This constitutes adding the path to the hgbb extension,"
+            print "which will look like this:"
+            print
+            print "   [extensions]"
+            print "   hgbb=%s" % hgbb_path
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            cedit.config.setoption(uu, hgrc_path, "extensions.hgbb=%s" % hgbb_path)
+        if uu.config("bb","username", None) is None:
+            print "We'll now set up your username for BitBucket."
+            print "We will add this:"
+            print
+            print "   [bb]"
+            print "   username = %s" % (bbusername)
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            cedit.config.setoption(uu, hgrc_path, "bb.username=%s" % bbusername)
+        # Now the only thing remaining to do is to set up the pasteboard
+        # repository.
+        # This is, unfortunately, the most difficult.
 
 def run_main():
     for co in ["--parallel", "--paste"]:


http://bitbucket.org/yt_analysis/yt/changeset/6507302756f1/
changeset:   r3867:6507302756f1
branch:      yt
user:        MatthewTurk
date:        2011-03-17 19:13:17
summary:     Adding creation / cloning of pasteboard repo.
affected #:  1 file (3.5 KB)

--- a/yt/utilities/command_line.py	Thu Mar 17 10:38:26 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 11:13:17 2011 -0700
@@ -646,7 +646,7 @@
         print "    extension."
         print " 3. Setting up a new pasteboard repository."
         print
-        firstname = lastname = email_address = bbusername = None
+        firstname = lastname = email_address = bbusername = repo_list = None
         # Now we try to import the cedit extension.
         try:
             result = imp.find_module("cedit", [supp_path])
@@ -702,6 +702,7 @@
                 rv = json.loads(rv)
                 firstname = rv['user']["first_name"]
                 lastname = rv['user']["last_name"]
+                repo_list = rv['repositories']
                 print "Retrieved your info:"
                 print "  username:   %s" % (bbusername)
                 print "  first name: %s" % (firstname)
@@ -785,6 +786,80 @@
         # Now the only thing remaining to do is to set up the pasteboard
         # repository.
         # This is, unfortunately, the most difficult.
+        print
+        print "We are now going to set up a pasteboard. This is a mechanism"
+        print "for versioned posting of snippets, collaboration and"
+        print "discussion."
+        print
+        # Let's get the full list of repositories
+        pasteboard_name = "%s.bitbucket.org" % (bbusername.lower())
+        if repo_list is None:
+            rv = hgbb._bb_apicall(uu, "users/%s" % bbusername, None, False)
+            rv = json.loads(rv)
+            repo_list = rv['repositories']
+        create = True
+        for repo in repo_list:
+            if repo['name'] == pasteboard_name:
+                create = False
+        if create:
+            # Now we first create the repository, but we
+            # will only use the creation API, not the bbcreate command.
+            print
+            print "I am now going to create the repository:"
+            print "    ", pasteboard_name
+            print "on BitBucket.org.  This will set up the domain"
+            print "     http://%s" % (pasteboard_name)
+            print "which will point to the current contents of the repo."
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            data = dict(name=pasteboard_name)
+            hgbb._bb_apicall(ui, 'repositories', data)
+        # Now we clone
+        pasteboard_path = os.path.join(os.environ["YT_DEST"], "src",
+                                       pasteboard_name)
+        if os.path.isdir(pasteboard_path):
+            print "Found an existing clone of the pasteboard repo:"
+            print "    ", pasteboard_path
+        else:
+            print
+            print "I will now clone a copy of your pasteboard repo."
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            commands.clone(uu, "https://%s@bitbucket.org/%s/%s" % (
+                             bbusername, bbusername, pasteboard_name),
+                           pasteboard_path)
+            pbtemplate_path = os.path.join(supp_path, "pasteboard_template")
+            pb_hgrc_path = os.path.join(pasteboard_path, ".hg", "hgrc")
+            cedit.config.setoption(uu, [pb_hgrc_path],
+                                   "paths.pasteboard = " + pbtemplate_path)
+            if create:
+                # We have to pull in the changesets from the pasteboard.
+                commands.pull(uu, pasteboard_path,
+                              os.path.join(supp_path, "pasteboard_template"))
+        if ytcfg.get("yt","pasteboard_repo") != pasteboard_path:
+            print
+            print "Now setting the pasteboard_repo option in"
+            print "~/.yt/config to point to %s" % (pasteboard_path)
+            print
+            loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+            dotyt_path = os.path.expanduser("~/.yt")
+            if not os.path.isdir(dotyt_path):
+                print "There's no directory:"
+                print "    ", dotyt_path
+                print "I will now create it."
+                print
+                loki = raw_input("Press enter to go on, Ctrl-C to exit.")
+                os.mkdir(dotyt_path)
+            ytcfg_path = os.path.expanduser("~/.yt/config")
+            cedit.config.setoption(uu, [ytcfg_path],
+                        "yt.pasteboard_repo=%s" % (pasteboard_path))
+        print
+        print "All done!"
+        print
+        print "You're now set up to use the 'yt pasteboard' command"
+        print "as well as develop using Mercurial and BitBucket."
+        print
+        print "Good luck!"
 
 def run_main():
     for co in ["--parallel", "--paste"]:


http://bitbucket.org/yt_analysis/yt/changeset/0d88ad1181c9/
changeset:   r3868:0d88ad1181c9
branch:      yt
user:        MatthewTurk
date:        2011-03-17 19:13:34
summary:     Merging
affected #:  0 files (0 bytes)

--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Thu Mar 17 11:13:17 2011 -0700
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py	Thu Mar 17 11:13:34 2011 -0700
@@ -562,7 +562,7 @@
                         if save_images:
                             filename = "%s/Halo_%04d_%s_%s.png" % (my_output_dir, halo['id'], 
                                                                    dataset_name, axis_labels[w])
-                            write_image(frb[hp['field']], filename, cmap_name=hp['cmap'])
+                            write_image(na.log10(frb[hp['field']]), filename, cmap_name=hp['cmap'])
 
                     if save_cube: output.close()
 


--- a/yt/analysis_modules/light_cone/light_cone.py	Thu Mar 17 11:13:17 2011 -0700
+++ b/yt/analysis_modules/light_cone/light_cone.py	Thu Mar 17 11:13:34 2011 -0700
@@ -276,7 +276,7 @@
                                          weight_field=weight_field, node=node)
             if ytcfg.getint("yt", "__parallel_rank") == 0:
                 if save_slice_images:
-                    write_image(frb[field], "%s_%s.png" % (name, field), cmap_name=cmap_name)
+                    write_image(na.log10(frb[field]), "%s_%s.png" % (name, field), cmap_name=cmap_name)
 
                 if photon_field:
                     # Decrement the flux by the luminosity distance. Assume field in frb is in erg/s/cm^2/Hz
@@ -332,7 +332,7 @@
 
             # Write image.
             if save_slice_images:
-                write_image(frb[field], "%s_%s.png" % (filename, field), cmap_name=cmap_name)
+                write_image(na.log10(frb[field]), "%s_%s.png" % (filename, field), cmap_name=cmap_name)
 
             # Write stack to hdf5 file.
             if save_stack:


http://bitbucket.org/yt_analysis/yt/changeset/19dbf65cc46e/
changeset:   r3869:19dbf65cc46e
branch:      yt
user:        MatthewTurk
date:        2011-03-17 20:01:23
summary:     Fixing typo for ui->uu
affected #:  1 file (0 bytes)

--- a/yt/utilities/command_line.py	Thu Mar 17 11:13:34 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 12:01:23 2011 -0700
@@ -813,7 +813,7 @@
             print
             loki = raw_input("Press enter to go on, Ctrl-C to exit.")
             data = dict(name=pasteboard_name)
-            hgbb._bb_apicall(ui, 'repositories', data)
+            hgbb._bb_apicall(uu, 'repositories', data)
         # Now we clone
         pasteboard_path = os.path.join(os.environ["YT_DEST"], "src",
                                        pasteboard_name)


http://bitbucket.org/yt_analysis/yt/changeset/8ca05ce2ce76/
changeset:   r3870:8ca05ce2ce76
branch:      yt
user:        MatthewTurk
date:        2011-03-17 20:14:08
summary:     Fixing issue with pulling from the pb_template
affected #:  1 file (53 bytes)

--- a/yt/utilities/command_line.py	Thu Mar 17 12:01:23 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 12:14:08 2011 -0700
@@ -834,7 +834,8 @@
                                    "paths.pasteboard = " + pbtemplate_path)
             if create:
                 # We have to pull in the changesets from the pasteboard.
-                commands.pull(uu, pasteboard_path,
+                pb_repo = hg.repository(uu, pasteboard_path)
+                commands.pull(uu, pb_repo,
                               os.path.join(supp_path, "pasteboard_template"))
         if ytcfg.get("yt","pasteboard_repo") != pasteboard_path:
             print


http://bitbucket.org/yt_analysis/yt/changeset/91ebe234b70b/
changeset:   r3871:91ebe234b70b
branch:      yt
user:        MatthewTurk
date:        2011-03-17 20:18:40
summary:     False => None in defaults for pasteboard
affected #:  1 file (1 byte)

--- a/yt/utilities/command_line.py	Thu Mar 17 12:14:08 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 12:18:40 2011 -0700
@@ -566,7 +566,7 @@
         pc.save()
 
     @cmdln.option("-d", "--desc", action="store",
-                  default = False, dest="desc",
+                  default = None, dest="desc",
                   help="Description for this pasteboard entry")
     def do_pasteboard(self, subcmd, opts, arg):
         """


http://bitbucket.org/yt_analysis/yt/changeset/450f7ea75eb5/
changeset:   r3872:450f7ea75eb5
branch:      yt
user:        MatthewTurk
date:        2011-03-18 02:12:37
summary:     Fixing usage of EnzoStaticOutput
affected #:  1 file (12 bytes)

--- a/yt/data_objects/time_series.py	Thu Mar 17 17:08:17 2011 -0700
+++ b/yt/data_objects/time_series.py	Thu Mar 17 18:12:37 2011 -0700
@@ -108,7 +108,7 @@
 
     def _populate_output_list(self, output_list):
         for output in output_list:
-            self._insert(EnzoStaticOutput(output))
+            self._insert(load(output))
 
     def _populate_output_log(self, output_log):
         for line in open(output_log):


http://bitbucket.org/yt_analysis/yt/changeset/a1043895a31b/
changeset:   r3873:a1043895a31b
branch:      yt
user:        MatthewTurk
date:        2011-03-18 02:13:16
summary:     Merging
affected #:  0 files (0 bytes)

--- a/doc/install_script.sh	Thu Mar 17 12:18:40 2011 -0700
+++ b/doc/install_script.sh	Thu Mar 17 18:13:16 2011 -0700
@@ -290,7 +290,6 @@
 get_enzotools h5py-1.2.0.tar.gz
 get_enzotools Cython-0.14.tar.gz
 get_enzotools Forthon-0.8.4.tar.gz
-get_enzotools yt.hg
 
 if [ $INST_BZLIB -eq 1 ]
 then


--- a/yt/data_objects/time_series.py	Thu Mar 17 12:18:40 2011 -0700
+++ b/yt/data_objects/time_series.py	Thu Mar 17 18:13:16 2011 -0700
@@ -108,7 +108,7 @@
 
     def _populate_output_list(self, output_list):
         for output in output_list:
-            self._insert(EnzoStaticOutput(output))
+            self._insert(load(output))
 
     def _populate_output_log(self, output_log):
         for line in open(output_log):


http://bitbucket.org/yt_analysis/yt/changeset/9cc0c832718a/
changeset:   r3874:9cc0c832718a
branch:      yt
user:        MatthewTurk
date:        2011-03-18 02:25:16
summary:     Adding pygments-installation to bootstrap_dev.
affected #:  1 file (457 bytes)

--- a/yt/utilities/command_line.py	Thu Mar 17 18:13:16 2011 -0700
+++ b/yt/utilities/command_line.py	Thu Mar 17 18:25:16 2011 -0700
@@ -854,6 +854,18 @@
             ytcfg_path = os.path.expanduser("~/.yt/config")
             cedit.config.setoption(uu, [ytcfg_path],
                         "yt.pasteboard_repo=%s" % (pasteboard_path))
+        try:
+            import pygments
+            install_pygments = False
+        except ImportError:
+            install_pygments = True
+        if install_pygments:
+            print "You are missing the Pygments package.  Installing."
+            import pip
+            rv = pip.main(["install", "pygments"])
+            if rv == 1:
+                print "Unable to install Pygments.  Please report this bug to yt-users."
+                sys.exit(1)
         print
         print "All done!"
         print


http://bitbucket.org/yt_analysis/yt/changeset/831596ae662d/
changeset:   r3875:831596ae662d
branch:      yt
user:        MatthewTurk
date:        2011-03-21 04:48:31
summary:     Merging
affected #:  1 file (43 bytes)

--- a/yt/data_objects/data_containers.py	Thu Mar 17 18:25:16 2011 -0700
+++ b/yt/data_objects/data_containers.py	Sun Mar 20 20:48:31 2011 -0700
@@ -639,6 +639,97 @@
         self._ts[grid.id] = na.abs(ts)
         return mask
 
+class AMRStreamlineBase(AMR1DData):
+    _type_name = "streamline"
+    _con_args = ('positions')
+    sort_by = 't'
+    def __init__(self, positions, fields=None, pf=None, **kwargs):
+        """
+        This is a streamline, which is a set of points defined as
+        being parallel to some vector field.
+
+        This object is typically accessed through the Streamlines.path
+        function.  The resulting arrays have their dimensionality
+        reduced to one, and an ordered list of points at an (x,y)
+        tuple along `axis` are available, as is the `t` field, which
+        corresponds to a unitless measurement along the ray from start
+        to end.
+
+        Parameters
+        ----------
+        positions : array-like
+            List of streamline positions
+        fields : list of strings, optional
+            If you want the object to pre-retrieve a set of fields, supply them
+            here.  This is not necessary.
+        pf : Parameter file object
+            Passed in to access the hierarchy
+        kwargs : dict of items
+            Any additional values are passed as field parameters that can be
+            accessed by generated fields.
+
+        Examples
+        --------
+
+        >>> from yt.visualization.api import Streamlines
+        >>> streamlines = Streamlines(pf, [0.5]*3) 
+        >>> streamlines.integrate_through_volume()
+        >>> stream = streamlines.path(0)
+        >>> matplotlib.pylab.semilogy(stream['t'], stream['Density'], '-x')
+        
+        """
+        AMR1DData.__init__(self, pf, fields, **kwargs)
+        self.positions = positions
+        self.dts = na.empty_like(positions[:,0])
+        self.dts[:-1] = na.sqrt(na.sum((self.positions[1:]-
+                                        self.positions[:-1])**2,axis=1))
+        self.dts[-1] = self.dts[-1]
+        self.ts = na.add.accumulate(self.dts)
+        self._set_center(self.positions[0])
+        self.set_field_parameter('center', self.positions[0])
+        self._dts, self._ts = {}, {}
+        #self._refresh_data()
+
+    def _get_list_of_grids(self):
+        # Get the value of the line at each LeftEdge and RightEdge
+        LE = self.pf.h.grid_left_edge
+        RE = self.pf.h.grid_right_edge
+        # Check left faces first
+        min_streampoint = na.min(self.positions, axis=0)
+        max_streampoint = na.max(self.positions, axis=0)
+        p = na.all((min_streampoint <= RE) & (max_streampoint > LE), axis=1)
+        self._grids = self.hierarchy.grids[p]
+
+    def _get_data_from_grid(self, grid, field):
+        mask = na.logical_and(self._get_cut_mask(grid),
+                              grid.child_mask)
+        if field == 'dts': return self._dts[grid.id][mask]
+        if field == 't': return self._ts[grid.id][mask]
+        return grid[field][mask]
+        
+    @cache_mask
+    def _get_cut_mask(self, grid):
+        mask = na.zeros(grid.ActiveDimensions, dtype='int')
+        dts = na.zeros(grid.ActiveDimensions, dtype='float64')
+        ts = na.zeros(grid.ActiveDimensions, dtype='float64')
+        #pdb.set_trace()
+        points_in_grid = na.all(self.positions > grid.LeftEdge, axis=1) & \
+                         na.all(self.positions <= grid.RightEdge, axis=1) 
+        pids = na.where(points_in_grid)[0]
+        for i, pos in zip(pids, self.positions[points_in_grid]):
+            if not points_in_grid[i]: continue
+            ci = ((pos - grid.LeftEdge)/grid.dds).astype('int')
+            for j in range(3):
+                ci[j] = min(ci[j], grid.ActiveDimensions[j]-1)
+            if mask[ci[0], ci[1], ci[2]]:
+                continue
+            mask[ci[0], ci[1], ci[2]] = 1
+            dts[ci[0], ci[1], ci[2]] = self.dts[i]
+            ts[ci[0], ci[1], ci[2]] = self.ts[i]
+        self._dts[grid.id] = dts
+        self._ts[grid.id] = ts
+        return mask
+
 class AMR2DData(AMRData, GridPropertiesMixin, ParallelAnalysisInterface):
     _key_fields = ['px','py','pdx','pdy']
     """


--- a/yt/frontends/enzo/data_structures.py	Thu Mar 17 18:25:16 2011 -0700
+++ b/yt/frontends/enzo/data_structures.py	Sun Mar 20 20:48:31 2011 -0700
@@ -569,9 +569,14 @@
         if self.__class__._cached_field_list is None:
             EnzoHierarchy._detect_fields(self)
             self.__class__._cached_field_list = self.field_list
+        else:
+            self.field_list = self.__class__._cached_field_list
+
+    def _setup_derived_fields(self):
+        if self.__class__._cached_derived_field_list is None:
+            EnzoHierarchy._setup_derived_fields(self)
             self.__class__._cached_derived_field_list = self.derived_field_list
         else:
-            self.field_list = self.__class__._cached_field_list
             self.derived_field_list = self.__class__._cached_derived_field_list
 
     def _generate_random_grids(self):


--- a/yt/utilities/_amr_utils/ContourFinding.pyx	Thu Mar 17 18:25:16 2011 -0700
+++ b/yt/utilities/_amr_utils/ContourFinding.pyx	Sun Mar 20 20:48:31 2011 -0700
@@ -49,7 +49,7 @@
     ny = contour_ids.shape[1]
     nz = contour_ids.shape[2]
     # We allocate an array of fixed (maximum) size
-    cdef int s = (ny*nx + nx*nz + nx*nz - 4) * 9
+    cdef int s = (ny*nx + nx*nz + ny*nz - 2) * 18
     cdef np.ndarray[np.int64_t, ndim=2] tree = np.zeros((s, 2), dtype="int64")
     cdef int ti = 0
     # First x-pass


--- a/yt/utilities/command_line.py	Thu Mar 17 18:25:16 2011 -0700
+++ b/yt/utilities/command_line.py	Sun Mar 20 20:48:31 2011 -0700
@@ -312,6 +312,7 @@
                 print "The supplemental repositories are located at:"
                 print "    %s" % (spath)
                 update_supp = True
+        vstring = None
         if "site-packages" not in path:
             vstring = _get_hg_version(path)
             print
@@ -321,14 +322,14 @@
             print vstring.strip()
             print "---"
             print
-            if "+" not in vstring:
-                print "We CAN attempt an auto-update of this version."
-            else:
-                print "There are local changes to this repository, and it",
-                print "cannot be auto-updated."
-            if opts.update_source:
-                _update_hg(path)
-                if update_supp == True: _update_hg(spath, skip_rebuild=True)
+            print "This installation CAN be automatically updated."
+            if opts.update_source:  
+                _vcs_updater[vc_type](path)
+            print "Updated successfully."
+        elif opts.update_source:
+            print
+            print "You have to update this installation yourself."
+            print
         if vstring is not None and opts.outputfile is not None:
             open(opts.outputfile, "w").write(vstring)
 


--- a/yt/visualization/streamlines.py	Thu Mar 17 18:25:16 2011 -0700
+++ b/yt/visualization/streamlines.py	Sun Mar 20 20:48:31 2011 -0700
@@ -28,7 +28,8 @@
 from yt.utilities.parallel_tools.parallel_analysis_interface import \
     ParallelAnalysisInterface, parallel_passthrough
 from yt.utilities.amr_kdtree.api import AMRKDTree
-
+from yt.data_objects.data_containers import AMRStreamlineBase
+        
 class Streamlines(ParallelAnalysisInterface):
     r"""A collection of streamlines that flow through the volume
 
@@ -41,12 +42,15 @@
         This is the parameter file to streamline
     pos : array_like
         An array of initial starting positions of the streamlines.
-    xfield: field
+    xfield: field, optional
         The x component of the vector field to be streamlined.
-    yfield: field
+        Default:'x-velocity'
+    yfield: field, optional
         The y component of the vector field to be streamlined.
-    zfield: field
+        Default:'y-velocity'
+    zfield: field, optional
         The z component of the vector field to be streamlined.
+        Default:'z-velocity'
     volume : `yt.extensions.volume_rendering.HomogenizedVolume`, optional
         The volume to be streamlined.  Can be specified for
         finer-grained control, but otherwise will be automatically
@@ -58,6 +62,9 @@
     length : float, optional
         Optionally specify the length of integration.  
         Default: na.max(self.pf.domain_right_edge-self.pf.domain_left_edge)
+    direction : real, optional
+        Specifies the direction of integration.  The magnitude of this
+        value has no effect, only the sign.
     
     Examples
     --------
@@ -83,14 +90,16 @@
     >>>     ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
     >>> pl.savefig('streamlines.png')
     """
-    def __init__(self, pf, positions, xfield, yfield, zfield, volume=None,
-                 dx=None, length=None):
+    def __init__(self, pf, positions, xfield='x-velocity', yfield='x-velocity',
+                 zfield='x-velocity', volume=None,
+                 dx=None, length=None, direction=1):
         self.pf = pf
-        self.start_positions = positions
+        self.start_positions = na.array(positions)
         self.N = self.start_positions.shape[0]
         self.xfield = xfield
         self.yfield = yfield
         self.zfield = zfield
+        self.direction = na.sign(direction)
         if volume is None:
             volume = AMRKDTree(self.pf, fields=[self.xfield,self.yfield,self.zfield],
                             log_fields=[False,False,False], merge_trees=True)
@@ -103,7 +112,7 @@
         self.length = length
         self.steps = int(length/dx)
         self.streamlines = na.zeros((self.N,self.steps,3), dtype='float64')
-
+        
     def integrate_through_volume(self):
         nprocs = self._mpi_get_size()
         my_rank = self._mpi_get_rank()
@@ -119,17 +128,18 @@
         pbar.finish()
         
         self._finalize_parallel(None)
-
+       
     @parallel_passthrough
     def _finalize_parallel(self,data):
         self.streamlines = self._mpi_allsum(self.streamlines)
         
-    def _integrate_through_brick(self, node, stream, step, periodic=False):
+    def _integrate_through_brick(self, node, stream, step,
+                                 periodic=False):
         while (step > 1):
             self.volume.get_brick_data(node)
             brick = node.brick
             stream[-step+1] = stream[-step]
-            brick.integrate_streamline(stream[-step+1], self.dx)
+            brick.integrate_streamline(stream[-step+1], self.direction*self.dx)
             if na.any(stream[-step+1,:] <= self.pf.domain_left_edge) | \
                    na.any(stream[-step+1,:] >= self.pf.domain_right_edge):
                 return 0
@@ -140,7 +150,35 @@
             step -= 1
         return step
 
-    
+    def clean_streamlines(self):
+        temp = na.empty(self.N, dtype='object')
+        for i,stream in enumerate(self.streamlines):
+            temp[i] = stream[na.all(stream != 0.0, axis=1)]
+        self.streamlines = temp
 
+    def path(self, streamline_id):
+        """
+        Returns an AMR1DData object defined by a streamline.
 
+        Parameters
+        ----------
+        streamline_id : int
+            This defines which streamline from the Streamlines object
+            that will define the AMR1DData object.
+
+        Returns
+        -------
+        An AMRStreamlineBase AMR1DData object
+
+        Examples
+        --------
+
+        >>> from yt.visualization.api import Streamlines
+        >>> streamlines = Streamlines(pf, [0.5]*3) 
+        >>> streamlines.integrate_through_volume()
+        >>> stream = streamlines.path(0)
+        >>> matplotlib.pylab.semilogy(stream['t'], stream['Density'], '-x')
         
+        """
+        return AMRStreamlineBase(self.streamlines[streamline_id], pf=self.pf)
+        


http://bitbucket.org/yt_analysis/yt/changeset/4f5afd2848ef/
changeset:   r3876:4f5afd2848ef
branch:      yt
user:        MatthewTurk
date:        2011-03-21 21:08:57
summary:     Fixing the UI reload to ensure that updates to the [bb] username are taken
before it tries to create the repository.
affected #:  1 file (136 bytes)

--- a/yt/utilities/command_line.py	Sun Mar 20 20:48:31 2011 -0700
+++ b/yt/utilities/command_line.py	Mon Mar 21 13:08:57 2011 -0700
@@ -784,6 +784,9 @@
             print
             loki = raw_input("Press enter to go on, Ctrl-C to exit.")
             cedit.config.setoption(uu, hgrc_path, "bb.username=%s" % bbusername)
+        # We now reload the UI's config file so that it catches the [bb]
+        # section changes.
+        uu.readconfig(hgrc_path[0])
         # Now the only thing remaining to do is to set up the pasteboard
         # repository.
         # This is, unfortunately, the most difficult.


http://bitbucket.org/yt_analysis/yt/changeset/ee26eda1b855/
changeset:   r3877:ee26eda1b855
branch:      yt
user:        MatthewTurk
date:        2011-03-22 16:30:44
summary:     Updating CREDITS list
affected #:  1 file (231 bytes)

--- a/CREDITS	Mon Mar 21 13:08:57 2011 -0700
+++ b/CREDITS	Tue Mar 22 08:30:44 2011 -0700
@@ -12,6 +12,9 @@
                                 Oliver Hahn (ohahn at stanford.edu)
                                 John ZuHone (jzuhone at cfa.harvard.edu)
                                 Chris Malone (cmalone at mail.astro.sunysb.edu)
+                                Cameron Hummels (chummels at astro.columbia.edu)
+                                Stefan Klemer (sklemer at phys.uni-goettingen.de)
+                                Andrew Myers (atmyers at astro.berkeley.edu)
 
 We also include the Delaunay Triangulation module written by Robert Kern of
 Enthought, the cmdln.py module by Trent Mick, and the progressbar module by


http://bitbucket.org/yt_analysis/yt/changeset/933b15cc890e/
changeset:   r3878:933b15cc890e
branch:      yt
user:        MatthewTurk
date:        2011-03-22 16:36:05
summary:     Adding note about bootstrap_dev to install_script.sh.
affected #:  1 file (115 bytes)

--- a/doc/install_script.sh	Tue Mar 22 08:30:44 2011 -0700
+++ b/doc/install_script.sh	Tue Mar 22 08:36:05 2011 -0700
@@ -542,6 +542,10 @@
     echo
     echo "$DEST_DIR/bin/yt"
     echo
+    echo "To bootstrap a development environment for yt, run:"
+    echo 
+    echo "$DEST_DIR/bin/yt bootstrap_dev"
+    echo
     echo "Note of interest: this installation will use the directory:"
     echo "    $YT_DIR"
     echo "as the source for all the YT code.  This means you probably shouldn't"
@@ -571,7 +575,6 @@
     echo "    http://yt.enzotools.org/"
     echo "    http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org"
     echo
-    echo
     echo "========================================================================"
     echo
     echo "Oh, look at me, still talking when there's science to do!"


http://bitbucket.org/yt_analysis/yt/changeset/335276a5641b/
changeset:   r3879:335276a5641b
branch:      yt
user:        MatthewTurk
date:        2011-03-22 22:12:02
summary:     Removing the EnzoTimeSeries in favor of a single TimeSeriesData object with
class methods for construction using output_logs and filename_lists
affected #:  1 file (107 bytes)

--- a/yt/data_objects/time_series.py	Tue Mar 22 08:36:05 2011 -0700
+++ b/yt/data_objects/time_series.py	Tue Mar 22 14:12:02 2011 -0700
@@ -52,9 +52,13 @@
         return key in analysis_task_registry
 
 class TimeSeriesData(object):
-    def __init__(self, name):
-        self.outputs = []
+    def __init__(self, name, outputs = None):
+        if outputs is None: outputs = []
+        self.outputs = outputs
         self.tasks = AnalysisTaskProxy(self)
+        for type_name in data_object_registry:
+            setattr(self, type_name, functools.partial(
+                TimeSeriesDataObject, self, type_name))
 
     def __iter__(self):
         # We can make this fancier, but this works
@@ -94,27 +98,24 @@
                 return_values[-1].append(rv)
         return return_values
 
-class EnzoTimeSeries(TimeSeriesData):
-    _enzo_header = "DATASET WRITTEN "
-    def __init__(self, name, **kwargs):
-        TimeSeriesData.__init__(self, name)
-        output_list = kwargs.pop('output_list', None)
-        output_log = kwargs.pop('output_log', None)
-        if output_list: self._populate_output_list(output_list)
-        if output_log: self._populate_output_log(output_log)
-        for type_name in data_object_registry:
-            setattr(self, type_name, functools.partial(
-                TimeSeriesDataObject, self, type_name))
+    @classmethod
+    def from_filenames(cls, name, filename_list):
+        outputs = []
+        for fn in filename_list:
+            outputs.append(load(fn))
+        obj = cls(name, outputs)
+        return obj
 
-    def _populate_output_list(self, output_list):
-        for output in output_list:
-            self._insert(load(output))
-
-    def _populate_output_log(self, output_log):
+    @classmethod
+    def from_output_log(cls, name, output_log,
+                        line_prefix = "DATASET WRITTEN"):
+        outputs = []
         for line in open(output_log):
-            if not line.startswith(self._enzo_header): continue
-            fn = line[len(self._enzo_header):].strip()
-            self._insert(load(fn))
+            if not line.startswith(line_prefix): continue
+            fn = line[len(line_prefix):].strip()
+            outputs.append(load(fn))
+        obj = cls(name, outputs)
+        return obj
 
 class TimeSeriesQuantitiesContainer(object):
     def __init__(self, data_object, quantities):


http://bitbucket.org/yt_analysis/yt/changeset/a6c1c9300c4e/
changeset:   r3880:a6c1c9300c4e
branch:      yt
user:        MatthewTurk
date:        2011-03-22 22:20:03
summary:     The 'name' parameter is never used.
affected #:  1 file (30 bytes)

--- a/yt/data_objects/time_series.py	Tue Mar 22 14:12:02 2011 -0700
+++ b/yt/data_objects/time_series.py	Tue Mar 22 14:20:03 2011 -0700
@@ -52,7 +52,7 @@
         return key in analysis_task_registry
 
 class TimeSeriesData(object):
-    def __init__(self, name, outputs = None):
+    def __init__(self, outputs = None):
         if outputs is None: outputs = []
         self.outputs = outputs
         self.tasks = AnalysisTaskProxy(self)
@@ -99,22 +99,22 @@
         return return_values
 
     @classmethod
-    def from_filenames(cls, name, filename_list):
+    def from_filenames(cls, filename_list):
         outputs = []
         for fn in filename_list:
             outputs.append(load(fn))
-        obj = cls(name, outputs)
+        obj = cls(outputs)
         return obj
 
     @classmethod
-    def from_output_log(cls, name, output_log,
+    def from_output_log(cls, output_log,
                         line_prefix = "DATASET WRITTEN"):
         outputs = []
         for line in open(output_log):
             if not line.startswith(line_prefix): continue
             fn = line[len(line_prefix):].strip()
             outputs.append(load(fn))
-        obj = cls(name, outputs)
+        obj = cls(outputs)
         return obj
 
 class TimeSeriesQuantitiesContainer(object):


http://bitbucket.org/yt_analysis/yt/changeset/2be0ebb78fff/
changeset:   r3881:2be0ebb78fff
branch:      yt
user:        MatthewTurk
date:        2011-03-22 22:24:55
summary:     Fixing some imports of EnzoTimeSeries (now deceased) and adding the ability to
feed a .hierarchy file to load and get back the EnzoStaticOutput.
affected #:  3 files (205 bytes)

--- a/yt/data_objects/api.py	Tue Mar 22 14:20:03 2011 -0700
+++ b/yt/data_objects/api.py	Tue Mar 22 17:24:55 2011 -0400
@@ -51,10 +51,8 @@
     BinnedProfile2D, \
     BinnedProfile3D
 
-# Disabled for now
 from time_series import \
     TimeSeriesData, \
-    EnzoTimeSeries, \
     TimeSeriesDataObject
 
 from analyzer_objects import \


--- a/yt/frontends/enzo/data_structures.py	Tue Mar 22 14:20:03 2011 -0700
+++ b/yt/frontends/enzo/data_structures.py	Tue Mar 22 17:24:55 2011 -0400
@@ -635,6 +635,7 @@
         paarmeter file and a *conversion_override* dictionary that consists
         of {fieldname : conversion_to_cgs} that will override the #DataCGS.
         """
+        if filename.endswith(".hierarchy"): filename = filename[:-10]
         if parameter_override is None: parameter_override = {}
         self._parameter_override = parameter_override
         if conversion_override is None: conversion_override = {}
@@ -879,6 +880,8 @@
 
     @classmethod
     def _is_valid(cls, *args, **kwargs):
+        if ("%s" % (args[0])).endswith(".hierarchy"):
+            return True
         return os.path.exists("%s.hierarchy" % args[0])
 
 class EnzoStaticOutputInMemory(EnzoStaticOutput):


--- a/yt/mods.py	Tue Mar 22 14:20:03 2011 -0700
+++ b/yt/mods.py	Tue Mar 22 17:24:55 2011 -0400
@@ -47,7 +47,7 @@
     derived_field, add_field, FieldInfo, \
     ValidateParameter, ValidateDataField, ValidateProperty, \
     ValidateSpatial, ValidateGridType, \
-    EnzoTimeSeries, TimeSeriesData, AnalysisTask, analysis_task
+    TimeSeriesData, AnalysisTask, analysis_task
 
 from yt.data_objects.derived_quantities import \
     add_quantity, quantity_info

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