From 8882c6a3e370736c382db14133f9c66f3b509c30 Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Fri, 5 Mar 2021 09:55:35 -0800 Subject: [PATCH] Use pathlib to load model file (#1835) --- python/fbprophet/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/fbprophet/models.py b/python/fbprophet/models.py index 38102df..8b62275 100644 --- a/python/fbprophet/models.py +++ b/python/fbprophet/models.py @@ -9,6 +9,7 @@ from abc import abstractmethod, ABC from typing import Tuple from collections import OrderedDict from enum import Enum +from pathlib import Path import pickle import pkg_resources import os @@ -282,7 +283,7 @@ class PyStanBackend(IStanBackend): 'fbprophet', 'stan_model/prophet_model.pkl', ) - with open(model_file, 'rb') as f: + with Path(model_file).open('rb') as f: return pickle.load(f)