Skip to content

Commit ff9fbf8

Browse files
committed
update path lib solution for stan
1 parent 96469d8 commit ff9fbf8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

orbit/utils/set_cmdstan_path.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import json
2+
from pathlib import Path
23

34
import cmdstanpy
4-
import importlib_resources
55
from ..utils.logger import get_logger
66

77
logger = get_logger("orbit")
88

9+
_ORBIT_DIR = Path(__file__).parent.parent
10+
911

1012
def set_cmdstan_path():
11-
with open(importlib_resources.files("orbit") / "config.json") as f:
13+
with open(_ORBIT_DIR / "config.json") as f:
1214
config = json.load(f)
1315
CMDSTAN_VERSION = config["CMDSTAN_VERSION"]
1416

15-
local_cmdstan = (
16-
importlib_resources.files("orbit")
17-
/ "stan_compiled"
18-
/ f"cmdstan-{CMDSTAN_VERSION}"
19-
)
17+
local_cmdstan = _ORBIT_DIR / "stan_compiled" / f"cmdstan-{CMDSTAN_VERSION}"
2018
if local_cmdstan.exists():
2119
cmdstanpy.set_cmdstan_path(str(local_cmdstan))
2220
logger.debug(

0 commit comments

Comments
 (0)