diff --git a/src/westpa/mclib/_mclib.pyx b/src/westpa/mclib/_mclib.pyx index 54f01d550..f1e648f95 100644 --- a/src/westpa/mclib/_mclib.pyx +++ b/src/westpa/mclib/_mclib.pyx @@ -145,8 +145,8 @@ cpdef mcbs_ci(dataset, estimator, alpha, dlen, n_sets=None, args=None, kwargs=No del indices f_synth_sorted = sort(f_synth) - lbi = int(math.floor(n_sets*alpha/2.0)) - ubi = int(math.ceil(n_sets*(1-alpha/2.0))) + lbi = math.floor(n_sets*alpha/2.0) + ubi = math.ceil(n_sets*(1-alpha/2.0)) lb = f_synth_sorted[lbi] ub = f_synth_sorted[ubi] sterr = numpy.std(f_synth_sorted) @@ -194,8 +194,8 @@ cpdef mcbs_correltime_small(dataset, alpha, n_sets): raise ValueError('alpha ({}) > 0.5'.format(alpha)) dlen = len(dataset) - lbi = int(math.floor(n_sets*alpha/2.0)) - ubi = int(math.ceil(n_sets*(1-alpha/2.0))) + lbi = math.floor(n_sets*alpha/2.0) + ubi = math.ceil(n_sets*(1-alpha/2.0)) synth_sets = numpy.empty((n_sets,)+dataset.shape, dtype=dataset.dtype) synth_acf_elems = numpy.empty((n_sets,), numpy.float64) diff --git a/src/westpa/oldtools/aframe/mcbs.py b/src/westpa/oldtools/aframe/mcbs.py index f42a855ab..24f3f7261 100644 --- a/src/westpa/oldtools/aframe/mcbs.py +++ b/src/westpa/oldtools/aframe/mcbs.py @@ -50,7 +50,7 @@ def process_args(self, args, upcall=True): self.mcbs_alpha = 1 - args.mcbs_confidence self.mcbs_nsets = args.mcbs_size if args.mcbs_nsets else min(1000, calc_mcbs_nsets(self.mcbs_alpha)) self.mcbs_display_confidence = '{:.{cp}f}'.format( - 100 * args.mcbs_confidence, cp=-int(math.floor(math.log10(self.mcbs_alpha))) - 2 + 100 * args.mcbs_confidence, cp=-math.floor(math.log10(self.mcbs_alpha)) - 2 ) westpa.rc.pstatus( 'Using bootstrap of {:d} sets to calculate {:s}% confidence interval (alpha={:g}).'.format( @@ -85,7 +85,7 @@ def calc_mcbs_nsets(alpha): def calc_ci_bound_indices(n_sets, alpha): - return (int(math.floor(n_sets * alpha / 2)), int(math.ceil(n_sets * (1 - alpha / 2)))) + return (math.floor(n_sets * alpha / 2), math.ceil(n_sets * (1 - alpha / 2))) def bootstrap_ci_ll(estimator, data, alpha, n_sets, storage, sort, eargs=(), ekwargs={}, fhat=None): @@ -105,8 +105,8 @@ def bootstrap_ci_ll(estimator, data, alpha, n_sets, storage, sort, eargs=(), ekw storage[iset] = estimator(data[indices], *eargs, **ekwargs) synth_sorted = sort(storage) - lbi = int(math.floor(n_sets * alpha / 2)) - ubi = int(math.ceil(n_sets * (1 - alpha / 2))) + lbi = math.floor(n_sets * alpha / 2) + ubi = math.ceil(n_sets * (1 - alpha / 2)) lb = synth_sorted[lbi] ub = synth_sorted[ubi] diff --git a/src/westpa/oldtools/stats/mcbs.py b/src/westpa/oldtools/stats/mcbs.py index 02878a21d..cc7264725 100644 --- a/src/westpa/oldtools/stats/mcbs.py +++ b/src/westpa/oldtools/stats/mcbs.py @@ -74,8 +74,8 @@ def bootstrap_ci(estimator, data, alpha, n_sets=None, args=(), kwargs={}, sort=n f_synth[i] = estimator(data[indices], *args, **kwargs) f_synth_sorted = sort(f_synth) - lbi = int(math.floor(n_sets * alpha / 2)) - ubi = int(math.ceil(n_sets * (1 - alpha / 2))) + lbi = math.floor(n_sets * alpha / 2) + ubi = math.ceil(n_sets * (1 - alpha / 2)) lb = f_synth_sorted[lbi] ub = f_synth_sorted[ubi] diff --git a/src/westpa/tools/binning.py b/src/westpa/tools/binning.py index 668d18ef6..867a87446 100644 --- a/src/westpa/tools/binning.py +++ b/src/westpa/tools/binning.py @@ -144,7 +144,7 @@ def write_bin_info(mapper, assignments, weights, n_target_states, outfile=sys.st min_seg_weight = weights.min() max_seg_weight = weights.max() - ndec = int(math.ceil(-math.log10(1 / n_active))) + ndec = math.ceil(-math.log10(1 / n_active)) outfile.write('{:d} segments\n'.format(len(weights))) outfile.write(