desihub / specter

A toolkit for simulating multi-object spectrographs
Other
8 stars 7 forks source link

clobber keyword removed in astropy >=5.1 #85

Closed marcelo-alvarez closed 1 year ago

marcelo-alvarez commented 1 year ago

Numerous unit tests fail with astropy >=5.1. At least four are because the deprecated clobber argument was removed from the astropy.io.fits functions in version 5.1, e.g.:

Traceback (most recent call last):
  File "/global/u2/m/malvarez/specter/bin/specter", line 425, in <module>
    hx.writeto(opts.output, clobber=True)
TypeError: HDUList.writeto() got an unexpected keyword argument 'clobber'
FAIL
test_bb (specter.test.test_binscripts.TestBinScripts) ... Traceback (most recent call last):

@sbailey this will block us from a new desiconda with astropy >=5.1 for Iron. Options are

  1. update specter to not use the clobber argument in astropy.io.fits functions
  2. use existing desiconda
  3. pin astropy/5.0 in the new desiconda installation

I don't know at this time what it would take to implement (1), nor whether doing so would fix all of the unit test failures currently happening with astropy 5.2.

sbailey commented 1 year ago

I think this is just a matter of grepping for "clobber" when used with astropy.io.fits and replacing it with "overwrite", which is backwards compatible with older versions of astropy. However, be careful that fitsio still uses "clobber", so we have to update on a case-by-case basis depending upon whether the I/O is being done with astropy or fitsio.

Volunteers welcome! If anyone can make these updates, please assign this ticket to yourself to claim it.