ADI-Labs / density

wireless density API
13 stars 26 forks source link

Added percent_full data to all api routes. #108

Closed swbae31 closed 9 years ago

swbae31 commented 9 years ago
evantarrh commented 9 years ago

nice :+1:

jzf2101 commented 9 years ago

Yay :+1:

natebrennand commented 9 years ago

This logic is replicated in 7 places, maybe we can put it in a function?

capacity_list = calculate_fullness_percentage(fetched_data)

# Add fullness percentage to data
for data, capacity in zip(fetched_data, capacity_list):
    data['percent_full'] = capacity

Maybe change calculate_fullness_percentage to add the percent_full value and return the full array? calculate_fullness_percentage --> annotate_fullness_percentage ?

natebrennand commented 9 years ago

it would also be sick if you added a unit test for this so that we don't break it in the future

jzf2101 commented 9 years ago

:+1:

natebrennand commented 9 years ago

can you add a test for annotate_fullness_percentage?

thebrianzeng commented 9 years ago

add the test we wrote today! you should actually get the real capacity for the locations though and test more than one location.

On Fri Feb 20 2015 at 6:20:48 PM Nate notifications@github.com wrote:

can you add a test for annotate_fullness_percentage?

— Reply to this email directly or view it on GitHub https://github.com/adicu/density/pull/108#issuecomment-75337690.

jzf2101 commented 9 years ago

Yay :+1:

thebrianzeng commented 9 years ago

:+1: