When reading an old all_models table which does not have the kinmapchi2 column, the column was added but calculating the kinmapchi2 values did not work (silently...). This is fixed in this PR which - as discussed in a recent hack session - has been extracted from PR #322 for quicker merging. Until then, #322 will remain demoted to draft.
Remark:
Separated reading an existing all_models table (AllModels.read_model_table()) from updating it (AllModels.update_model_table()) to avoid problems with the configuration object (config_reader.py takes care of this).
Successfully tested with test_nnls.py and both weight solvers to verify that a deleted kinmapchi2 column gets re-added upon reading the all models table. Also, test_notebooks.sh succeeds.
Test suggestion:
Run the original test_nnls.py.
In test_nnls.py:36, set reset_existing_output=False.
In all_models.ecsv, delete the kinmapchi2 column (headline + 3 values) and its entry in the header (entire line 14).
Re-run test_nnls.py and inspect the output: all_models.ecsv should now have the kinmapchi2 column with the correct values again.
This test should also succeed when changing the weight solver (legacy weight solver <-> Python NNLS) in the config file between deleting and re-adding the kinmapchi2 column (with some warnings because the config file will now differ from the one uses when initially creating all_models.ecsv).
When reading an old all_models table which does not have the
kinmapchi2
column, the column was added but calculating thekinmapchi2
values did not work (silently...). This is fixed in this PR which - as discussed in a recent hack session - has been extracted from PR #322 for quicker merging. Until then, #322 will remain demoted to draft.Remark: Separated reading an existing all_models table (
AllModels.read_model_table()
) from updating it (AllModels.update_model_table()
) to avoid problems with the configuration object (config_reader.py
takes care of this).Successfully tested with
test_nnls.py
and both weight solvers to verify that a deletedkinmapchi2
column gets re-added upon reading the all models table. Also,test_notebooks.sh
succeeds.Test suggestion:
test_nnls.py
.test_nnls.py:36
, setreset_existing_output=False
.all_models.ecsv
, delete thekinmapchi2
column (headline + 3 values) and its entry in the header (entire line 14).test_nnls.py
and inspect the output:all_models.ecsv
should now have thekinmapchi2
column with the correct values again.This test should also succeed when changing the weight solver (legacy weight solver <-> Python NNLS) in the config file between deleting and re-adding the
kinmapchi2
column (with some warnings because the config file will now differ from the one uses when initially creatingall_models.ecsv
).