From 6edf7b7482bc10f3593a7482e3d2c516907cdafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9d=C3=A9ric=20Boquien?= Date: Wed, 19 Jun 2019 18:00:14 -0400 Subject: [PATCH] As we modify the sed object, make a deep copy so we do not accidentally alter the model in the cache. These models should probably be made read-only, if it is not too costly in terms of performance. --- pcigale/analysis_modules/pdf_analysis/workers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcigale/analysis_modules/pdf_analysis/workers.py b/pcigale/analysis_modules/pdf_analysis/workers.py index 8cc5aba4..6d143129 100644 --- a/pcigale/analysis_modules/pdf_analysis/workers.py +++ b/pcigale/analysis_modules/pdf_analysis/workers.py @@ -245,7 +245,7 @@ def bestfit(oidx, obs): else: # The model redshift is always exact in redhisfting mode corr_scaling = 1. - sed = gbl_warehouse.get_sed(gbl_params.modules, params) + sed = deepcopy(gbl_warehouse.get_sed(gbl_params.modules, params)) # Handle the case where the distance does not correspond to the redshift. if obs.redshift >= 0.: -- GitLab