How to use the formulas.init_learned function in formulas

To help you get started, we’ve selected a few formulas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sagefy / sagefy / simulation / sequencer.py View on Github external
'name': learner['name'],
        'learned': init_learned,
    } for learner in learners]

    latest_response_per_learner = {}

    for i, response in enumerate(responses):
        # response keys: learner, card, time, score

        if response['learner'] in latest_response_per_learner:
            prev_response = latest_response_per_learner[response['learner']]
            prev_card = get_card(prev_response['card'], my_cards)
        else:
            prev_response = {
                'time': response['time'],
                'prev_learned': init_learned,
            }
            prev_card = {
                'transit': init_transit,
                'transit_weight': init_weight,
            }

        my_learner = get_learner(response['learner'], my_learners)
        my_card = get_card(response['card'], my_cards)

        response['prev_learned'] = my_learner['learned']

        c = update(learned=my_learner['learned'],
                   guess=my_card['guess'],
                   guess_weight=my_card['guess_weight'],
                   slip=my_card['slip'],
                   slip_weight=my_card['slip_weight'],