Skip to content

Commit

Permalink
fix: added logging options to avoid pystan info
Browse files Browse the repository at this point in the history
  • Loading branch information
broomva committed Jul 28, 2023
1 parent 4495652 commit a9345a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions hyperopt_prophet/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
)

import logging

logging.getLogger("prophet").setLevel(logging.WARNING)
logging.getLogger("cmdstanpy").setLevel(logging.WARNING)

logger = logging.getLogger('cmdstanpy')
logger.addHandler(logging.NullHandler())
logger.propagate = False
logger.setLevel(logging.CRITICAL)

class ForecastModel(ABC, mlflow.pyfunc.PythonModel):
@abstractmethod
Expand Down
7 changes: 4 additions & 3 deletions hyperopt_prophet/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
from .utils import get_plotly_forecast, plotly_fig2pil

import logging

logging.getLogger("prophet").setLevel(logging.WARNING)
logging.getLogger("cmdstanpy").setLevel(logging.WARNING)
logger = logging.getLogger('cmdstanpy')
logger.addHandler(logging.NullHandler())
logger.propagate = False
logger.setLevel(logging.CRITICAL)


warnings.filterwarnings("ignore")
Expand Down

0 comments on commit a9345a3

Please sign in to comment.