In [1]:
%matplotlib inline
import yt
In [2]:
ds = yt.load("GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0300")
yt : [WARNING  ] 2014-04-22 16:23:22,072 integer runtime parameter checkpointfilenumber overwrites a simulation scalar of the same name
yt : [WARNING  ] 2014-04-22 16:23:22,073 integer runtime parameter forcedplotfilenumber overwrites a simulation scalar of the same name
yt : [WARNING  ] 2014-04-22 16:23:22,073 integer runtime parameter nbegin overwrites a simulation scalar of the same name
yt : [WARNING  ] 2014-04-22 16:23:22,073 integer runtime parameter plotfilenumber overwrites a simulation scalar of the same name
yt : [INFO     ] 2014-04-22 16:23:22,089 Parameters: current_time              = 9.46712365603e+16
yt : [INFO     ] 2014-04-22 16:23:22,090 Parameters: domain_dimensions         = [8 8 8]
yt : [INFO     ] 2014-04-22 16:23:22,091 Parameters: domain_left_edge          = [ -3.08560000e+24  -3.08560000e+24  -3.08560000e+24]
yt : [INFO     ] 2014-04-22 16:23:22,091 Parameters: domain_right_edge         = [  3.08560000e+24   3.08560000e+24   3.08560000e+24]
yt : [INFO     ] 2014-04-22 16:23:22,092 Parameters: cosmological_simulation   = 0.0
In [3]:
slc = yt.SlicePlot(ds, [1.0,1.0,1.0], ["density"])
slc.set_axes_unit("code_length")
slc.show()
yt : [INFO     ] 2014-04-22 16:23:22,647 Loading field plugins.
yt : [INFO     ] 2014-04-22 16:23:22,647 Loaded angular_momentum (8 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,648 Loaded astro (14 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,648 Loaded cosmology (20 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,649 Loaded fluid (54 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,651 Loaded fluid_vector (86 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,652 Loaded geometric (101 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,652 Loaded local (101 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,652 Loaded magnetic_field (107 new fields)
yt : [INFO     ] 2014-04-22 16:23:22,653 Loaded species (107 new fields)
yt : [INFO     ] 2014-04-22 16:23:23,371 xlim = -3085599999999999991611392.000000 3085599999999999991611392.000000
yt : [INFO     ] 2014-04-22 16:23:23,371 ylim = -3085599999999999991611392.000000 3085599999999999991611392.000000
---------------------------------------------------------------------------
UnitParseError                            Traceback (most recent call last)
<ipython-input-3-0fc19cdcfd4d> in <module>()
      1 slc = yt.SlicePlot(ds, [1.0,1.0,1.0], ["density"])
----> 2 slc.set_axes_unit("code_length")
      3 slc.show()

/Users/jzuhone/Source/yt-3.x/yt/visualization/plot_container.pyc in newfunc(*args, **kwargs)
     54         rv = f(*args, **kwargs)
     55         args[0]._plot_valid = False
---> 56         args[0]._setup_plots()
     57         return rv
     58     return newfunc

/Users/jzuhone/Source/yt-3.x/yt/visualization/plot_window.pyc in _setup_plots(self)
    713             aspect = np.float64(self.pf.quan(1.0, unit_y)/self.pf.quan(1.0, unit_x))
    714 
--> 715             extentx = [(self.xlim[i] - xc).in_units(unit_x) for i in (0, 1)]
    716             extenty = [(self.ylim[i] - yc).in_units(unit_y) for i in (0, 1)]
    717 

/Users/jzuhone/Source/yt-3.x/yt/units/yt_array.pyc in in_units(self, units)
    374 
    375         """
--> 376         new_units = self._unit_repr_check_same(units)
    377         conversion_factor = self.units.get_conversion_factor(new_units)
    378 

/Users/jzuhone/Source/yt-3.x/yt/units/yt_array.pyc in _unit_repr_check_same(self, units)
    320         # let Unit() handle units arg if it's not already a Unit obj.
    321         if not isinstance(units, Unit):
--> 322             units = Unit(units, registry = self.units.registry)
    323 
    324         if not self.units.same_dimensions_as(units):

/Users/jzuhone/Source/yt-3.x/yt/units/unit_object.pyc in __new__(cls, unit_expr, cgs_value, dimensions, registry, **assumptions)
    186         else:
    187             # lookup the unit symbols
--> 188             cgs_value, dimensions = _get_unit_data_from_expr(unit_expr, registry.lut)
    189 
    190         # Create obj with superclass construct.

/Users/jzuhone/Source/yt-3.x/yt/units/unit_object.pyc in _get_unit_data_from_expr(unit_expr, unit_symbol_lut)
    439     # Now for the sympy possibilities
    440     if isinstance(unit_expr, Symbol):
--> 441         return _lookup_unit_symbol(str(unit_expr), unit_symbol_lut)
    442 
    443     if isinstance(unit_expr, Number):

/Users/jzuhone/Source/yt-3.x/yt/units/unit_object.pyc in _lookup_unit_symbol(symbol_str, unit_symbol_lut)
    506     # no dice
    507     raise UnitParseError("Could not find unit symbol '%s' in the provided " \
--> 508                          "symbols." % symbol_str)
    509 
    510 def validate_dimensions(dimensions):

UnitParseError: Could not find unit symbol 'code_length' in the provided symbols.
In [ ]: