You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
an ops module that would effectively be a reference implementation for how to do things like concurrent requests that respect rate limits. OTOH maybe the CLI could be that reference implementation.
The text was updated successfully, but these errors were encountered:
Concurrent reuqests would be useful as a CLI for geocoder-testing.
I made this python script wrapping the Mapbox Python SDK to run large batches of queries using the Python Multiprocessing library. It should be compatible with both Python 2 (and 3 with some minor changes).
Doesn't solve the rate limiting issue without monitoring each thread for request counts.
# Multiprocess the API calls to the geocoder APITHREADS=4pool=Pool(THREADS)
#Split the dataframe into chunks=#rows, to make one request per row in the dataframe.chunks=np.array_split(df, df.shape[0])
try:
df_lst.append(
pool.map(geocoder.forward(df['query']), chunks)
)
exceptKeyboardInterrupt:
# Allow ^C to interrupt from any thread.sys.stdout.write('\033[0m')
sys.stdout.write('User Interupt\n')
pool.close()
From #13
The text was updated successfully, but these errors were encountered: