diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa272f02..5d51d7b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,4 +27,7 @@ repos: magicctapipe/version.py| .*__init__.py| .*/tests/.* - )$ \ No newline at end of file + )$ + +default_language_version: + python: python3 \ No newline at end of file diff --git a/magicctapipe/io/io.py b/magicctapipe/io/io.py index 11ea135a..6009a12a 100644 --- a/magicctapipe/io/io.py +++ b/magicctapipe/io/io.py @@ -1325,7 +1325,15 @@ def load_irf_files(input_dir_irf): unique_bins = np.unique(irf_data[key], axis=0) if len(unique_bins) > 1: - raise RuntimeError(f"The binning of '{key}' do not match.") + if not np.all( + np.abs(unique_bins - unique_bins[0]) < unique_bins[0] * 1.0e-15 + ): + raise RuntimeError(f"The binning of '{key}' do not match.") + else: + logger.warning( + f"The bins of '{key}' do not match, but the difference is within numerical precision, ignoring" + ) + irf_data[key] = unique_bins[0] else: # Set the unique bins