mirror of
https://github.com/NohamR/OqeeAdWatch.git
synced 2026-01-10 16:28:40 +00:00
Lint + update
This commit is contained in:
@@ -27,6 +27,7 @@ from visualizer.plotter import (
|
||||
from visualizer.text_output import print_stats, build_overview_text
|
||||
from visualizer.utils import CHANNELS_DATA
|
||||
|
||||
|
||||
def process_all_channels(start_date, end_date) -> None:
|
||||
"""Process all channels in the database and generate visualizations."""
|
||||
output_dir = Path("visualizer_output")
|
||||
@@ -35,8 +36,8 @@ def process_all_channels(start_date, end_date) -> None:
|
||||
file.unlink()
|
||||
channel_ids = list_channels()
|
||||
|
||||
all_channels_plot_data = [] # Data for combined weekday plots
|
||||
all_channels_ranking_data = [] # Data for channel rankings
|
||||
all_channels_plot_data = [] # Data for combined weekday plots
|
||||
all_channels_ranking_data = [] # Data for channel rankings
|
||||
|
||||
for channel_id in channel_ids:
|
||||
print(f"Processing channel {channel_id}...")
|
||||
@@ -46,14 +47,30 @@ def process_all_channels(start_date, end_date) -> None:
|
||||
|
||||
hourly_profile = compute_hourly_profile(rows)
|
||||
heatmap = compute_heatmap(rows)
|
||||
plot_combined(channel_id, hourly_profile, heatmap, stats=stats, save=True, output_dir=output_dir, channels_data=CHANNELS_DATA, build_overview_text_func=build_overview_text)
|
||||
plot_combined(
|
||||
channel_id,
|
||||
hourly_profile,
|
||||
heatmap,
|
||||
stats=stats,
|
||||
save=True,
|
||||
output_dir=output_dir,
|
||||
channels_data=CHANNELS_DATA,
|
||||
build_overview_text_func=build_overview_text,
|
||||
)
|
||||
|
||||
weekday_profile = compute_weekday_profile(rows)
|
||||
weekday_heatmap = compute_weekday_hour_heatmap(rows)
|
||||
weekday_hour_counts = compute_weekday_hour_counts(rows)
|
||||
|
||||
plot_weekday_channel(
|
||||
channel_id, weekday_profile, weekday_hour_counts, stats=stats, save=True, output_dir=output_dir, channels_data=CHANNELS_DATA, build_overview_text_func=build_overview_text
|
||||
channel_id,
|
||||
weekday_profile,
|
||||
weekday_hour_counts,
|
||||
stats=stats,
|
||||
save=True,
|
||||
output_dir=output_dir,
|
||||
channels_data=CHANNELS_DATA,
|
||||
build_overview_text_func=build_overview_text,
|
||||
)
|
||||
|
||||
all_channels_plot_data.append(
|
||||
@@ -71,8 +88,18 @@ def process_all_channels(start_date, end_date) -> None:
|
||||
}
|
||||
)
|
||||
|
||||
plot_weekday_overview(all_channels_plot_data, save=True, output_dir=output_dir, channels_data=CHANNELS_DATA)
|
||||
plot_channel_rankings(all_channels_ranking_data, save=True, output_dir=output_dir, channels_data=CHANNELS_DATA)
|
||||
plot_weekday_overview(
|
||||
all_channels_plot_data,
|
||||
save=True,
|
||||
output_dir=output_dir,
|
||||
channels_data=CHANNELS_DATA,
|
||||
)
|
||||
plot_channel_rankings(
|
||||
all_channels_ranking_data,
|
||||
save=True,
|
||||
output_dir=output_dir,
|
||||
channels_data=CHANNELS_DATA,
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
@@ -110,10 +137,24 @@ def main() -> None:
|
||||
|
||||
if not args.no_plot:
|
||||
hourly_profile = compute_hourly_profile(rows)
|
||||
plot_hourly_profile(args.channel_id, hourly_profile, stats=stats, output_dir=Path("visualizer_output"), channels_data=CHANNELS_DATA, build_overview_text_func=build_overview_text)
|
||||
plot_hourly_profile(
|
||||
args.channel_id,
|
||||
hourly_profile,
|
||||
stats=stats,
|
||||
output_dir=Path("visualizer_output"),
|
||||
channels_data=CHANNELS_DATA,
|
||||
build_overview_text_func=build_overview_text,
|
||||
)
|
||||
heatmap = compute_heatmap(rows)
|
||||
plot_heatmap(args.channel_id, heatmap, stats=stats, output_dir=Path("visualizer_output"), channels_data=CHANNELS_DATA, build_overview_text_func=build_overview_text)
|
||||
plot_heatmap(
|
||||
args.channel_id,
|
||||
heatmap,
|
||||
stats=stats,
|
||||
output_dir=Path("visualizer_output"),
|
||||
channels_data=CHANNELS_DATA,
|
||||
build_overview_text_func=build_overview_text,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user