Commit 2bf8b6ea authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Prevent the model computation worker from returning a view of...

Prevent the model computation worker from returning a view of This meant the entire dictionary was actually copied, wasting a lot of memory. Also adopt a usual list rather than a numpy array to store the info in pdf_analysis.
parent 2ecd5914
......@@ -194,10 +194,6 @@ class PdfAnalysis(AnalysisModule):
gbl.model_redshifts[idx_item] = item[2]
gbl.model_info[idx_item] = item[3]
# We transform model_info into an array as it is easier for
# selecting only models are the right redshift
gbl.model_info = np.array(gbl.model_info)
print('Analysing models...')
# Mask the invalid fluxes
......@@ -47,7 +47,7 @@ def sed(model_params, changed):
model_variables = np.array([[name]
for name in gbl.analysed_variables])
redshift =['redshift']
info =
info = list( # Prevents from returning a view
return model_fluxes, model_variables, redshift, info
......@@ -156,7 +156,7 @@ def analysis(obs):
return (analysed_averages,
np.array(model_fluxes[best_index, :]), # do NOT remove np.array()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment