This is my old function, which still works:

def _get_scalar_func(_ptype, field_name, unit_dict):
  def _scalar(field, data):
    old_data=data[_ptype, field_name]
    x_old_units=unyt.unyt_array(old_data.value*unit_dict[field_name][0], 
units=unit_dict[field_name][1], registry=data.ds.unit_registry)
    return x_old_units.to(unit_dict[field_name][2])
  return _scalar
_______________________________________________
yt-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: [email protected]

Reply via email to