<jupyter_start><jupyter_text>** In this Jupyter Notebook, the absolute + sensitivity analysis results are generated for a One-at-a-time sensitivity analysis of cooling time for the proliferation risk evaluation metric. The reason why this metric is separated from the others is that you need the -exp version of each sqlite and pyne on your machine to make it work **<jupyter_code>import cymetric as cym
from cymetric import timeseries
import matplotlib as plt 
import pandas as pd
import numpy as np
import sys 
sys.path.insert(0, '../../../scripts/')
import output as oup<jupyter_output>/Users/gwenchee/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.data is not yet QA compliant.
  return f(*args, **kwds)
/Users/gwenchee/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.material is not yet QA compliant.
  return f(*args, **kwds)
/Users/gwenchee/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: QAWarning: pyne.enrichment is not yet QA compliant.
  return f(*args, **kwds)<jupyter_text>This is when you already have the results<jupyter_code>df_p = pd.read_csv('ct-df-pu.csv',index_col='CT')
df_p<jupyter_output><empty_output><jupyter_text>The rest of the code below is to generate the above results<jupyter_code>starter_string = 'CT'
scenario_nums = ['0','2','4','6','8']
df_p = oup.initialize_df(scenario_index=starter_string,
                                 scenarios_nums=scenario_nums)
df_p['Max Pu in all CP'] = 0
df_p['Pu Quality in all CP at Max Pu'] = 0
df_p['Max Pu in HLW'] = 0
df_p['Pu Quality in HLW at Max Pu'] = 0
df_p['Max Pu in all RPR'] = 0
df_p['Pu Quality in all RPR at Max Pu'] = 0
output_start = '../cyclus-files/oat/cooling-time/ct'
ev_dict = {}
for x in range(len(scenario_nums)): 
    output_file = output_start + scenario_nums[x]+'-exp.sqlite'
    ev_dict[scenario_nums[x]] = cym.Evaluator(db=cym.dbopen(output_file),write=True)
for x in range(len(scenario_nums)): 
    cp = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['lwrstorage','moxstorage','frstorage'],nucs=['pu-238','pu-239','pu-240','pu-241','pu-242','pu-244'])['Quantity']
    fissile_cp = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['lwrstorage','moxstorage','frstorage'],nucs=['pu-239','pu-241'])['Quantity']
    df_p.loc[scenario_nums[x],'Max Pu in all CP'] = cp.max()
    df_p.loc[scenario_nums[x],'Pu Quality in all CP at Max Pu'] = fissile_cp[cp.idxmax()]/cp.max()
    hlw = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['enrichmentsink','lwrsink','moxsink','frsink'],nucs=['pu-238','pu-239','pu-240','pu-241','pu-242','pu-244'])['Quantity']
    fissile_hlw = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['enrichmentsink','lwrsink','moxsink','frsink'],nucs=['pu-239','pu-241'])['Quantity']
    df_p.loc[scenario_nums[x],'Max Pu in HLW'] = hlw.max()
    df_p.loc[scenario_nums[x],'Pu Quality in HLW at Max Pu'] = fissile_hlw[hlw.idxmax()]/hlw.max()
    rpr = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['lwrreprocessing','moxreprocessing','frreprocessing'],nucs=['pu-238','pu-239','pu-240','pu-241','pu-242','pu-244'])['Quantity']
    fissile_rpr = cym.timeseries.inventories(ev_dict[scenario_nums[x]],facilities=['lwrreprocessing','moxreprocessing','frreprocessing'],nucs=['pu-239','pu-241'])['Quantity']
    df_p.loc[scenario_nums[x],'Max Pu in all RPR'] = rpr.max()
    df_p.loc[scenario_nums[x],'Pu Quality in all RPR at Max Pu'] = fissile_rpr[rpr.idxmax()]/rpr.max()
df_p.to_csv('ct-df-pu.csv')
df_p_sa = oup.sensitivity(2,df_p)
df_p_sa
df_p_sa.to_csv('ct-df-pu-sa.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1675809105869446, 'fraction_numerical': 0.02825013713658804, 'mean_word_length': 6.013461538461539, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '226800', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1412, 'n_words': 260, 'path': 'dakota/oat/cooling-time/cooling-time-pu.ipynb', 'repo_name': 'arfc/dcwrapper', 'size': '3646'}