Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions alea/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import yaml
import itertools
import blueice
import warnings
from glob import glob
from copy import deepcopy
Expand Down Expand Up @@ -882,4 +881,6 @@ def make_interpolator(self, f, extra_dims, anchor_models):
return lambda z: f(anchor_models[tuple(z)])


blueice.pdf_morphers.MORPHERS["IndexMorpher"] = IndexMorpher
from blueice.likelihood import MORPHERS # noqa: E402

MORPHERS["IndexMorpher"] = IndexMorpher
17 changes: 17 additions & 0 deletions tests/test_morpher_registration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Alea's IndexMorpher must end up in the registry blueice actually reads."""

import blueice.likelihood

from alea.utils import IndexMorpher


def test_index_morpher_is_registered_where_blueice_looks():
"""This is the dict LogLikelihoodBase.prepare indexes with likelihood_config's 'morpher' option,
so registering anywhere else is a silent no-op."""
assert blueice.likelihood.MORPHERS["IndexMorpher"] is IndexMorpher


def test_index_morpher_is_a_morpher():
from blueice.pdf_morphers import Morpher

assert issubclass(IndexMorpher, Morpher)
Loading