Esempio n. 1
0
def run_tortoise(from_scratch,
                 last_names_thresholds=None,
                 single_threaded=False):

    _prepare_tortoise_cache()


    from invenio.bibauthorid_tortoise import tortoise, \
        tortoise_from_scratch, tortoise_last_name, tortoise_last_names

    if single_threaded and last_names_thresholds:
        for last_name, threshold in last_names_thresholds.items():
            tortoise_last_name(last_name,
                               wedge_threshold=threshold,
                               from_mark=from_scratch)
    elif last_names_thresholds:
        names_with_args = list()
        for last_name, threshold in last_names_thresholds.items():
            kwargs = dict()
            if from_scratch:
                kwargs['from_mark'] = from_scratch
            else:
                kwargs['pure'] = from_scratch
            if threshold:
                args = (last_name, threshold)
            else:
                args = (last_name, )
            names_with_args.append((args, kwargs))
        tortoise_last_names(names_with_args)
    elif from_scratch:
        tortoise_from_scratch()
    else:
        start_time = get_db_time()
        tortoise_db_name = 'tortoise'

        last_run = get_user_logs(userinfo=tortoise_db_name,
                                 only_most_recent=True)
        if last_run:
            modified = get_modified_papers_since(last_run[0][2])
        else:
            modified = []
        tortoise(modified)

        insert_user_log(tortoise_db_name,
                        '-1',
                        '',
                        '',
                        '',
                        timestamp=start_time)
Esempio n. 2
0
def run_tortoise(from_scratch):
    from invenio.bibauthorid_tortoise import tortoise, tortoise_from_scratch

    if from_scratch:
        tortoise_from_scratch()
    else:
        start_time = get_sql_time()
        tortoise_db_name = 'tortoise'

        last_run = get_user_log(userinfo=tortoise_db_name, only_most_recent=True)
        if last_run:
            modified = get_recently_modified_record_ids(last_run[0][2])
        else:
            modified = []
        tortoise(modified)

    insert_user_log(tortoise_db_name, '-1', '', '', '', timestamp=start_time)
Esempio n. 3
0
def run_tortoise(from_scratch):
    from invenio.bibauthorid_tortoise import tortoise, tortoise_from_scratch

    if from_scratch:
        tortoise_from_scratch()
    else:
        start_time = get_db_time()
        tortoise_db_name = 'tortoise'

        last_run = get_user_logs(userinfo=tortoise_db_name,
                                 only_most_recent=True)
        if last_run:
            modified = get_modified_papers_since(last_run[0][2])
        else:
            modified = []
        tortoise(modified)

    insert_user_log(tortoise_db_name, '-1', '', '', '', timestamp=start_time)
Esempio n. 4
0
def initial_disambiguation():
    from invenio.bibauthorid_tortoise import tortoise_from_scratch
    from invenio.bibauthorid_personid_maintenance import duplicated_tortoise_results_exist
    tortoise_from_scratch()
    assert duplicated_tortoise_results_exist()
from invenio.bibauthorid_tortoise import tortoise, tortoise_from_scratch

#tortoise()
tortoise_from_scratch()
Esempio n. 6
0
def initial_disambiguation():
    from invenio.bibauthorid_tortoise import tortoise_from_scratch
    from invenio.bibauthorid_personid_maintenance import check_results
    tortoise_from_scratch()
    assert check_results()
Esempio n. 7
0
def initial_disambiguation():
    from invenio.bibauthorid_tortoise import tortoise_from_scratch
    from invenio.bibauthorid_personid_maintenance import check_results
    tortoise_from_scratch()
    assert check_results()
Esempio n. 8
0
def initial_disambiguation():
    from invenio.bibauthorid_tortoise import tortoise_from_scratch
    from invenio.bibauthorid_personid_maintenance import duplicated_tortoise_results_exist
    tortoise_from_scratch()
    assert duplicated_tortoise_results_exist()