def compute_bmp_effect(census, m2_per_pixel, precip):
    """
    Compute the overall amount of water retained by infiltration/retention
    type BMP's.

    Result is a percent of runoff remaining after water is trapped in
    infiltration/retention BMP's
    """
    meters_per_inch = 0.0254
    cubic_meters = census['runoff-vol'] * meters_per_inch * m2_per_pixel
    # 'runoff-vol' in census is in inches*#cells
    bmp_dict = census.get('BMPs', {})
    bmp_keys = set(bmp_dict.keys())


    reduction = 0.0
    for bmp in set.intersection(set(get_bmps()), bmp_keys):
        bmp_area = bmp_dict[bmp]
        storage_space = (lookup_bmp_storage(bmp) * bmp_area)
        max_reduction = lookup_bmp_drainage_ratio(bmp) * bmp_area * precip * meters_per_inch
        bmp_reduction = min(max_reduction, storage_space)
        reduction += bmp_reduction

    return 0 if not cubic_meters else \
        max(0.0, cubic_meters - reduction) / cubic_meters