[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri May 9 08:08:25 PDT 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/8513f7790700/
Changeset:   8513f7790700
Branch:      yt-3.0
User:        xarthisius
Date:        2014-05-09 11:15:08
Summary:     [doc] use proper file as input
Affected #:  1 file

diff -r a14a150c7c81850df81346162bdaff271e77eb50 -r 8513f7790700b5b7454fc389cd9bec9da25fc85f doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
--- a/doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
+++ b/doc/source/analyzing/analysis_modules/ellipsoid_analysis.rst
@@ -58,7 +58,7 @@
   from yt.mods import *
   from yt.analysis_modules.halo_finding.api import *
 
-  pf=load('RD0006/RD0006')
+  pf=load('Enzo_64/RD0006/RedshiftOutput0006')
   halo_list = parallelHF(pf)
   halo_list.dump('MyHaloList')
 
@@ -69,7 +69,7 @@
   from yt.mods import *
   from yt.analysis_modules.halo_finding.api import *
 
-  pf=load('RD0006/RD0006')
+  pf=load('Enzo_64/RD0006/RedshiftOutput0006')
   haloes = LoadHaloes(pf, 'MyHaloList')
 
 Once the halo information is saved you can load it into the data


https://bitbucket.org/yt_analysis/yt/commits/ad9fdc533f59/
Changeset:   ad9fdc533f59
Branch:      yt-3.0
User:        xarthisius
Date:        2014-05-09 13:03:41
Summary:     [doc] Rely on load() for finding test_data_dir, don't assume that notebook is evaluated in a writtable environment, clean temporary files
Affected #:  1 file

diff -r 8513f7790700b5b7454fc389cd9bec9da25fc85f -r ad9fdc533f590f0cb60316f731a8e5df54736f51 doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
--- a/doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
+++ b/doc/source/analyzing/analysis_modules/Halo_Analysis.ipynb
@@ -36,10 +36,15 @@
      "input": [
       "from yt.mods import *\n",
       "from yt.analysis_modules.halo_analysis.api import *\n",
-      "path = ytcfg.get(\"yt\", \"test_data_dir\")\n",
+      "import tempfile\n",
+      "import shutil\n",
+      "import os\n",
+      "\n",
+      "# Create temporary directory for storing files\n",
+      "tmpdir = tempfile.mkdtemp()\n",
       "\n",
       "# Load the data set with the full simulation information\n",
-      "data_pf = load(path+'Enzo_64/RD0006/RedshiftOutput0006')"
+      "data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')"
      ],
      "language": "python",
      "metadata": {},
@@ -57,7 +62,7 @@
      "collapsed": false,
      "input": [
       "# Load the rockstar data files\n",
-      "halos_pf = load(path+'rockstar_halos/halos_0.0.bin')"
+      "halos_pf = load('rockstar_halos/halos_0.0.bin')"
      ],
      "language": "python",
      "metadata": {},
@@ -76,7 +81,7 @@
      "input": [
       "# Instantiate a catalog using those two paramter files\n",
       "hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf, \n",
-      "                 output_dir = path+'halo_catalog')"
+      "                 output_dir=os.path.join(tmpdir, 'halo_catalog'))"
      ],
      "language": "python",
      "metadata": {},
@@ -202,8 +207,8 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "hc.add_callback('sphere', radius_field='radius_200', factor = 5,\n",
-      "        field_parameters = dict(virial_radius=('quantity','radius_200')))"
+      "hc.add_callback('sphere', radius_field='radius_200', factor=5,\n",
+      "                field_parameters=dict(virial_radius=('quantity', 'radius_200')))"
      ],
      "language": "python",
      "metadata": {},
@@ -221,9 +226,9 @@
      "collapsed": false,
      "input": [
       "hc.add_callback('profile', 'virial_radius', [('gas','temperature')],\n",
-      "        storage = 'virial_profiles',\n",
-      "        weight_field = 'cell_mass', \n",
-      "        accumulation=False, output_dir='profiles')\n"
+      "                storage='virial_profiles',\n",
+      "                weight_field='cell_mass', \n",
+      "                accumulation=False, output_dir='profiles')\n"
      ],
      "language": "python",
      "metadata": {},
@@ -290,9 +295,10 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "halos_pf =  load(path+'halo_catalog/halo_catalog.0.h5')\n",
+      "halos_pf =  load(os.path.join(tmpdir, 'halo_catalog/halo_catalog.0.h5'))\n",
       "\n",
-      "hc_reloaded = HaloCatalog(halos_pf=halos_pf, output_dir=path+'halo_catalog')"
+      "hc_reloaded = HaloCatalog(halos_pf=halos_pf,\n",
+      "                          output_dir=os.path.join(tmpdir, 'halo_catalog'))"
      ],
      "language": "python",
      "metadata": {},
@@ -309,8 +315,8 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "hc_reloaded.add_callback('load_profiles',storage='virial_profiles',\n",
-      "        output_dir='profiles')"
+      "hc_reloaded.add_callback('load_profiles', storage='virial_profiles',\n",
+      "                         output_dir='profiles')"
      ],
      "language": "python",
      "metadata": {},
@@ -362,7 +368,10 @@
       "halo = hc_reloaded.halo_list[0]\n",
       "\n",
       "radius = halo.virial_profiles['virial_radius']\n",
-      "temperature = halo.virial_profiles[u\"('gas', 'temperature')\"]"
+      "temperature = halo.virial_profiles[u\"('gas', 'temperature')\"]\n",
+      "\n",
+      "# Remove output files, that are no longer needed\n",
+      "shutil.rmtree(tmpdir)"
      ],
      "language": "python",
      "metadata": {},
@@ -382,7 +391,7 @@
       "%matplotlib inline\n",
       "import matplotlib.pyplot as plt\n",
       "\n",
-      "plt.plot(radius,temperature)\n",
+      "plt.plot(radius, temperature)\n",
       "\n",
       "plt.semilogy()\n",
       "plt.xlabel('$\\mathrm{R/R_{vir}}$')\n",

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