We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96469d8 commit ff9fbf8Copy full SHA for ff9fbf8
1 file changed
orbit/utils/set_cmdstan_path.py
@@ -1,22 +1,20 @@
1
import json
2
+from pathlib import Path
3
4
import cmdstanpy
-import importlib_resources
5
from ..utils.logger import get_logger
6
7
logger = get_logger("orbit")
8
9
+_ORBIT_DIR = Path(__file__).parent.parent
10
+
11
12
def set_cmdstan_path():
- with open(importlib_resources.files("orbit") / "config.json") as f:
13
+ with open(_ORBIT_DIR / "config.json") as f:
14
config = json.load(f)
15
CMDSTAN_VERSION = config["CMDSTAN_VERSION"]
16
- local_cmdstan = (
- importlib_resources.files("orbit")
17
- / "stan_compiled"
18
- / f"cmdstan-{CMDSTAN_VERSION}"
19
- )
+ local_cmdstan = _ORBIT_DIR / "stan_compiled" / f"cmdstan-{CMDSTAN_VERSION}"
20
if local_cmdstan.exists():
21
cmdstanpy.set_cmdstan_path(str(local_cmdstan))
22
logger.debug(
0 commit comments