Skip to content

Commit

Permalink
issue #383 replace print statements with logging
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Mar 7, 2024
1 parent 9ee97c3 commit 3352da0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions metplotpy/plots/tcmpr_plots/skill/mean/tcmpr_series_skill_mean.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import numpy as np
from pandas import DataFrame
from datetime import datetime
import metplotpy.plots.util as util

import metcalcpy.util.utils as utils
from metplotpy.plots.tcmpr_plots.tcmpr_series import TcmprSeries
Expand All @@ -29,8 +31,13 @@ class TcmprSeriesSkillMean(TcmprSeries):
"""

def __init__(self, config, idx: int, input_data, series_list: list,
series_name: Union[list, tuple], skill_ref_data: DataFrame = None):
super().__init__(config, idx, input_data, series_list, series_name, skill_ref_data)
series_name: Union[list, tuple], stat_name, skill_ref_data: DataFrame = None):

# Set up Logging
self.skill_series_logger = util.get_common_logger(config.log_level, config.log_filename)

self.skill_series_logger.info(f"Creating TcmprSeriesSkillMean object: {datetime.now()}")
super().__init__(config, idx, input_data, series_list, series_name, stat_name, skill_ref_data)

def _create_series_points(self) -> dict:
"""
Expand All @@ -43,6 +50,7 @@ def _create_series_points(self) -> dict:
dictionary with CI ,point values and number of stats as keys
"""

start_time = datetime.now()
self._init_series_data()

result_size = len(self.config.indy_vals)
Expand Down Expand Up @@ -77,4 +85,8 @@ def _create_series_points(self) -> dict:

series_points_results['nstat'][i] = len(point_data)

end_time = datetime.now()
total_time = end_time - start_time
self.skill_series_logger.info(f"Took {total_time} milliseconds to create series points")

return series_points_results

0 comments on commit 3352da0

Please sign in to comment.