dirac-institute / sorcha

An open-source community LSST Solar System Simulator
Other
16 stars 17 forks source link

Changes to Sorcha logging, utility script #1012

Closed astronomerritt closed 1 month ago

astronomerritt commented 1 month ago

Fixes #1003.

Usage for the new utility script is as follows. I put it in the outputs section of the command line utilities, as that made the most sense.

>> sorcha outputs check-logs <top level directory filepath> <optional output filepath>

The output file is a .csv consisting of the log filename, a True/False flag as to whether the run was successfully completed, and if not, the last line of the log file.

If you don't supply an output filename, it'll just output everything to the terminal. If all runs were successful, no output file is created, as I didn't see the point really. A happy message is printed to the terminal instead.

All unit tests pass on my machine.

Review Checklist for Source Code Changes

Gerenjie commented 1 month ago

Works on my side! I ran a few simulations (tens of thousands of objects) on the new branch, saw that my output files were now helpfully named and readable, and used sorcha outputs check-logs -f . to confirm that my runs worked!

astronomerritt commented 1 month ago

Nope! sorcha-outputs is already in pyproject.toml, and I added this command there.