Commit 2d7f4c0b authored by norvell's avatar norvell
Browse files

Add images in separate subfolder images

parent c4ffb1be
Loading
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ import pathlib
import argparse
from functools import partial

FORMATS = ['Stereo', 'ISM', 'Multichannel','MASA','SBA', 'OSBA', 'OMASA', 'Renderer']

CSV_DELIM = ";"
SUBPAGE_TMPL_CSS = """
@@ -25,7 +26,7 @@ SUBPAGE_TMPL_CSS = """

SUBPAGE_TMPL_HTML = """

<h1>Report for job {job_name}</h1
<h1>Report for job {job_name}</h1>

Comparing:
<ul>
@@ -34,7 +35,12 @@ Comparing:
    <li><a href="{job_name}--merged_csv--{id_current}.csv">Merged csv data</a></li>
</ul>

{images}
{images_mld}

{images_diff}

{images_ssnr}


<br>
<b>How is the table sorted?</b>
@@ -131,7 +137,15 @@ def create_subpage(
    table_body = "\n".join(
        tr_from_row(row, id_current, id_previous) for row in merged_reports
    )
    images = " ".join([f"<img src={x}>" for x in histogram])
    if histogram:
        images_mld = f"<h2>MLD summary {job_name}</h2>\n" + " ".join([f"<img src=images/summary_{id_current}_MLD_{x}.png>" for x in FORMATS])
        images_ssnr = f"<h2>MIN_SSNR summary {job_name}</h2>\n" + " ".join([f"<img src=images/summary_{id_current}_SSNR_{x}.png>" for x in FORMATS])
        images_diff = f"<h2>MAX ABS DIFFERENCE summary {job_name}</h2>\n" + " ".join([f"<img src=images/summary_{id_current}_DIFF_{x}.png>" for x in FORMATS])
    else:
        images_mld = ""
        images_ssnr = ""
        images_diff = ""

    new_subpage = SUBPAGE_TMPL_CSS + SUBPAGE_TMPL_HTML.format(
        id_current=id_current,
        id_previous=id_previous,
@@ -139,7 +153,9 @@ def create_subpage(
        job_name=job_name,
        table_header_a=table_header_a,
        table_header_b=table_header_b,
        images=images
        images_mld=images_mld,
        images_ssnr=images_ssnr,
        images_diff=images_diff,  
    )
    with open(html_out, "w") as f:
        f.write(new_subpage)
@@ -299,7 +315,7 @@ if __name__ == "__main__":
    parser.add_argument("id_current", type=int)
    parser.add_argument("id_previous", type=int)
    parser.add_argument("job_name")
    parser.add_argument("--histogram", type=str, nargs='+', help="histogram picture(s)", default = [])
    parser.add_argument("--histogram", action='store_true')
    args = parser.parse_args()


+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ if __name__ == "__main__":

    # Output CSV file
    with open(csv_summary, "w") as fp:
        limits_labels = [f"{str(a)} -- {str(b)}" for (a,b) in zip(limits[0:-1],limits[1:])] + ["None"]
        limits_labels = [f"{str(a)} --\n {str(b)}" for (a,b) in zip(limits[0:-1],limits[1:])] + ["None"]
        # Zero difference is treated as a special category for MLD and MAXIMUM ABS DIFF
        if measure_label == "MLD" or measure_label == "MAXIMUM ABS DIFF":
            limits_labels = ["0"] + limits_labels