From a9812ad188bf65366e9f681187f34fe21b918be2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:35:08 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/mattlqx/pre-commit-sign: v1.1.3 → v1.2.0](https://github.com/mattlqx/pre-commit-sign/compare/v1.1.3...v1.2.0) - [github.com/asottile/pyupgrade: v3.15.0 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.16.0) - [github.com/nbQA-dev/nbQA: 1.7.1 → 1.8.5](https://github.com/nbQA-dev/nbQA/compare/1.7.1...1.8.5) - [github.com/psf/black: 23.12.1 → 24.4.2](https://github.com/psf/black/compare/23.12.1...24.4.2) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f2f5dc..037fd97 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -20,7 +20,7 @@ repos: - id: check-ast - repo: https://github.com/mattlqx/pre-commit-sign - rev: v1.1.3 + rev: v1.2.0 hooks: - id: sign-commit - repo: https://github.com/pre-commit/pygrep-hooks @@ -31,7 +31,7 @@ repos: - id: rst-directive-colons - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.16.0 hooks: - id: pyupgrade args: [ --py36-plus ] @@ -43,7 +43,7 @@ repos: # Notebook formatting - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 + rev: 1.8.5 hooks: - id: nbqa-pyupgrade @@ -57,6 +57,6 @@ repos: stages: [ manual ] - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.4.2 hooks: - id: black From ebfedcc1fb26ecf423199439387da1b03983cc5b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 00:35:21 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .travis.yml | 1 - raredecay/analysis/compatibility_tools.py | 1 - raredecay/analysis/ml_analysis.py | 2 ++ raredecay/analysis/physical_analysis.py | 1 - raredecay/config.py | 1 - raredecay/data.py | 1 - raredecay/globals_.py | 1 - raredecay/meta_config.py | 2 +- raredecay/ml.py | 1 - raredecay/reweight.py | 1 - raredecay/score.py | 1 - raredecay/settings.py | 1 - raredecay/tools/__init__.py | 1 + raredecay/tools/data_storage.py | 1 - raredecay/tools/data_tools.py | 1 - raredecay/tools/dev_tool.py | 1 - raredecay/tools/metrics.py | 1 - raredecay/tools/output.py | 1 - requirements.txt | 2 +- scripts_readyToUse/reweightCV_score_example.py | 1 + 20 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b13789..e69de29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +0,0 @@ - diff --git a/raredecay/analysis/compatibility_tools.py b/raredecay/analysis/compatibility_tools.py index 5248591..8e92596 100644 --- a/raredecay/analysis/compatibility_tools.py +++ b/raredecay/analysis/compatibility_tools.py @@ -8,7 +8,6 @@ """ - from raredecay.tools import dev_tool diff --git a/raredecay/analysis/ml_analysis.py b/raredecay/analysis/ml_analysis.py index 7ea8d96..e35493c 100644 --- a/raredecay/analysis/ml_analysis.py +++ b/raredecay/analysis/ml_analysis.py @@ -20,6 +20,7 @@ The functions serve as basic tools, which do already a lot of the work. """ + import copy import timeit import warnings @@ -1379,6 +1380,7 @@ def mcreweighted_as_real( # collect all the new weights to get a really cross-validated reweighted dataset + # COMPATIBILITY LAYER START # OLD FUNCTION, DEPRECEATED def reweight_Kfold( diff --git a/raredecay/analysis/physical_analysis.py b/raredecay/analysis/physical_analysis.py index 2f58a3b..41b6546 100644 --- a/raredecay/analysis/physical_analysis.py +++ b/raredecay/analysis/physical_analysis.py @@ -16,7 +16,6 @@ values. """ - import copy import matplotlib.pyplot as plt diff --git a/raredecay/config.py b/raredecay/config.py index b88fffe..fd08988 100644 --- a/raredecay/config.py +++ b/raredecay/config.py @@ -6,7 +6,6 @@ @author: Jonas Eschle "Mayou36" """ - __all__ = ["RUN_NAME", "run_message", "OUTPUT_CFG", "save_fig_cfg", "logger_cfg"] RUN_NAME = "Default run name" diff --git a/raredecay/data.py b/raredecay/data.py index 796341f..619deec 100644 --- a/raredecay/data.py +++ b/raredecay/data.py @@ -4,7 +4,6 @@ """ - from raredecay.analysis.physical_analysis import add_branch_to_rootfile from raredecay.tools.data_storage import HEPDataStorage from raredecay.tools.data_tools import adv_return, make_root_dict, to_list, try_unpickle diff --git a/raredecay/globals_.py b/raredecay/globals_.py index 07a7928..8f2dd7c 100644 --- a/raredecay/globals_.py +++ b/raredecay/globals_.py @@ -47,7 +47,6 @@ can be extended if wanted """ - from . import config as cfg from . import meta_config as meta_cfg from .tools import output diff --git a/raredecay/meta_config.py b/raredecay/meta_config.py index f7da107..590b466 100644 --- a/raredecay/meta_config.py +++ b/raredecay/meta_config.py @@ -242,7 +242,7 @@ def set_parallel_profile(n_cpu=-1, gpu_in_use=False, stratified_kfolding=True): # about but may be happy to have them saved somewhere) DEFAULT_EXT_SAVE_FIG = dict( file_format=["png", "pdf"], - to_pickle=True + to_pickle=True, # save_cfg=None ) diff --git a/raredecay/ml.py b/raredecay/ml.py index c692e82..cb5676e 100644 --- a/raredecay/ml.py +++ b/raredecay/ml.py @@ -4,7 +4,6 @@ """ - try: from raredecay.analysis.ml_analysis import ( backward_feature_elimination, diff --git a/raredecay/reweight.py b/raredecay/reweight.py index 03f2755..bcfb8dd 100644 --- a/raredecay/reweight.py +++ b/raredecay/reweight.py @@ -4,7 +4,6 @@ """ - try: from raredecay.analysis.reweight import reweight, reweight_kfold except Exception as err: diff --git a/raredecay/score.py b/raredecay/score.py index a1e72d7..f56a90b 100644 --- a/raredecay/score.py +++ b/raredecay/score.py @@ -4,7 +4,6 @@ """ - try: from raredecay.analysis.ml_analysis import mcreweighted_as_real from raredecay.tools.ml_scores import mayou_score, train_similar, train_similar_new diff --git a/raredecay/settings.py b/raredecay/settings.py index 8f31ba1..ae8637e 100644 --- a/raredecay/settings.py +++ b/raredecay/settings.py @@ -4,7 +4,6 @@ @author: Jonas Eschle "Mayou36" """ - __all__ = [ "initialize", "finalize", diff --git a/raredecay/tools/__init__.py b/raredecay/tools/__init__.py index 9d9cf36..6c7bdf8 100644 --- a/raredecay/tools/__init__.py +++ b/raredecay/tools/__init__.py @@ -5,4 +5,5 @@ DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED!DEPRECEATED! """ + # diff --git a/raredecay/tools/data_storage.py b/raredecay/tools/data_storage.py index 635749c..6df5e13 100644 --- a/raredecay/tools/data_storage.py +++ b/raredecay/tools/data_storage.py @@ -12,7 +12,6 @@ takes data, weights, targets, names and converts automatically, plots and more. """ - import copy import math import random diff --git a/raredecay/tools/data_tools.py b/raredecay/tools/data_tools.py index a9652cb..f7d6ac7 100644 --- a/raredecay/tools/data_tools.py +++ b/raredecay/tools/data_tools.py @@ -11,7 +11,6 @@ Contains several tools to convert, load, save and plot data """ - import copy import os import pickle diff --git a/raredecay/tools/dev_tool.py b/raredecay/tools/dev_tool.py index c73d72d..fa0a303 100644 --- a/raredecay/tools/dev_tool.py +++ b/raredecay/tools/dev_tool.py @@ -11,7 +11,6 @@ Contains several useful tools for all kind of programs """ - import collections import numpy as np diff --git a/raredecay/tools/metrics.py b/raredecay/tools/metrics.py index 288450c..cf163a3 100644 --- a/raredecay/tools/metrics.py +++ b/raredecay/tools/metrics.py @@ -9,7 +9,6 @@ """ - import math as mt import numpy as np diff --git a/raredecay/tools/output.py b/raredecay/tools/output.py index bf9e9f8..7c89813 100644 --- a/raredecay/tools/output.py +++ b/raredecay/tools/output.py @@ -9,7 +9,6 @@ """ - import copy import io as StringIO import os diff --git a/requirements.txt b/requirements.txt index 7ed1e29..ae1ebf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,9 +3,9 @@ hep_ml>=0.5.0 matplotlib numpy pandas -scipy rep @ git+https://github.com/REPlegacy/rep scikit-learn~=0.19.0 # otherwise, breaks REP +scipy seaborn uproot xgboost<1.3 # TODO: negative weights and xgboost don't go well, error in 1.3+ diff --git a/scripts_readyToUse/reweightCV_score_example.py b/scripts_readyToUse/reweightCV_score_example.py index 4e2a94a..58444ef 100644 --- a/scripts_readyToUse/reweightCV_score_example.py +++ b/scripts_readyToUse/reweightCV_score_example.py @@ -8,6 +8,7 @@ The raredecay package is available at https://github.com/mayou36/raredecay """ + from raredecay import settings # first of all, it is advised to set some run-configurations like logger-level,