[yt-svn] commit/yt-doc: ngoldbaum: Fixing an issue with environment variables in the new stream tutorial.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Nov 2 12:48:11 PDT 2013


1 new commit in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/5ea7b96fc0e1/
Changeset:   5ea7b96fc0e1
User:        ngoldbaum
Date:        2013-11-02 20:47:32
Summary:     Fixing an issue with environment variables in the new stream tutorial.
Affected #:  1 file

diff -r 6948242c129603cdcf7bdf55eb33b48f94315fbf -r 5ea7b96fc0e147a97eeacb8ab763381eafb4caaf source/examining/Loading_Generic_Array_Data.ipynb
--- a/source/examining/Loading_Generic_Array_Data.ipynb
+++ b/source/examining/Loading_Generic_Array_Data.ipynb
@@ -204,7 +204,9 @@
      "collapsed": false,
      "input": [
       "import h5py\n",
-      "f = h5py.File(os.environ[\"YT_DATA_DIR\"]+\"/UnigridData/turb_vels.h5\", \"r\") # Read-only access to the file"
+      "from yt.config import ytcfg\n",
+      "data_dir = ytcfg.get('yt','test_data_dir')\n",
+      "f = h5py.File(data_dir+\"/UnigridData/turb_vels.h5\", \"r\") # Read-only access to the file"
      ],
      "language": "python",
      "metadata": {},
@@ -301,7 +303,7 @@
      "cell_type": "code",
      "collapsed": false,
      "input": [
-      "f = pyfits.open(os.environ[\"YT_DATA_DIR\"]+\"/UnigridData/velocity_field_20.fits.gz\")\n",
+      "f = pyfits.open(data_dir+\"/UnigridData/velocity_field_20.fits.gz\")\n",
       "f.info()"
      ],
      "language": "python",

Repository URL: https://bitbucket.org/yt_analysis/yt-doc/

--

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