Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #1890, i.e. a bug introduced with relative symlinks in PR #1888 that broke the symlinks creation for multi-exposure stdstar fitting. This PR adds two redundant fixes:
relsymlink(src, dst)
now accepts relative paths forsrc
instead of requiring two absolute paths and deriving the relative path. Ifsrc
is a relative path, it is relative todirname(dst)
, not relative to the current directory (same behavior asos.path.symlink
). I added tests to confirm this behavior.desi_proc_joint_fit
no longer derives the relative path, leaving it torelsymlink
instead. In this casedesi_proc_joint_fit
was deriving the correct path anyway so fix (1) would have been sufficient, but it has the possible future fragility of /dvs_ro/cfs vs. /global/cfs, so I also updated it to letrelsymlink
standardize how relative paths are computed, sinceos.path.relpath
isn't sufficient for all cases due to read-only vs. read-write mounts of the same directories.Extra: I also updated some
log.debug(...)
messages to uselog.debug("format string %s", blat)
instead oflog.debug(f"format string {blat}")
so that it doesn't spend time evaluating the string if it isn't going to log it. That has mattered in the past where debug statements were in loops and ended up taking a significant fraction of the compute time. In this case it probably doesn't matter, but since I was updating a log.debug message anyway for the link variable name, I also updated the formatting method and then did the same for several others nearby.Test run in
/global/cfs/cdirs/desi/users/sjbailey/spectro/redux/p8r
night 20201214, in particular tile 80605 exposures 00067710, 00067711, 00067712, 00067713.