15 relPattern_Nightly=re.compile(r"^Athena-\d+(\.\d+){2,3}-(?:\d+\.\d+|main)-\d{4}-\d{2}-\d{2}T\d{4}$")#in case of a Nightly release used for production of the sample
16
17for r in (rel1,rel2):
18ifnot relPattern.match(r):
19raise RuntimeError("Release number %s doesn't match the expected format"%r)
20
21if inputRelease isNone:
22 inputRelease=flags.Input.Release
23
24# protection against AOD with very old releases or not read correctly by MetaReader.py
30raise RuntimeError("Input release number %s doesn't match the expected format"%inputRelease)
31
32# convert 3 digits releases to 4 digits
33if rel1.count(".") == 2: rel1=f"{rel1}.0"
34if rel2.count(".") == 2: rel2=f"{rel2}.0"
35if relPattern_Nightly.match(inputRelease): inputRelease = re.sub(r"(-(?:\d+\.\d+|main)-\d{4}-\d{2}-\d{2}T\d{4})$", "", inputRelease) #removing the Nightly part (the usefull part of the release name should be remaining)