Commit fe27ada4 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix issue in Overlap/Covariate/BlockState.__check_clabel()

parent 5908da56
...@@ -264,12 +264,12 @@ class BlockState(object): ...@@ -264,12 +264,12 @@ class BlockState(object):
deg_corr=self.deg_corr if deg_corr is None else deg_corr, deg_corr=self.deg_corr if deg_corr is None else deg_corr,
max_BE=self.max_BE, **kwargs) max_BE=self.max_BE, **kwargs)
if not state.__check_clabel(): if not state.__check_clabel() and kwargs.get("fix_clabel", True):
if _bm_test() or not kwargs.get("fix_clabel", True) : b = state.b.fa + state.clabel.fa * state.B
raise RuntimeError("Inconsistent clabel after copy!")
b = state.b.a + state.clabel.a * state.B
continuous_map(b) continuous_map(b)
state = state.copy(b=b, fix_clabel=False) state = state.copy(b=b, fix_clabel=False)
if not state.__check_clabel():
raise RuntimeError("Inconsistent clabel after copy!")
return state return state
......
...@@ -509,12 +509,12 @@ class CovariateBlockState(BlockState): ...@@ -509,12 +509,12 @@ class CovariateBlockState(BlockState):
eindex=self.total_state.eindex if self.overlap else None, eindex=self.total_state.eindex if self.overlap else None,
ec_done=ec is None) ec_done=ec is None)
if not state._BlockState__check_clabel(): if not state._BlockState__check_clabel() and kwargs.get("fix_clabel", True):
if _bm_test() or not kwargs.get("fix_clabel", True) : b = state.b.fa + state.clabel.fa * state.B
raise RuntimeError("Inconsistent clabel after copy!")
b = state.b.a + state.clabel.a * state.B
continuous_map(b) continuous_map(b)
state = state.copy(b=b, fix_clabel=False) state = state.copy(b=b, fix_clabel=False)
if not state._BlockState__check_clabel():
raise RuntimeError("Inconsistent clabel after copy!")
return state return state
......
...@@ -281,12 +281,12 @@ class OverlapBlockState(BlockState): ...@@ -281,12 +281,12 @@ class OverlapBlockState(BlockState):
deg_corr=self.deg_corr if deg_corr is None else deg_corr, deg_corr=self.deg_corr if deg_corr is None else deg_corr,
max_BE=self.max_BE) max_BE=self.max_BE)
if not state._BlockState__check_clabel(): if not state._BlockState__check_clabel() and kwargs.get("fix_clabel", True):
if _bm_test() or not kwargs.get("fix_clabel", True) : b = state.b.fa + state.clabel.fa * state.B
raise RuntimeError("Inconsistent clabel after copy!")
b = state.b.a + state.clabel.a * state.B
continuous_map(b) continuous_map(b)
state = state.copy(b=b, fix_clabel=False) state = state.copy(b=b, fix_clabel=False)
if not state._BlockState__check_clabel():
raise RuntimeError("Inconsistent clabel after copy!")
return state return state
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment