Removed logger.debugs for proven functions.

This commit is contained in:
lwark
2024-12-12 12:17:21 -06:00
parent b174eb1221
commit 67520cb784
32 changed files with 80 additions and 758 deletions

View File

@@ -41,7 +41,6 @@ class CustomFigure(Figure):
"""
if modes:
ytitle = modes[0]
# logger.debug("Creating visibles list for each mode.")
self.update_layout(
xaxis_title="Submitted Date (* - Date parsed from fastq file creation date)",
yaxis_title=ytitle,
@@ -79,7 +78,6 @@ class CustomFigure(Figure):
rng = [1]
if months > 2:
rng += [iii for iii in range(3, months, 3)]
# logger.debug(f"Making buttons for months: {rng}")
buttons = [dict(count=iii, label=f"{iii}m", step="month", stepmode="backward") for iii in rng]
if months > date.today().month:
buttons += [dict(count=1, label="YTD", step="year", stepmode="todate")]
@@ -117,24 +115,6 @@ class CustomFigure(Figure):
{"yaxis.title.text": mode},
])
# def save_figure(self, group_name: str = "plotly_output", parent: QWidget | None = None):
# """
# Writes plotly figure to html file.
#
# Args:
# figs ():
# settings (dict): settings passed down from click
# fig (Figure): input figure object
# group_name (str): controltype
# """
#
# output = select_save_file(obj=parent, default_name=group_name, extension="png")
# self.write_image(output.absolute().__str__(), engine="kaleido")
#
# def save_data(self, group_name: str = "plotly_export", parent:QWidget|None=None):
# output = select_save_file(obj=parent, default_name=group_name, extension="xlsx")
# self.df.to_excel(output.absolute().__str__(), engine="openpyxl", index=False)
def to_html(self) -> str:
"""
Creates final html code from plotly

View File

@@ -3,13 +3,12 @@ Functions for constructing irida controls graphs using plotly.
"""
from datetime import date
from pprint import pformat
from typing import Generator
import plotly.express as px
import pandas as pd
from PyQt6.QtWidgets import QWidget
from . import CustomFigure
import logging
from tools import get_unique_values_in_df_column, divide_chunks
from tools import get_unique_values_in_df_column
logger = logging.getLogger(f"submissions.{__name__}")

View File

@@ -21,11 +21,9 @@ class PCRFigure(CustomFigure):
months = int(settings['months'])
except KeyError:
months = 6
# logger.debug(f"DF: {self.df}")
self.construct_chart(df=df)
def construct_chart(self, df: pd.DataFrame):
# logger.debug(f"PCR df:\n {df}")
try:
scatter = px.scatter(data_frame=df, x='submitted_date', y="ct",
hover_data=["name", "target", "ct", "reagent_lot"],

View File

@@ -23,7 +23,6 @@ class TurnaroundChart(CustomFigure):
months = int(settings['months'])
except KeyError:
months = 6
# logger.debug(f"DF: {self.df}")
self.construct_chart()
if threshold:
self.add_hline(y=threshold)
@@ -32,11 +31,9 @@ class TurnaroundChart(CustomFigure):
def construct_chart(self, df: pd.DataFrame | None = None):
if df:
self.df = df
# logger.debug(f"PCR df:\n {df}")
self.df = self.df[self.df.days.notnull()]
self.df = self.df.sort_values(['submitted_date', 'name'], ascending=[True, True]).reset_index(drop=True)
self.df = self.df.reset_index().rename(columns={"index": "idx"})
# logger.debug(f"DF: {self.df}")
try:
scatter = px.scatter(data_frame=self.df, x='idx', y="days",
hover_data=["name", "submitted_date", "completed_date", "days"],