import gc import pickle import zlib import numpy import pandas from pandas._libs.tslib import Timestamp from hwgen.common import init_objects, get_user_data, get_all_assignments, get_student_list, make_gb_question_map cats, cat_lookup, all_qids, _, _, levels, cat_ixs, cat_page_lookup, lev_page_lookup, all_page_ids = init_objects(-1) reverse_qid_dict = {} for ix,q in enumerate(all_qids): reverse_qid_dict[q]=ix from hwgen.profiler import get_attempts_from_db, get_age_df profile_cache="../../../isaac_data_files/gengen_cache/" base = "../../../isaac_data_files/" prof_fname = base+"gengen_profiles.pkl" dob_cache = base+"dob_cache.pkl" LOAD_FROM_PROF_CACHE = True SAVE_TO_PROF_CACHE = True def ass_extract(ass): id = ass[1]["id"] ts = ass[1]['creation_date'] gb_id = ass[1]["gameboard_id"]
import datetime import pickle from math import nan import numpy import pandas as pd from pandas._libs.tslib import NaTType from hwgen.common import extract_runs_w_timestamp_df2, n_components, n_concepts, init_objects, make_db_call profile_cache = "../../../isaac_data_files/profile_cache/" LOAD_FROM_CACHE = False SAVE_TO_CACHE = True cats, cat_lookup, all_qids, users, diffs, levels, cat_ixs, cat_page_lookup, level_page_lookup, all_page_ids = init_objects( -1) def profile_student(psi, age, ts, cats, cat_lookup, cat_ixs, levels, concepts_all, df, cache, attempts_df=None): pf = profile_student_enc(psi, age, ts, cats, cat_lookup, cat_ixs, levels, concepts_all, df, cache, attempts_df)