From f465b867aae076f0d1d4276f321ea2a590bad9f5 Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Fri, 8 Jul 2022 08:10:21 +0200 Subject: [PATCH 1/3] fix: prevent plot name collision that stops rendering --- .../templates/assets/js/custom-script.js | 2 +- popmon/visualization/templates/card.html | 22 +++++++++---------- popmon/visualization/templates/core.html | 5 +++++ popmon/visualization/templates/section.html | 5 ++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/popmon/visualization/templates/assets/js/custom-script.js b/popmon/visualization/templates/assets/js/custom-script.js index 28afc936..873aa688 100644 --- a/popmon/visualization/templates/assets/js/custom-script.js +++ b/popmon/visualization/templates/assets/js/custom-script.js @@ -71,7 +71,7 @@ $("#toggleDescriptions").change(function() { } }); -var plotly_config = {scrollZoom: true, displaylogo: false, modeBarButtonsToRemove: ['lasso2d']} ; +var plotly_config = {scrollZoom: true, displaylogo: false, modeBarButtonsToRemove: ['lasso2d']}; const deepCopy = (inObject) => { diff --git a/popmon/visualization/templates/card.html b/popmon/visualization/templates/card.html index 27e0a4d4..cd9b0661 100644 --- a/popmon/visualization/templates/card.html +++ b/popmon/visualization/templates/card.html @@ -14,29 +14,29 @@

{{metric.name | fmt_metric}}

{%- if metric.type in ['traffic_light', 'alert'] -%} {{ metric.plot }} {%- else -%} -
+
{%- include 'header.html' -%} {{ sections }} {%- include 'footer.html' -%} diff --git a/popmon/visualization/templates/section.html b/popmon/visualization/templates/section.html index 0ed8662f..8d763383 100644 --- a/popmon/visualization/templates/section.html +++ b/popmon/visualization/templates/section.html @@ -24,14 +24,13 @@

{{ section_title }}

{%- for feature in features -%}
{%- if feature.plots is mapping -%} - {%- for ref,plots in feature.plots.items() -%} + {%- for ref, plots in feature.plots.items() -%} {%- set count = (plots|length + 1)*(loop.index - 1) -%}

{{ feature.titles.get(ref, ref) }}

{{ feature.descriptions[ref] }}
From 8a538202cedca9e71a3d5f13563ff03318772046 Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Fri, 8 Jul 2022 08:17:35 +0200 Subject: [PATCH 2/3] docs(profiles): fraction of true description --- popmon/analysis/profiling/profiles.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/popmon/analysis/profiling/profiles.py b/popmon/analysis/profiling/profiles.py index fa660f52..2f9970e8 100644 --- a/popmon/analysis/profiling/profiles.py +++ b/popmon/analysis/profiling/profiles.py @@ -159,7 +159,12 @@ def profile_distinct(bin_labels, bin_counts): return len(np.unique(bin_labels[bin_counts > 0])) -@Profiles.register(key="fraction_of_true", description="", dim=1, htype="cat") +@Profiles.register( + key="fraction_of_true", + description="Compute fraction of 'true' (as in boolean) labels", + dim=1, + htype="cat", +) def profile_fraction_of_true(bin_labels, bin_counts): """Compute fraction of 'true' labels From 0907c7f77dd81c247060220baa1e34fb77326d78 Mon Sep 17 00:00:00 2001 From: Patil Date: Fri, 8 Jul 2022 12:22:02 +0530 Subject: [PATCH 3/3] fix: plot layout --- popmon/visualization/templates/card.html | 2 +- popmon/visualization/templates/section.html | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/popmon/visualization/templates/card.html b/popmon/visualization/templates/card.html index cd9b0661..0fbb6e00 100644 --- a/popmon/visualization/templates/card.html +++ b/popmon/visualization/templates/card.html @@ -18,7 +18,7 @@

{{metric.name | fmt_metric}}

{%- if feature.plots is mapping -%} {%- for ref, plots in feature.plots.items() -%} - {%- set count = (plots|length + 1)*(loop.index - 1) -%}

{{ feature.titles.get(ref, ref) }}

{{ feature.descriptions[ref] }}
{%- for metric in plots -%} - {%- set plt = count + loop.index -%} {%- with metric=metric -%} {%- include 'card.html' -%} {%- endwith -%} @@ -46,7 +44,6 @@

{{ feature.titles.get(ref, ref) }}

{%- else -%}
{%- for metric in feature.plots -%} - {%- set plt = loop.index -%} {%- with metric=metric -%} {%- include 'card.html' -%} {%- endwith -%}