Skip to content

Commit

Permalink
feat: plotly using new config
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Jun 27, 2022
1 parent d871728 commit feb3c41
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion popmon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class HistogramSectionModel(SectionModel):
top_n: int = 20
"""plot heatmap for top 'n' categories. default is 20 (optional)"""

cmap: str = "autumn_r"
cmap: str = "ylorrd"
"""colormap for histogram heatmaps"""


Expand Down
4 changes: 3 additions & 1 deletion popmon/pipeline/report_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ def __init__(
settings=settings,
),
# generate report
ReportGenerator(read_key=sections_key, store_key=store_key, settings=settings),
ReportGenerator(
read_key=sections_key, store_key=store_key, settings=settings
),
]
if (
isinstance(settings.report_filepath, (str, Path))
Expand Down
1 change: 0 additions & 1 deletion popmon/visualization/histogram_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def _plot_histograms(feature, date, hc_list, hist_names, top_n, max_nbins=1000):
}



def _plot_heatmap(
feature,
date,
Expand Down
5 changes: 3 additions & 2 deletions popmon/visualization/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import htmlmin

from ..base import Module
from ..config import Report
from ..resources import templates_env
from ..version import version

Expand All @@ -33,7 +34,7 @@ class ReportGenerator(Module):
_input_keys = ("read_key",)
_output_keys = ("store_key",)

def __init__(self, read_key, store_key, online_report=False):
def __init__(self, read_key, store_key, settings: Report):
"""Initialize an instance of ReportGenerator.
:param str read_key: key of input sections data to read from the datastore
Expand All @@ -43,7 +44,7 @@ def __init__(self, read_key, store_key, online_report=False):
super().__init__()
self.read_key = read_key
self.store_key = store_key
self.online_report = online_report if online_report is not None else False
self.online_report = settings.online_report

def get_description(self):
return "HTML Report"
Expand Down
1 change: 0 additions & 1 deletion popmon/visualization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import logging
import math
from collections import defaultdict
from io import BytesIO, StringIO
from typing import List

import numpy as np
Expand Down

0 comments on commit feb3c41

Please sign in to comment.