You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is discrepancy between the listed parameter names and the parameter names accepted by the Collate1D script, leading to a raised ValueError.
I think there are two related problems here (not sure that they require different issues), one with the documentation and examples on the parameter --exclude_slit_bm, and another with the code for the parameter --chk_version.
Problem 1: exclude_slit_bm
This parameter is referred to with three different names in the documentation. It also has a different name depending on if you set it in an input file or via command line.
For command line the parameter name is --exclude_slit_bm, while for an input file the name that works is exclude_slit_trace_bm. However, the example input file uses slit_exlude_flags.
To solve this I think the documentation example input file should be updated to match the current syntax, and possibly the code should be changed so that the input file and the command line usages use the same parameter names.
Problem 2: chk_version
When using the input file to run Collate1D a ValueError will be raised if chk_version is provided as a parameter.
Error message:
File "~/anaconda3/envs/pypeit/lib/python3.11/site-packages/pypeit/par/pypeitpar.py", line 5299, in from_dict
raise ValueError('{0} not recognized key(s) for Collate1DPar.'.format(k[badkeys]))
ValueError: ['chk_version'] not recognized key(s) for Collate1DPar.
To fix this chk_version needs to be added to the list of parameter keys on lines 5293-5295 of pypeit/par/pypeitpar.py.
The relevant code:
5291 def from_dict(cls, cfg):
5292 k = [*cfg.keys()]
5293 parkeys = ['tolerance', 'dry_run', 'ignore_flux', 'flux', 'match_using',
5294 'exclude_slit_trace_bm', 'exclude_serendip', 'outdir', 'spec1d_outdir',
5295 'wv_rms_thresh', 'refframe']
5296
5297 badkeys = np.array([pk not in parkeys for pk in k])
5298 if np.any(badkeys):
5299 raise ValueError('{0} not recognized key(s) for Collate1DPar.'.format(k[badkeys]))
(Note: the ValueError is not actually raised on the current branch, due to an Type Error with the line to raise the error, I suggested a fix for that in a separate pull request)
The text was updated successfully, but these errors were encountered:
I had always intended the command line to use an abbreviated version of the options to save typing, but perhaps that is a mistake that causes more confusion that it's worth. I'll have to think on that.
But there are definitely some documentation bugs in the problems listed above.
Problem 1:
The example input file needs to be updated with the current name for exclude_slit_trace_bm
Problem 2:
It was decided to move chk_version out of the collate1d params and to use the version in the rdx params. So to specify it in the collate1d input file the user has to add a [rdx] section. But the documentation doesn't reflect this change.
There is discrepancy between the listed parameter names and the parameter names accepted by the Collate1D script, leading to a raised ValueError.
I think there are two related problems here (not sure that they require different issues), one with the documentation and examples on the parameter --exclude_slit_bm, and another with the code for the parameter --chk_version.
Problem 1: exclude_slit_bm
This parameter is referred to with three different names in the documentation. It also has a different name depending on if you set it in an input file or via command line.
For command line the parameter name is --exclude_slit_bm, while for an input file the name that works is exclude_slit_trace_bm. However, the example input file uses slit_exlude_flags.
To solve this I think the documentation example input file should be updated to match the current syntax, and possibly the code should be changed so that the input file and the command line usages use the same parameter names.
Problem 2: chk_version
When using the input file to run Collate1D a ValueError will be raised if chk_version is provided as a parameter.
Error message:
To fix this chk_version needs to be added to the list of parameter keys on lines 5293-5295 of pypeit/par/pypeitpar.py.
The relevant code:
(Note: the ValueError is not actually raised on the current branch, due to an Type Error with the line to raise the error, I suggested a fix for that in a separate pull request)
The text was updated successfully, but these errors were encountered: