yt / yt / frontends / stream / tests / test_update_data.py

from yt.testing import *
from yt.data_objects.profiles import BinnedProfile1D
from numpy.random import uniform

def setup():
    global pf
    pf = fake_random_pf(64, nprocs=8)
    pf.h
    
def test_update_data() :
    dims = (32,32,32)
    grid_data = [{"Temperature":uniform(size=dims)}
                 for i in xrange(pf.h.num_grids)]
    pf.h.update_data(grid_data)
    prj = pf.h.proj(2, "Temperature")
    prj["Temperature"]
    dd = pf.h.all_data()
    profile = BinnedProfile1D(dd, 10, "Density",
                              dd["Density"].min(),
                              dd["Density"].max())
    profile.add_fields(["Temperature"])
    profile["Temperature"]
                              
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.