Skip to content

Commit

Permalink
Adding "small_enzo"
Browse files Browse the repository at this point in the history
--HG--
branch : yt
  • Loading branch information
matthewturk committed Feb 8, 2015
1 parent db8975e commit 9b0df7b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions benchmarks/benchmarks/small_enzo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import numpy as np
import yt

class SmallEnzoSuite:
dsname = "IsolatedGalaxy/galaxy0030/galaxy0030"
def setup(self):
self.ds = yt.load(self.dsname)

def time_all_particles(self):
dd = self.ds.all_data()
dd["all", "particle_velocity_x"]
dd["all", "particle_velocity_y"]
dd["all", "particle_velocity_z"]

def time_all_particles_derived(self):
dd = self.ds.all_data()
dd["all", "particle_velocity_magnitude"]

def time_gas_read(self):
dd = self.ds.all_data()
dd["gas", "density"]

def time_gas_derived(self):
dd = self.ds.all_data()
dd["gas", "velocity_magnitude"]

def time_project_unweight(self):
proj = self.ds.proj("density", 0)

def time_project_weight(self):
proj = self.ds.proj("density", 0, "density")

def time_ghostzones(self):
dd = self.ds.all_data()
dd["velocity_divergence"]

def time_particle_quantities(self):
dd = self.ds.all_data()
dd.quantities.extrema("particle_mass")
dd.quantities.extrema("particle_velocity_magnitude")
dd.quantities.extrema(["particle_velocity_%s" % ax for ax in 'xyz'])

def time_gas_quantites(self):
dd = self.ds.all_data()
dd.quantities.extrema("density")
dd.quantities.extrema(["velocity_x", "velocity_y", "velocity_z"])

0 comments on commit 9b0df7b

Please sign in to comment.