From ba63d67ff38fed6c353ac128b588faa09f79824e Mon Sep 17 00:00:00 2001
From: saganatt <8majak8@gmail.com>
Date: Mon, 14 Jul 2025 07:59:44 +0200
Subject: [PATCH] Rename io to io_ml_utils to avoid name clashes
---
machine_learning_hep/analysis/analyzer.py | 2 +-
machine_learning_hep/analysis/systematics.py | 2 +-
machine_learning_hep/fitting/simple_fit.py | 2 +-
machine_learning_hep/fitting/utils.py | 2 +-
.../{io.py => io_ml_utils.py} | 24 ++++++++++---------
machine_learning_hep/multiprocesser.py | 2 +-
.../optimisation/bayesian_opt.py | 2 +-
.../optimisation/grid_search.py | 2 +-
machine_learning_hep/optimiser.py | 2 +-
machine_learning_hep/processer.py | 2 +-
machine_learning_hep/utilities_plot.py | 2 +-
11 files changed, 23 insertions(+), 21 deletions(-)
rename machine_learning_hep/{io.py => io_ml_utils.py} (66%)
diff --git a/machine_learning_hep/analysis/analyzer.py b/machine_learning_hep/analysis/analyzer.py
index 2eb975984a..7f9d5d181c 100644
--- a/machine_learning_hep/analysis/analyzer.py
+++ b/machine_learning_hep/analysis/analyzer.py
@@ -16,7 +16,7 @@
from os import makedirs
from os.path import exists, join
-from machine_learning_hep.io import dump_yaml_from_dict
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict
# HF specific imports
from machine_learning_hep.workflow.workflow_base import WorkflowBase
diff --git a/machine_learning_hep/analysis/systematics.py b/machine_learning_hep/analysis/systematics.py
index 6482e83ef6..229528b138 100644
--- a/machine_learning_hep/analysis/systematics.py
+++ b/machine_learning_hep/analysis/systematics.py
@@ -32,7 +32,7 @@
from ROOT import TCanvas, TFile, TGraphErrors, TLegend, kAzure, kBlack, kBlue, kGreen, kOrange, kRed, kViolet, kYellow
from machine_learning_hep.fitting.helpers import MLFitter
-from machine_learning_hep.io import dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict, parse_yaml
from machine_learning_hep.logger import get_logger
from machine_learning_hep.multiprocesser import MultiProcesser
from machine_learning_hep.utilities_plot import load_root_style
diff --git a/machine_learning_hep/fitting/simple_fit.py b/machine_learning_hep/fitting/simple_fit.py
index 2c009bd77b..4d8b1a5778 100644
--- a/machine_learning_hep/fitting/simple_fit.py
+++ b/machine_learning_hep/fitting/simple_fit.py
@@ -24,7 +24,7 @@
from machine_learning_hep.fitting.fitters import FitAliHF, FitROOTGauss
from machine_learning_hep.fitting.utils import save_fit
-from machine_learning_hep.io import parse_yaml
+from machine_learning_hep.io_ml_utils import parse_yaml
from machine_learning_hep.logger import configure_logger # , get_logger
#############################################################################
diff --git a/machine_learning_hep/fitting/utils.py b/machine_learning_hep/fitting/utils.py
index f9c70b7a68..a1a76d5620 100644
--- a/machine_learning_hep/fitting/utils.py
+++ b/machine_learning_hep/fitting/utils.py
@@ -28,7 +28,7 @@
# pylint: disable=import-error, no-name-in-module, unused-import
from ROOT import TFile
-from machine_learning_hep.io import checkdir, dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import checkdir, dump_yaml_from_dict, parse_yaml
from machine_learning_hep.logger import get_logger
diff --git a/machine_learning_hep/io.py b/machine_learning_hep/io_ml_utils.py
similarity index 66%
rename from machine_learning_hep/io.py
rename to machine_learning_hep/io_ml_utils.py
index 26fa320cfe..6e22dd38d3 100644
--- a/machine_learning_hep/io.py
+++ b/machine_learning_hep/io_ml_utils.py
@@ -1,14 +1,16 @@
-# © Copyright CERN 2018. All rights not expressly granted are reserved. #
-# Author: Gian.Michele.Innocenti@cern.ch #
-# This program is free software: you can redistribute it and/or modify it #
-# under the terms of the GNU General Public License as published by the #
-# Free Software Foundation, either version 3 of the License, or (at your #
-# option) any later version. This program is distributed in the hope that #
-# it will be useful, but WITHOUT ANY WARRANTY; without even the implied #
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU General Public License for more details. #
-# You should have received a copy of the GNU General Public License #
-# along with this program. if not, see . #
+#############################################################################
+## © Copyright CERN 2024. All rights not expressly granted are reserved. ##
+## Author: Gian.Michele.Innocenti@cern.ch ##
+## This program is free software: you can redistribute it and/or modify it ##
+## under the terms of the GNU General Public License as published by the ##
+## Free Software Foundation, either version 3 of the License, or (at your ##
+## option) any later version. This program is distributed in the hope that ##
+## it will be useful, but WITHOUT ANY WARRANTY; without even the implied ##
+## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ##
+## See the GNU General Public License for more details. ##
+## You should have received a copy of the GNU General Public License ##
+## along with this program. if not, see . ##
+#############################################################################
"""
Methods to: manage input/output
diff --git a/machine_learning_hep/multiprocesser.py b/machine_learning_hep/multiprocesser.py
index cfe999c2d5..9fd4048378 100755
--- a/machine_learning_hep/multiprocesser.py
+++ b/machine_learning_hep/multiprocesser.py
@@ -19,7 +19,7 @@
import os
import tempfile
-from machine_learning_hep.io import dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict, parse_yaml
from machine_learning_hep.logger import get_logger
from machine_learning_hep.utilities import merge_method, mergerootfiles
diff --git a/machine_learning_hep/optimisation/bayesian_opt.py b/machine_learning_hep/optimisation/bayesian_opt.py
index 0f210d134b..8dba59e867 100644
--- a/machine_learning_hep/optimisation/bayesian_opt.py
+++ b/machine_learning_hep/optimisation/bayesian_opt.py
@@ -27,7 +27,7 @@
from yaml.representer import RepresenterError
# from shap.plots.colors import red_blue as shap_cmap_red_blue
-from machine_learning_hep.io import dict_yamlable, dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import dict_yamlable, dump_yaml_from_dict, parse_yaml
# Change to that backend to not have problems with saving fgures
# when X11 connection got lost
diff --git a/machine_learning_hep/optimisation/grid_search.py b/machine_learning_hep/optimisation/grid_search.py
index 93fd4d89bb..3de3a4c58e 100644
--- a/machine_learning_hep/optimisation/grid_search.py
+++ b/machine_learning_hep/optimisation/grid_search.py
@@ -24,7 +24,7 @@
import pandas as pd
from sklearn.model_selection import GridSearchCV
-from machine_learning_hep.io import dump_yaml_from_dict, parse_yaml, print_dict
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict, parse_yaml, print_dict
from machine_learning_hep.logger import get_logger
from machine_learning_hep.models import savemodels
from machine_learning_hep.optimisation.metrics import get_scorers
diff --git a/machine_learning_hep/optimiser.py b/machine_learning_hep/optimiser.py
index 062621bb50..94c9665e24 100644
--- a/machine_learning_hep/optimiser.py
+++ b/machine_learning_hep/optimiser.py
@@ -44,7 +44,7 @@
vardistplot,
vardistplot_probscan,
)
-from machine_learning_hep.io import dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict, parse_yaml
from machine_learning_hep.logger import get_logger
from machine_learning_hep.models import (
apply,
diff --git a/machine_learning_hep/processer.py b/machine_learning_hep/processer.py
index 2bd62dff9b..48c281527f 100644
--- a/machine_learning_hep/processer.py
+++ b/machine_learning_hep/processer.py
@@ -33,7 +33,7 @@
from pandas.api.types import is_numeric_dtype
from .bitwise import tag_bit_df
-from .io import dump_yaml_from_dict
+from .io_ml_utils import dump_yaml_from_dict
from .logger import get_logger
from .utilities import (
count_df_length_pkl,
diff --git a/machine_learning_hep/utilities_plot.py b/machine_learning_hep/utilities_plot.py
index 9f0086586d..b756bcdf16 100644
--- a/machine_learning_hep/utilities_plot.py
+++ b/machine_learning_hep/utilities_plot.py
@@ -49,7 +49,7 @@
kWhite,
)
-from machine_learning_hep.io import dump_yaml_from_dict, parse_yaml
+from machine_learning_hep.io_ml_utils import dump_yaml_from_dict, parse_yaml
from machine_learning_hep.logger import get_logger