mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-26 22:35:48 +00:00
Delay some imports to allow installation w/o deps
This commit is contained in:
parent
59f34ebc5f
commit
101dd50e31
2 changed files with 6 additions and 4 deletions
|
|
@ -11,7 +11,7 @@ from collections import OrderedDict
|
|||
from enum import Enum
|
||||
import pickle
|
||||
import pkg_resources
|
||||
import numpy as np
|
||||
|
||||
import os
|
||||
|
||||
|
||||
|
|
@ -152,7 +152,9 @@ class CmdStanPyBackend(IStanBackend):
|
|||
return (cmdstanpy_init, cmdstanpy_data)
|
||||
|
||||
@staticmethod
|
||||
def stan_to_dict_numpy(column_names: Tuple[str, ...], data: np.array):
|
||||
def stan_to_dict_numpy(column_names: Tuple[str, ...], data: 'np.array'):
|
||||
import numpy as np
|
||||
|
||||
output = OrderedDict()
|
||||
|
||||
prev = None
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ from setuptools import setup, find_packages
|
|||
from setuptools.command.build_py import build_py
|
||||
from setuptools.command.develop import develop
|
||||
from setuptools.command.test import test as test_command
|
||||
from fbprophet.models import StanBackendEnum
|
||||
from typing import List
|
||||
|
||||
PLATFORM = 'unix'
|
||||
|
|
@ -29,11 +28,12 @@ MODEL_TARGET_DIR = os.path.join('fbprophet', 'stan_model')
|
|||
|
||||
|
||||
def get_backends_from_env() -> List[str]:
|
||||
import os
|
||||
from fbprophet.models import StanBackendEnum
|
||||
return os.environ.get("STAN_BACKEND", StanBackendEnum.PYSTAN.name).split(",")
|
||||
|
||||
|
||||
def build_models(target_dir):
|
||||
from fbprophet.models import StanBackendEnum
|
||||
for backend in get_backends_from_env():
|
||||
StanBackendEnum.get_backend_class(backend).build_model(target_dir, MODEL_DIR)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue