diff --git a/.gitignore b/.gitignore index 24253d9..c18a8ed 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,5 @@ DATA/gen3.sqlite3 DATA/LATISS DATA/calib/ DATA/ci_* +DATA/report python/*.dist-info/ diff --git a/DATA/SConscript b/DATA/SConscript index cc18411..2e4de26 100644 --- a/DATA/SConscript +++ b/DATA/SConscript @@ -360,6 +360,10 @@ def getVerifyCmdLegacy(stage, expList, pipelineFile, legacyDate="202409"): return getExecutableCmd("ctrl_mpexec", "pipetask", *args) +# An array to store which collections should be used to make the +# report. +reportCollections = [] + # Begin ci_cpp build commands. # Create the butler, register the instrument, and add calibs. butler = env.Command([File(os.path.join(REPO_ROOT, "gen3.sqlite3")), @@ -470,6 +474,7 @@ if LEGACY_MODE == 0: getVerifyCmd("linearizer", exposureDict["ptcExposurePairs"], "verifyLinearizer.yaml"), ], ) + reportCollections.append("ci_cpv_linearizer") env.Alias("linearizer", linearizer) # Create a ptc and certify/verify. @@ -486,6 +491,7 @@ if LEGACY_MODE == 0: getVerifyCmd("ptc", [exposureDict["ptcExposurePairs"][0]], "verifyPtc.yaml"), ], ) + reportCollections.append("ci_cpv_ptc") env.Alias("ptc", ptc) # Create a cti and certify. @@ -542,6 +548,7 @@ if LEGACY_MODE == 0: getVerifyCmd("bias", exposureDict["biasExposures"], "verifyBias.yaml"), ], ) + reportCollections.append("ci_cpv_bias") env.Alias("bias", bias) # Create a dark and certify/verify. @@ -558,6 +565,7 @@ if LEGACY_MODE == 0: getVerifyCmd("dark", exposureDict["darkExposures"], "verifyDark.yaml"), ], ) + reportCollections.append("ci_cpv_dark") env.Alias("dark", dark) # Create a flat and certify/verify. @@ -574,6 +582,7 @@ if LEGACY_MODE == 0: getVerifyCmd("flat", exposureDict["flatExposures"], "verifyFlat.yaml"), ], ) + reportCollections.append("ci_cpv_flat") env.Alias("flat", flat) # Create SpectroFlat @@ -598,6 +607,7 @@ if LEGACY_MODE == 0: getVerifyCmd("defects", exposureDict["scienceExposures"], "verifyDefects.yaml"), ], ) + reportCollections.append("ci_cpv_defects") env.Alias("defectsVerify", defectsVerify) # Run a science exposure. @@ -625,6 +635,22 @@ if LEGACY_MODE == 0: ) env.Alias("sky", sky) + # Create the report. + report = env.Command( + [ + os.path.join(REPO_ROOT, "report"), + ], + [defectsVerify], + [ + getExecutableCmd("cp_verify", "cpv_report.py", + "-r", REPO_ROOT, + "-O", os.path.join(REPO_ROOT, "report"), + *[f"-c {collection}" for collection in reportCollections], + ) + ], + ) + env.Alias("report", report) + # Set up test dependencies. env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "LATISS", "calib")) env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "LATISS", "raw")) @@ -643,6 +669,7 @@ if LEGACY_MODE == 0: env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "ci_cpp_science")) env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "ci_cpp_sky")) env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "ci_cpv_defects")) + env.Depends(utils.targets["tests"], os.path.join(REPO_ROOT, "report")) # Set up things to clean. targets = [ @@ -661,6 +688,7 @@ if LEGACY_MODE == 0: science, sky, defectsVerify, + report, ] env.Clean(targets, [y for x in targets for y in x] + [os.path.join(REPO_ROOT, "calib"), os.path.join(REPO_ROOT, "LATISS")])