Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-11635

add argument to getTempFilePath() to specify that we don't care if the file exists on clean-up

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: utils
    • Templates:

      Description

      lsst.utils.tests.getTempFilePath() creates a predictable file name for a temporary file based on the method and class that call it. When used as a context, it tries to delete the file on exit. If the file does not exist at this point, a warning is emitted. There are cases in the simulations stack where we need to supply the names of temporary files that are not necessarily created. For example, one of our moving object simulation codes requires a name of a file to which failures are written. If nothing fails, nothing is written to that file and the file does not exist. We use getTempFilePath() to generate the name of this failure log in unittests. When the failure log does not exist, we get a warning in our stdout. It would be nice if there was a kwarg in getTempFilePath() that indicated "we do not care if the file does not get created; do not emit the warning."

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  tjenness Tim Jenness
                  Reporter:
                  danielsf Scott Daniel
                  Reviewers:
                  Paul Price, Scott Daniel
                  Watchers:
                  Paul Price, Scott Daniel, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Summary Panel