GreenBankObservatory / dysh

https://dysh.readthedocs.io
Other
9 stars 3 forks source link

sdfits.write() on MacOS does not save expected files #339

Open vcatlett opened 1 month ago

vcatlett commented 1 month ago

Describe the bug On macos-latest, the following line in notebooks/examples/dataIO.ipynb does not write the expected output: sdfits.write(output_dir / "mydata.fits", plnum=1, ifnum=[0,2], intnum=np.arange(100), overwrite=True)

The following cell expects to find notebooks/examples/output/mydata.fits: sdfits2 = GBTFITSLoad(output_dir / "mydata.fits")

This works fine on ubuntu-latest and windows-latest. However, on macos-latest, we do not find notebooks/examples/output/mydata.fits. Instead, we find notebooks/examples/output/mydata{0,1,2,3}.fits.

How to Reproduce See https://github.com/GreenBankObservatory/dysh/actions/runs/10252663222 On line 191 of the "Test with pytest" section of the tests (macos-latest, 3.9), you can see via a debugging print statement that the contents of notebooks/examples/output/ are... 3 OUTPUTS: ['mydata1.fits', 'testwrite.ipac', 'scanblock.fits', 'mydata0.fits', 'testwrite.ecsv', 'testwrite.fits', '.gitkeep', 'testwrite.commented_header', 'testwrite.basic', 'baselined_removed.png', 'testwrite.mrt', 'testwrite.votable', 'mydata3.fits', 'testwrite.fixed_width', 'mydata2.fits']

vcatlett commented 1 month ago

Adding multifile=False to the sdfits.write() call fixed the issue with the notebook tests. See https://github.com/GreenBankObservatory/dysh/actions/runs/10253959223

However, this may still be a bug because this should already be the default behavior.