Import('*')
helper = ['#source/lib/helpers/example_helpers.py']
savedata = ['#source/lib/JMSLab/SaveData.py']
autofill = ['#source/lib/JMSLab/autofill.py']
data = ['#output/derived/example/NFK_replicated.csv']

source = ['#source/derived/example/make_data.py',
          "#source/raw/example/data/nfk_table3.jsonl", 
          "#source/raw/example/data/nfk_constants.json"] + savedata 
target = data
env.Python(target, source)

source_files = [
    '#source/derived/example/estimate_mle.py', 
    "#source/derived/example/make_data.py",
] + data
target = ['#output/derived/example/estimates_mle.json']
env.Python(target, source_files)

source_files = [
    '#source/derived/example/draw_bootstrap.py',
    '#output/derived/example/estimates_mle.json',
    '#source/lib/JMSLab/misc.py',
] + data + helper + savedata
target = [
    '#output/derived/example/bootstrap_replicates.csv'
]
env.Python(target, source_files)

source_files = [
    '#source/derived/example/draw_posterior.py',
    '#source/derived/example/cw_agent_alpha.json'
] + data + savedata + helper
targets = []
for prior in ['central', 'less_optimistic', 'more_optimistic','less_pessimistic','more_pessimistic']:
    targets += [f'#datastore/output/derived_large/example/{prior}_prior_posterior_results.nc',
                f'#datastore/output/derived_large/example/{prior}_prior_posterior_results.csv']
env.Python(targets, source_files)
