diff --git a/docs/reference/benchmarks.rst b/docs/reference/benchmarks.rst index ad1d0f54..109929e4 100644 --- a/docs/reference/benchmarks.rst +++ b/docs/reference/benchmarks.rst @@ -26,4 +26,3 @@ API reference ------------- .. automodapi:: protopipe.benchmarks - :skip: accuracy_score, auc, binned_statistic, curve_fit, roc_curve, Column, LogNorm, Table, Path, cone_solid_angle, RectBivariateSpline, read_table \ No newline at end of file diff --git a/protopipe/benchmarks/operations.py b/protopipe/benchmarks/operations.py index 06c3a5c1..70cf7d97 100644 --- a/protopipe/benchmarks/operations.py +++ b/protopipe/benchmarks/operations.py @@ -12,13 +12,29 @@ we should really try to synchronize in some way with ctaplot/ctabenchmarks. """ +__all__ = [ + "compute_weight_BTEL1010", + "add_BTEL1010_weigths_to_data", + "average_bias_of_charge_resolution", + "calculate_RMS_around_1", + "prepare_requirements", + "compute_resolution", + "compute_bias", + "get_evt_subarray_model_output", + "sum_of_squares", + "OnlineBinnedStats", + "create_lookup_function", + "compute_psf", + "load_tel_id", +] + from pathlib import Path -from astropy.table import Table, Column import astropy.units as u -from scipy.stats import binned_statistic -from scipy.interpolate import RectBivariateSpline import numpy as np +from astropy.table import Column, Table +from scipy.interpolate import RectBivariateSpline +from scipy.stats import binned_statistic try: from ctapipe.io import read_table diff --git a/protopipe/benchmarks/plot.py b/protopipe/benchmarks/plot.py index 26a4187e..fb7f823a 100644 --- a/protopipe/benchmarks/plot.py +++ b/protopipe/benchmarks/plot.py @@ -13,18 +13,39 @@ The implementation of functions and classes is far from perfect and we should really try to synchronize in some way with ctaplot/ctabenchmarks. """ -import numpy as np import astropy.units as u import matplotlib.pyplot as plt +import numpy as np +from astropy.table import QTable from matplotlib.colors import LogNorm -from scipy.stats import binned_statistic, norm -from sklearn.metrics import auc, roc_curve, accuracy_score -from scipy.optimize import curve_fit from pyirf.utils import cone_solid_angle - +from scipy.optimize import curve_fit +from scipy.stats import binned_statistic, norm +from sklearn.metrics import accuracy_score, auc, roc_curve LOWER_SIGMA_QUANTILE, UPPER_SIGMA_QUANTILE = norm().cdf([-1, 1]) +__all__ = [ + "plot_profile", + "plot_DL1a_reco_true_correlation", + "plot_resolution", + "plot_bias", + "get_single_pixels_spectrum", + "plot_sensitivity_from_pyirf", + "plot_binned_mean", + "plot_binned_median", + "plot_hist", + "plot_distributions", + "plot_roc_curve", + "plot_evt_roc_curve_variation", + "plot_psf", + "plot_background_rate", + "BoostedDecisionTreeDiagnostic", + "ModelDiagnostic", + "RegressorDiagnostic", + "ClassifierDiagnostic", +] + def plot_profile(ax, data, xcol, ycol, n_xbin, x_range, logx=False, **kwargs): """Plot a profiled histogram. diff --git a/protopipe/benchmarks/utils.py b/protopipe/benchmarks/utils.py index 982592f3..8f3de455 100644 --- a/protopipe/benchmarks/utils.py +++ b/protopipe/benchmarks/utils.py @@ -1,5 +1,7 @@ import numpy as np +__all__ = ["raise_", "string_to_boolean", "add_stats", "get_fig_size"] + def raise_(ex): """Raise an exception as a statement.