Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed missing import of QTable #188

Merged
merged 10 commits into from
Apr 14, 2022
1 change: 0 additions & 1 deletion docs/reference/benchmarks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 19 additions & 3 deletions protopipe/benchmarks/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 26 additions & 5 deletions protopipe/benchmarks/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions protopipe/benchmarks/utils.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down