Closed rossjjennings closed 1 year ago
CI is currently failing because staging the changes relies on the gitpython
package, which is not in the environment yet.
Maybe I just need to add gitpython
to the setup.py
requirements.
Hmm, I guess we'd also like this to update the timing-model
and compare-model
fields in the YAML. I'll see if I can add that.
There are some significant changes in these last commits: the par shuffler now logs what it does (using Astropy logging for now, but we should eventually try to move to loguru to mach PINT), and it updates the timing-model
and compare-model
fields in the YAML config file.
Also, it tries to delete the old timing-model
par file after making a copy in the archive
directory, but it only if it's already tracked. And if the file is tracked but there are uncommitted changes, it stops in its tracks and prints a warning.
Having coded this up, though, I'm now not sure it's the behavior we really want. Typically in my workflow for the 15-year, I would make changes to the par file when adding or removing parameters, but then not commit those changes because I didn't really want them in the archived par file, which would trip this up.
OK, I've taken out the bit that warns you if there are uncommitted changes to the old timing_model
. It was a bit misguided as a mechanism for protecting against losing work anyway. The new behavior (copy if the file isn't tracked, and move if it is) is easier to understand, and the only way it can make you can lose work is if you have uncommitted changes to the file in the archive
directory that gets overwritten, which seems pretty unlikely, and wasn't what I was checking for anyway.
This changes the logic in the
write_par()
function so that it doesn't include the date in the par file name by default (to avoid cluttering the "archive" directory; we can always look at older versions in the git history).Additionally, it adds a function
pp.checkin.shuffle_pars()
to the notebook which automatically copies the new par file to the par directory and archives the old one, then stages the changes in Git. This should make things easier on timers who want to check in par files, compared to the NANOGrav 15-year dataset workflow.