Skip to content

Commit 0187267

Browse files
committed
Improved code readability.
1 parent ad8b9a6 commit 0187267

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

structure_threader/wrappers/maverick_wrapper.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import sys
2020
import os
2121

22+
from itertools import chain
2223
import numpy as np
2324

2425
from numpy.random import normal as rnorm
@@ -207,7 +208,6 @@ def _write_normalized_output(evidence, k_list, ti_in_use):
207208
"""
208209
Writes the normalized output file.
209210
"""
210-
from itertools import chain
211211
param_entry = "outputEvidenceNormalised"
212212

213213
if param_entry in mav_params:
@@ -230,8 +230,7 @@ def _write_normalized_output(evidence, k_list, ti_in_use):
230230
posterior = [[[p_format.format(x.replace("_grand", ""), i)]
231231
for i in ["_mean", "_LL", "_UL"]]
232232
for x in categories]
233-
flat_posterior = list(chain.from_iterable(
234-
list(chain.from_iterable(posterior))))
233+
flat_posterior = list(chain(*list(chain(*posterior))))
235234

236235
normalized = []
237236
for cat in indep:
@@ -303,9 +302,6 @@ def maverick_normalization(x_mean, x_sd, klist, draws=int(1e6), limit=95):
303302
Performs TI normalization as in the original implementation from MavericK.
304303
This is essentially a port from the C++ code written by Bob Verity.
305304
"""
306-
print(x_mean)
307-
print(x_sd)
308-
print(klist)
309305
# subtract maximum value from x_mean (this has no effect on final outcome
310306
# but prevents under/overflow)
311307
# Just like in the original implementation (even though it should not be

0 commit comments

Comments
 (0)