Skip to content

Commit

Permalink
store id_list
Browse files Browse the repository at this point in the history
  • Loading branch information
PeiShang committed Apr 12, 2018
1 parent 710780d commit 2e6bb0c
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/opendota2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

102 changes: 62 additions & 40 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions opendota2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def __get_top_team_matches(low_lim, up_lim):
team_matches_ids = [match['match_id'] for match in team_matches]
break
except Exception as e:
time.sleep(10)
time.sleep(3)
matches_lst += team_matches_ids
team_count += 1
__progressBar(team_count, up_lim - low_lim)
Expand Down Expand Up @@ -633,8 +633,7 @@ def get_top_team_matches_dataframe(low_lim, up_lim):
matches_id_lst, top_teams_rating_dict = __get_top_team_matches(low_lim, up_lim)
with open("./matches_lst.csv", "w") as matches_lst_file:
wr = csv.writer(matches_lst_file)
for match_id in matches_id_lst:
wr.writerow(match_id)
wr.writerow(matches_id_lst)

columns = ['Radiant_team_id','Radiant_team_rating', 'Dire_team_id', 'Dire_team_rating',
'Radiant_hero1', 'Radiant_hero2', 'Radiant_hero3', 'Radiant_hero4', 'Radiant_hero5',
Expand Down Expand Up @@ -680,7 +679,7 @@ def get_top_team_matches_dataframe(low_lim, up_lim):
df_match_data.loc[count, 'start_time'] = start_time
break
except Exception as e:
time.sleep(10)
time.sleep(3)
count += 1
__progressBar(count, total_len)
return df_match_data
Expand Down
1 change: 1 addition & 0 deletions test/matches_lst.csv

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
'''Test the api'''
import opendota2 as op

# get top 100 team matches
matches_df = op.get_top_team_matches_dataframe(100)
# get top 10 team matches
matches_df = op.get_top_team_matches_dataframe(0, 2)

0 comments on commit 2e6bb0c

Please sign in to comment.