I am having problem with creating a derived field in yt and printing it. please look at my code:
%matplotlib inline
import yt
import numpy as np
from yt import derived_field
from matplotlib import pylab
@derived_field(name = "C12", units = " ")
def _C12(field, data):
return data["cell_mass"]*data["c12 "]
ds = yt.load("~/super3d_hdf5_chk_0110")
dd = ds.all_data()
print dd.quantities.keys()
print dd["C12"]
and the following error:
File "<string>", line unknown
^
SyntaxError: unexpected EOF while parsing
I just don't see my error here, can anyone please point that out for me?