<jupyter_start><jupyter_text>Major use of flash lookup<jupyter_code>import lookup_table as lt
import dill as pickle
import numpy as np
import time<jupyter_output><empty_output><jupyter_text>Load pre-compiled data dictionary<jupyter_code>data_dict = pickle.load(open('80bar_12C_data_dict.pkl', 'rb'))
data_dict.keys()
table = lt.quick_lookup(data_dict)<jupyter_output><empty_output><jupyter_text>Generate random composition<jupyter_code>wf = 0.9
z = np.random.random(4) * np.asarray([wf, 1-wf, 1-wf, 1-wf])
z = z / np.sum(z)
z = [0, 0, 1, 0]
t = time.time()
result = table.flash(np.asarray(z))
print('Elapsed time is', time.time() - t)
print(result)
z<jupyter_output>('Elapsed time is', 0.00042510032653808594)
([2], (array([0, 0, 1, 0]), array([ 1.]), 1e-06, 1e-06), 1e-06)
{'fraction_non_alphanumeric': 0.16558861578266496, 'fraction_numerical': 0.0646830530401035, 'mean_word_length': 6.588235294117647, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '257784', 'license': 'MIT', 'n_tokens_mistral': 363, 'n_tokens_neox': 320, 'n_words': 67, 'path': 'notebooks/Quick Flash.ipynb', 'repo_name': 'kdarnell/injection-sim-python', 'size': '773'}