Source

yt.profiling_support / run_profiling.py

Full commit
from yt.config import ytcfg
ytcfg["yt","loglevel"] = "20"
ytcfg["yt","serialize"] = "False"

from yt.mods import *
from profile_support import profile_test, run_all_tests, profile_runner

@profile_test
def aaa_hierarchy(pf):
    pf.h

@profile_test
def projection_density(pf):
    proj = pf.h.proj(0, "Density")

@profile_test
def projection_ones(pf):
    proj = pf.h.proj(0, "Ones")

@profile_test
def projection_velmag(pf):
    proj = pf.h.proj(0, "VelocityMagnitude", "Density")

@profile_test
def projection_divv(pf):
    proj = pf.h.proj(0, "DivV", "Density")

@profile_test
def quantities_extrema(pf):
    dd = pf.h.all_data()
    ex = dd.quantities["Extrema"](["Density", "Temperature"])
    print "QUANTITIES", ex

@profile_test
def profile_1d(pf):
    dd = pf.h.all_data()
    min_rho, max_rho = dd.quantities["Extrema"](["Density"])[0]
    prof = BinnedProfile1D(dd,
                128, "Density", min_rho, max_rho, True,
                           lazy_reader = True)
    prof.add_fields(["CellMassMsun"], weight=None)

@profile_test
def profile_2d(pf):
    dd = pf.h.all_data()
    (min_rho, max_rho), (min_T, max_T) = dd.quantities[
        "Extrema"](["Density", "Temperature"])
    prof = BinnedProfile2D(dd,
                128, "Density", min_rho, max_rho, True,
                128, "Temperature", min_T, max_T, True,
                           lazy_reader = True)
    prof.add_fields(["CellMassMsun"], weight=None)

pf = load("DD0087/DD0087", data_style="enzo_packed_3d")

run_all_tests(pf, 1, True)