desihub / redrock

Redshift fitting for spectroperfectionism
BSD 3-Clause "New" or "Revised" License
21 stars 13 forks source link

Insist that FITMETHOD is a 4-string from the moment NONE is added #303

Closed geordie666 closed 2 months ago

geordie666 commented 2 months ago

This PR fixes issue #301 by enforcing that the FITMETHOD column can hold strings of length 4 from the moment the string NONE is added to the column.

Testing (as compared to the example in issue 301):

salloc -N 1 -C gpu -A desi_g --gpus-per-node=4 -t 04:00:00 -q interactive

srun -n 4 --gpu-bind=map_gpu:3,2,1,0 --cpu-bind=cores rrdesi_mpi --gpu -n 100 \
  -i $CFS/desi/spectro/redux/iron/tiles/cumulative/80605/20210205/coadd-6-80605-thru20210205.fits \
  --model $SCRATCH/redrock/rrmodel-test.fits \
  -o $SCRATCH/redrock/redrock-test.fits

Proceeds without any warning...

import fitsio
zcat = fitsio.read('$SCRATCH/redrock/redrock-test.fits', 'REDSHIFTS')
set(zcat['FITMETHOD'])

Out[]: {'NONE', 'PCA'}
coveralls commented 2 months ago

Coverage Status

coverage: 38.825% (-0.2%) from 39.033% when pulling 55d9d61ec04f551416747dbdd759b64aa6b0173d on ADM-fix-none into ae069fa57228eb6c19e926870de901eba120ce03 on main.