Exemplo n.º 1
0
def get_releases_by_amount_of_bidders(releases):
    '''Returns a dictionary with the
       number of bidders as the keys and
       lists of releases as the values.
    '''

    releases_by_number = {}
    for release in releases:
        number = get_number_of_bidders(release)
        if number in releases_by_number:
            releases_by_number[number].append(release)
        else:
            releases_by_number[number] = [release]
    return releases_by_number
def create_scatter_plot(releases):

    number_of_bidders = []
    delta_time = []

    for release in releases:
        start = get_start_date(release)
        award = get_award_date(release)
        delta = get_difference_in_days(start, award)

        delta_time.append(delta)
        number_of_bidders.append(get_number_of_bidders(release))

    scatter_plot = scatter(delta_time, number_of_bidders,
                           fill_alpha=0.2, size=10,
                           name="period between start of tender period and award date vs amount of bidders")

    scatter_plot.title = "period vs. bidders"
    xaxis()[0].axis_label = "Days"
    yaxis()[0].axis_label = "Number of Bidders"

    show()
Exemplo n.º 3
0
def test_get_number_of_bidders(release):
    assert get_number_of_bidders(release) == 1