Commit aa602a0c authored by Ripinder Singh's avatar Ripinder Singh
Browse files

Add color (red/green) to corridor results on fail/pass



* Error message if reference mld csv files are missing
* Color code MLD corridor results

Signed-off-by: default avatarRipinder Singh <ripinder.singh@dolby.com>
parent 9e5a036a
Loading
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -902,9 +902,9 @@ class MLDConformance:
        dutMLD = mldCutWithTags["MLD"][indDut]
        diff = dutMLD - refMLD
        if diff.max() > threshold:
            print(f"MLD Corridor failed for {tag} with max MLD diff of {diff.max()}")
            print(f"\033[91mMLD Corridor failed for {tag} with max MLD diff of {diff.max()} \033[00m")
        else:
            print(f"MLD Corridor passed for {tag} with max MLD diff of {diff.max()}")
            print(f"\033[92mMLD Corridor passed for {tag} with max MLD diff of {diff.max()} \033[00m")

    def doAnalysis(self, selectTag="all", corridor=False):
        keys = IVAS_Bins.keys() if selectTag == "all" else [selectTag]
@@ -960,12 +960,15 @@ class MLDConformance:
                    refMldFile = os.path.join(
                        self.testvDir, "mld_ref", ReferenceMldFiles[tag]
                    )
                    if os.path.exists(refMldFile):
                        mldRefWithTags = np.loadtxt(
                            refMldFile,
                            delimiter=",",
                            dtype=[("MLD", "f8"), ("pyTestTag", "<U90")],
                        )
                        self.computeCorridor(mldRefWithTags, mdlCutWithTags, tag)
                    else:
                        print(f"\033[91mMissing reference MLD file for {tag} : {refMldFile} \033[00m")


if __name__ == "__main__":