Skip to content

Commit

Permalink
fix abc hierarchy (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannikschaelte authored Aug 30, 2022
1 parent 073281a commit 82fa78d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Release Notes
...........


0.12.6 (2022-08-30)
-------------------

Minor:

* Add JOSS paper of version 0.12.5
* Update Julia reference DiffEqJump -> JumpProcesses (name change)
* Unfix jinja2
* Update flake8 dependencies after new issues


0.12.5 (2022-06-21)
-------------------

Expand Down
5 changes: 3 additions & 2 deletions pyabc/sampler/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from abc import ABC, abstractmethod
from abc import ABC, ABCMeta, abstractmethod
from numbers import Real
from typing import Callable, Union

Expand Down Expand Up @@ -33,12 +33,13 @@ def sample_until_n_accepted(self, n, simulate_one, t, **kwargs):
return sample_until_n_accepted


class SamplerMeta(type):
class SamplerMeta(ABCMeta): # noqa: B024
"""
This metaclass handles the checking of sampling output values.
"""

def __init__(cls, name, bases, attrs):
ABCMeta.__init__(cls, name, bases, attrs)
cls.sample_until_n_accepted = wrap_sample(cls.sample_until_n_accepted)


Expand Down
4 changes: 3 additions & 1 deletion pyabc/transition/transitionmeta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
from abc import ABCMeta
from typing import Union

import numpy as np
Expand Down Expand Up @@ -52,13 +53,14 @@ def rvs_single(self):
return rvs_single


class TransitionMeta(type):
class TransitionMeta(ABCMeta): # noqa: B024
"""
This metaclass handles the special case of no parameters.
Transition classes do not have to check for it anymore
"""

def __init__(cls, name, bases, attrs):
ABCMeta.__init__(cls, name, bases, attrs)
cls.fit = wrap_fit(cls.fit)
cls.pdf = wrap_pdf(cls.pdf)
cls.rvs = wrap_rvs(cls.rvs)
Expand Down
2 changes: 1 addition & 1 deletion pyabc/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.12.5'
__version__ = '0.12.6'

0 comments on commit 82fa78d

Please sign in to comment.