def METHOD_NAME(self, htype, **properties):
    """Add properties to the halos in the most recently added timestep.
    For each kwarg, pass in a function mapping the halo number to the named property
    e.g. add_properties_to_halos(Mvir=lambda i: 100.*(10-i)) adds a Mvir value of 100*(10-halo_number)
     to each halo"""
    for k, v in properties.items():
        for halo in self._most_recently_added_timestep().objects.filter_by(object_typecode=htype).all():
            halo[k] = v(halo.halo_number)