Skip to content

Commit 0649ae3

Browse files
committed
Merge branch 'develop' of https://github.com/stan-dev/cmdstanpy into develop
2 parents 175e18e + 2d5d234 commit 0649ae3

65 files changed

Lines changed: 6094 additions & 2944 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmdstanpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def _cleanup_tmpdir() -> None:
5050
from .utils import set_cmdstan_path # noqa
5151
from .utils import (
5252
cmdstan_path,
53+
cmdstan_version,
5354
install_cmdstan,
5455
set_make_env,
5556
show_versions,
@@ -71,4 +72,5 @@ def _cleanup_tmpdir() -> None:
7172
'write_stan_json',
7273
'show_versions',
7374
'rebuild_cmdstan',
75+
'cmdstan_version',
7476
]

cmdstanpy/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""PyPi Version"""
22

3-
__version__ = '1.0.0rc1'
3+
__version__ = '1.0.0rc2'

cmdstanpy/compiler_opts.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ def __repr__(self) -> str:
6767
self._stanc_options, self._cpp_options
6868
)
6969

70+
def __eq__(self, other: Any) -> bool:
71+
"""Overrides the default implementation"""
72+
if self.is_empty() and other is None: # equiv w/r/t compiler
73+
return True
74+
if not isinstance(other, CompilerOptions):
75+
return False
76+
return (
77+
self._stanc_options == other.stanc_options
78+
and self._cpp_options == other.cpp_options
79+
and self._user_header == other.user_header
80+
)
81+
82+
def is_empty(self) -> bool:
83+
"""True if no options specified."""
84+
return (
85+
self._stanc_options == {}
86+
and self._cpp_options == {}
87+
and self._user_header == ''
88+
)
89+
7090
@property
7191
def stanc_options(self) -> Dict[str, Union[bool, int, str]]:
7292
"""Stanc compiler options."""
@@ -77,6 +97,11 @@ def cpp_options(self) -> Dict[str, Union[bool, int]]:
7797
"""C++ compiler options."""
7898
return self._cpp_options
7999

100+
@property
101+
def user_header(self) -> str:
102+
"""user header."""
103+
return self._user_header
104+
80105
def validate(self) -> None:
81106
"""
82107
Check compiler args.

cmdstanpy/install_cxx_toolchain.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
from typing import Any, Dict, List
2525

2626
from cmdstanpy import _DOT_CMDSTAN
27-
from cmdstanpy.utils import (
28-
pushd,
29-
validate_dir,
30-
wrap_url_progress_hook,
31-
)
27+
from cmdstanpy.utils import pushd, validate_dir, wrap_url_progress_hook
3228

3329
EXTENSION = '.exe' if platform.system() == 'Windows' else ''
3430
IS_64BITS = sys.maxsize > 2 ** 32

0 commit comments

Comments
 (0)