Skip to content

Commit

Permalink
Add cpv report generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
czwa committed Jan 8, 2025
1 parent a849b84 commit dc24321
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions DATA/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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"))
Expand All @@ -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 = [
Expand All @@ -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")])
Expand Down

0 comments on commit dc24321

Please sign in to comment.