yt.profiling_support / run_profiling.py

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)
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.