Skip to content

Commit c4353c9

Browse files
committed
fixed some style issues
1 parent f0f81ca commit c4353c9

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

csep/core/poisson_evaluations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from csep.core.exceptions import CSEPCatalogException
1212

1313

14-
def paired_t_test(forecast, benchmark_forecast, observed_catalog, alpha=0.05,
15-
scale=False):
14+
def paired_t_test(forecast, benchmark_forecast, observed_catalog,
15+
alpha=0.05, scale=False):
1616
""" Computes the t-test for gridded earthquake forecasts.
1717
1818
This score is positively oriented, meaning that positive values of the information gain indicate that the

csep/utils/plots.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"""
3939

4040

41-
def plot_cumulative_events_versus_time_dev(xdata, ydata, obs_data, plot_args,
42-
show=False):
41+
def plot_cumulative_events_versus_time_dev(xdata, ydata, obs_data,
42+
plot_args, show=False):
4343
"""
4444
4545
@@ -492,8 +492,8 @@ def plot_magnitude_histogram_dev(ses_data, obs, plot_args, show=False):
492492
filename = plot_args.get('filename', None)
493493

494494
ax.errorbar(bin_edges_plot, u3etas_median, yerr=[u3etas_emin, u3etas_emax],
495-
xerr=0.8 * dmw / 2, fmt=' ',
496-
label=sim_label, color='blue', alpha=0.7)
495+
xerr=0.8 * dmw / 2, fmt=' ', label=sim_label,
496+
color='blue', alpha=0.7)
497497
ax.plot(bin_edges_plot, obs_hist, '.k', markersize=10, label=obs_label)
498498
ax.legend(loc='upper right')
499499
ax.set_xlim(xlim)
@@ -920,7 +920,7 @@ def plot_spatial_dataset(gridded, region, ax=None, show=False, extent=None,
920920
if extent is None and not set_global:
921921
extent = [bbox[0], bbox[1], bbox[2], bbox[3]]
922922

923-
# Retrieve plot arguments
923+
# Retrieve plot arguments
924924
plot_args = plot_args or {}
925925
# figure and axes properties
926926
figsize = plot_args.get('figsize', None)
@@ -1651,8 +1651,8 @@ def plot_poisson_consistency_test(eval_results, normalize=False,
16511651
_get_marker_style(observed_statistic, (plow, phigh),
16521652
one_sided_lower))
16531653
ax.errorbar(mean, index, xerr=percentile_lims,
1654-
fmt='ko' * plot_mean,
1655-
capsize=capsize, linewidth=linewidth, ecolor=color)
1654+
fmt='ko' * plot_mean, capsize=capsize,
1655+
linewidth=linewidth, ecolor=color)
16561656
# determine the limits to use
16571657
xlims.append((plow, phigh, observed_statistic))
16581658
# we want to only extent the distribution where it falls outside of it in the acceptable tail
@@ -1744,8 +1744,7 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None):
17441744
ax.axvspan(index - 0.5, index + 0.5, alpha=0.5, facecolor='red')
17451745
else:
17461746
ax.errorbar(index, result_t.observed_statistic,
1747-
yerr=numpy.array([[ylow, yhigh]]).T,
1748-
color=color,
1747+
yerr=numpy.array([[ylow, yhigh]]).T, color=color,
17491748
linewidth=linewidth, capsize=capsize)
17501749

17511750
if result_w is not None:
@@ -1887,8 +1886,8 @@ def plot_consistency_test(eval_results, normalize=False, axes=None,
18871886
_get_marker_style(observed_statistic, (plow, phigh),
18881887
one_sided_lower))
18891888
ax.errorbar(mean, index, xerr=percentile_lims,
1890-
fmt='ko' * plot_mean,
1891-
capsize=capsize, linewidth=linewidth, ecolor=color)
1889+
fmt='ko' * plot_mean, capsize=capsize,
1890+
linewidth=linewidth, ecolor=color)
18921891
# determine the limits to use
18931892
xlims.append((plow, phigh, observed_statistic))
18941893
# we want to only extent the distribution where it falls outside of it in the acceptable tail
@@ -1989,10 +1988,12 @@ def plot_pvalues_and_intervals(test_results, ax, var=None):
19891988
mean = test_results[i].test_distribution[1]
19901989
upsilon = 1.0 - ((variance - mean) / variance)
19911990
tau = (mean ** 2 / (variance - mean))
1992-
phigh97 = scipy.stats.nbinom.ppf((1 - percentile / 100.) / 2.,
1993-
tau, upsilon)
1991+
phigh97 = scipy.stats.nbinom.ppf(
1992+
(1 - percentile / 100.) / 2., tau, upsilon
1993+
)
19941994
plow97 = scipy.stats.nbinom.ppf(
1995-
1 - (1 - percentile / 100.) / 2., tau, upsilon)
1995+
1 - (1 - percentile / 100.) / 2., tau, upsilon
1996+
)
19961997
low97 = test_results[i].observed_statistic - plow97
19971998
high97 = phigh97 - test_results[i].observed_statistic
19981999
ax.errorbar(test_results[i].observed_statistic,

0 commit comments

Comments
 (0)