-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add exeption for misconfiguration of sampleypes #242
Conversation
This should catch some errors, ofc things like samples=[
sample
for sample in available_sample_types
if sample not in ["data, embedding", "embedding_mc"]
], are still not checked by this |
Would it make sense to add somewhere a check like searching for |
I don't want to add such checks to the framework, since regex checking a configuration is not something a framework should do. On the other hand, the case that is now checked is something well within the information given to CROWN by the configuration, this second way of setting up rules is not really intended. What would make more sense would be to extend the capabilities of ProducerRules so the user can set the samples, where the rule should not be applied, something like configuration.add_shift(
SystematicShiftByQuantity(
name="metUnclusteredEnUp",
quantity_change={
nanoAOD.MET_pt: "PuppiMET_ptUnclusteredUp",
nanoAOD.MET_phi: "PuppiMET_phiUnclusteredUp",
},
scopes=["global"],
),
exclude_samples=["data", "embedding", "embedding_mc"],
) which would then mean, we can validate the list again, and the Rule is automatically applied to all samples that are not excluded |
Now, CROWN will throw an error during configuration, when a rule is configured to be applied to a nonexistent sampletype: