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

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Jul 16 08:51:46 PDT 2016


1 new commit in yt:

https://bitbucket.org/yt_analysis/yt/commits/77c1b9653da7/
Changeset:   77c1b9653da7
Branch:      yt
User:        ngoldbaum
Date:        2016-07-16 15:51:18+00:00
Summary:     Merged in MatthewTurk/yt (pull request #2265)

Adding slice repetition for ds.r
Affected #:  2 files

diff -r a4348e453b3f9121fb5abbd2322662d3a84caffc -r 77c1b9653da76332bfe6baccb489f1973ee3c0b1 doc/source/analyzing/objects.rst
--- a/doc/source/analyzing/objects.rst
+++ b/doc/source/analyzing/objects.rst
@@ -131,6 +131,16 @@
 
    ds.r[:,-180:0,:]
 
+If you specify a single slice, it will be repeated along all three dimensions.
+For instance, this will give all data:::
+
+   ds.r[:]
+
+And this will select a box running from 0.4 to 0.6 along all three
+dimensions:::
+
+   ds.r[0.4:0.6]
+
 Selecting Fixed Resolution Regions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 

diff -r a4348e453b3f9121fb5abbd2322662d3a84caffc -r 77c1b9653da76332bfe6baccb489f1973ee3c0b1 yt/data_objects/region_expression.py
--- a/yt/data_objects/region_expression.py
+++ b/yt/data_objects/region_expression.py
@@ -37,6 +37,8 @@
             return self.all_data[item]
         if isinstance(item, tuple) and isinstance(item[1], string_types):
             return self.all_data[item]
+        if isinstance(item, slice):
+            item = (item, item, item)
         if len(item) != self.ds.dimensionality:
             # Not the right specification, and we don't want to do anything
             # implicitly.

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