Skip to content

Commit

Permalink
raise exception if model fails
Browse files Browse the repository at this point in the history
  • Loading branch information
minaskar committed Aug 3, 2021
1 parent e6d85a2 commit 4e69cce
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
author = 'Minas Karamanis'

# The full version, including alpha/beta/rc tags
release = '2.3.0'
release = '2.3.1'

# -- General configuration ---------------------------------------------------

Expand Down
9 changes: 6 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ Getting Started
Citation
========

Please cite `Karamanis & Beutler (2020)
<https://arxiv.org/abs/2002.06212>`_ if you find this code useful in your
research. The BibTeX entry for the paper is::
Please cite the following papers if you found this code useful in your
research::

@article{karamanis2021zeus,
title={zeus: A Python implementation of Ensemble Slice Sampling for efficient Bayesian parameter inference},
Expand All @@ -107,6 +106,10 @@ Copyright 2019-2021 Minas Karamanis and contributors.
Changelog
=========

**2.3.1 (03/08/21)**

- Raise exception if model fails.

**2.3.0 (25/02/21)**

- Added ``sample`` method which advances the chain as a generator.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="zeus-mcmc",
version="2.3.0",
version="2.3.1",
author="Minas Karamanis",
author_email="minaskar@gmail.com",
description="zeus: Lightning Fast MCMC",
Expand Down
28 changes: 13 additions & 15 deletions zeus/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
__bibtex__ = """
@article{zeus,
title={zeus: A Python Implementation of the Ensemble Slice Sampling method},
author={Minas Karamanis and Florian Beutler},
year={2021},
note={in prep}
}
@article{karamanis2021zeus,
title={zeus: A Python implementation of Ensemble Slice Sampling for efficient Bayesian parameter inference},
author={Karamanis, Minas and Beutler, Florian and Peacock, John A},
journal={arXiv preprint arXiv:2105.03468},
year={2021}
}
@article{ess,
title={Ensemble Slice Sampling},
author={Minas Karamanis and Florian Beutler},
year={2020},
eprint={2002.06212},
archivePrefix={arXiv},
primaryClass={stat.ML}
}
@article{karamanis2020ensemble,
title = {Ensemble slice sampling: Parallel, black-box and gradient-free inference for correlated & multimodal distributions},
author = {Karamanis, Minas and Beutler, Florian},
journal = {arXiv preprint arXiv: 2002.06212},
year = {2020}
}
"""

__version__ = "2.3.0"
__version__ = "2.3.1"
__url__ = "https://zeus-mcmc.readthedocs.io"
__author__ = "Minas Karamanis"
__email__ = "minaskar@gmail.com"
Expand Down
13 changes: 12 additions & 1 deletion zeus/fwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@ def __init__(self, f, args, kwargs):
self.kwargs = {} if kwargs is None else kwargs

def __call__(self, x):
return self.f(x, *self.args, **self.kwargs)
try:
return self.f(x, *self.args, **self.kwargs)
except: # pragma: no cover
import traceback

print("zeus: Exception while calling your likelihood function:")
print(" params:", x)
print(" args:", self.args)
print(" kwargs:", self.kwargs)
print(" exception:")
traceback.print_exc()
raise

0 comments on commit 4e69cce

Please sign in to comment.