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_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 projection_vort(pf):
    proj = pf.h.proj(0, "VorticitySquared", "Density")

@profile_test
def profile_gzs(pf):
    dd = pf.h.all_data()
    (v_min, v_max), (div_min, div_max) = dd.quantities[
        "Extrema"](["VorticitySquared", "DivV"])
    prof = BinnedProfile2D(dd,
                128, "VorticitySquared", v_min, v_max, True,
                128, "DivV", div_min, div_max, False,
                           lazy_reader = True)
    prof.add_fields(["CellMassMsun"], weight=None)

@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("DD0039/output_0039", data_style="enzo_packed_3d")

run_all_tests(pf, 1, True)