Revision 9522
Added by Aaron Marcuse-Kubitza over 11 years ago
bin/tnrs_db | ||
---|---|---|
38 | 38 |
# Connect to DB |
39 | 39 |
db = sql.connect(db_config, log_debug=log) |
40 | 40 |
|
41 |
tnrs_profiler = profiling.ItersProfiler(iter_text='name') |
|
41 |
cumulative_tnrs_profiler = profiling.ItersProfiler(iter_text='name')
|
|
42 | 42 |
|
43 | 43 |
# Iterate over unscrubbed verbatim taxonlabels |
44 | 44 |
while True: |
... | ... | |
53 | 53 |
def process(): |
54 | 54 |
# Run TNRS |
55 | 55 |
log('Making TNRS request') |
56 |
tnrs_profiler.start() |
|
56 |
cumulative_tnrs_profiler.start()
|
|
57 | 57 |
try: stream = tnrs.tnrs_request(names) |
58 | 58 |
finally: |
59 |
tnrs_profiler.stop(iter_ct=len(names)) |
|
60 |
log('Cumulatively: '+tnrs_profiler.msg()) |
|
59 |
cumulative_tnrs_profiler.stop(iter_ct=len(names))
|
|
60 |
log('Cumulatively: '+cumulative_tnrs_profiler.msg())
|
|
61 | 61 |
|
62 | 62 |
log('Storing TNRS response data') |
63 | 63 |
sql_io.append_csv(db, tnrs_data, *csvs.reader_and_header(stream)) |
Also available in: Unified diff
bin/tnrs_db: tnrs_profiler: renamed to cumulative_tnrs_profiler to distinguish it from the tnrs_profiler used by tnrs.tnrs_request(), which just profiles the current request