mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-17 08:40:56 +00:00
Error for unrecognized options in StanBackend.set_options
This commit is contained in:
parent
4e99ac686e
commit
74b21f7cd9
1 changed files with 7 additions and 3 deletions
|
|
@ -28,8 +28,12 @@ class IStanBackend(ABC):
|
||||||
Specify model options as kwargs.
|
Specify model options as kwargs.
|
||||||
* newton_fallback [bool]: whether to fallback to Newton if L-BFGS fails
|
* newton_fallback [bool]: whether to fallback to Newton if L-BFGS fails
|
||||||
"""
|
"""
|
||||||
if 'newton_fallback' in kwargs:
|
for k, v in kwargs.items():
|
||||||
self.newton_fallback = kwargs['newton_fallback']
|
if k == 'newton_fallback':
|
||||||
|
self.newton_fallback = v
|
||||||
|
else:
|
||||||
|
raise ValueError(f'Unknown option {k}')
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
@ -291,4 +295,4 @@ class StanBackendEnum(Enum):
|
||||||
try:
|
try:
|
||||||
return StanBackendEnum[name].value
|
return StanBackendEnum[name].value
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
raise ValueError("Unknown stan backend: {}".format(name)) from e
|
raise ValueError("Unknown stan backend: {}".format(name)) from e
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue