0

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?

bhjghjh
  • 889
  • 3
  • 16
  • 42
  • Can you post the line the error occurs on? – mechanical_meat Jun 30 '16 at 15:46
  • @bernie, this is the whole error msg, it doesn't say anything else – bhjghjh Jun 30 '16 at 15:52
  • 1
    Are you sure that the code you have in your question is the same as the code you're running? That error indicates your code isn't parseable, but the code in your question is. See e.g. http://stackoverflow.com/questions/16327405/syntaxerror-unexpected-eof-while-parsing – ngoldbaum Jun 30 '16 at 16:24

0 Answers0