mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-05-25 22:26:34 +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.
|
||||
* newton_fallback [bool]: whether to fallback to Newton if L-BFGS fails
|
||||
"""
|
||||
if 'newton_fallback' in kwargs:
|
||||
self.newton_fallback = kwargs['newton_fallback']
|
||||
for k, v in kwargs.items():
|
||||
if k == 'newton_fallback':
|
||||
self.newton_fallback = v
|
||||
else:
|
||||
raise ValueError(f'Unknown option {k}')
|
||||
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
|
|
@ -291,4 +295,4 @@ class StanBackendEnum(Enum):
|
|||
try:
|
||||
return StanBackendEnum[name].value
|
||||
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