Skip to content

Commit

Permalink
Remove biwrap from util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Armavica committed Oct 10, 2024
1 parent b19744d commit 166c35c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions pymc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import functools
import warnings

from collections.abc import Sequence
Expand Down Expand Up @@ -248,24 +247,6 @@ def get_transformed(z):
return z


def biwrap(wrapper):
@functools.wraps(wrapper)
def enhanced(*args, **kwargs):
is_bound_method = hasattr(args[0], wrapper.__name__) if args else False
if is_bound_method:
count = 1
else:
count = 0
if len(args) > count:
newfn = wrapper(*args, **kwargs)
return newfn
else:
newwrapper = functools.partial(wrapper, *args, **kwargs)
return newwrapper

return enhanced


def drop_warning_stat(idata: arviz.InferenceData) -> arviz.InferenceData:
"""Return a new ``InferenceData`` object with the "warning" stat removed from sample stats groups.
Expand Down

0 comments on commit 166c35c

Please sign in to comment.