nanograv / pint_pal

A long-lived repository for NANOGrav Pulsar Timing workflows and analysis.
MIT License
6 stars 16 forks source link

Fix bug in `pdf_writer()` tim file listing #50

Closed rossjjennings closed 7 months ago

rossjjennings commented 8 months ago

In printing the list of tim filenames, the PDF writer code here loops over toas.filename. The problem with this is, the filename attribute of a PINT TOAs object might be either a string or a list of strings. Currently, only the list case is handled correctly -- if filename is a string, each character will be printed on a separate line. This PR updates the PDF writer code to correctly handle either case.

This problem was hidden until recently, because, until recent updates to PINT changed things, the way that TimingConfiguration.get_model_and_toas() constructed a TOAs object guaranteed that its filename attribute would be a list, not a string. However, since nanograv/PINT#1593 was merged, filename is always a string if there is only file associated with the TOAs object.

tcromartie commented 8 months ago

I tested this and it worked well. Simple change; can merge when passing checks

rossjjennings commented 8 months ago

This is a weird test failure. It's only happening for the Python 3.8 test, and it seems to be some kind of internal mamba thing -- it doesn't even get to the point of running the notebook.

tcromartie commented 8 months ago

@JPGlaser, once you're feeling better and get a chance, would you mind taking a look at what might be going on?

JPGlaser commented 7 months ago

Retriggered the tests and it seemed to work just fine. Everything looks good so I'm merging it.