'''
Register pipeline segments to be performed on data during a run

.. note::

    Globals will NOT be preserved in these transformations. See the
    :py:mod:`dill` docs for more info.
'''

from __future__ import absolute_import
import pipelines

@pipelines.prep_func
def tasmin_under_32F(ds):
    '''
    Count of days with tasmin under 32F/0C
    '''
    return ds.tasmin.where((ds.tasmin- 273.15) < 0).count(dim='time')


@pipelines.prep_func
def tasmax_over_95F(ds):
    '''
    Count of days with tasmax over 95F/35C
    '''
    return ds.tasmax.where((ds.tasmax- 273.15) > 35).count(dim='time')


@pipelines.prep_func
def average_seasonal_temp(ds):
    '''
    Average seasonal tas
    '''
    return ds.tas.groupby('time.season').mean(dim='time')

@@ -737,20 +737,308 @@
 ').mean(dim='time')%0A
+%0A%0A@pipelines.prep_func%0Adef tasmax_over_27C(ds):%0A    '''%0A    Count of days with tasmax gte 27C%0A    '''%0A%0A    ds%5B'gte_27'%5D = ds.tasmax.where((ds.tasmax -273.15) %3E= 27.).count(dim='time')%0A    ds%5B'gt_0_lte_27'%5D = ds.tasmax.where(0 %3C ds.tasmax - 273.15 %3C 27).count(dim='time')%0A%0A%0A    return %0A%0A%0A%0A

add tasmaxge27