|
@@ -4,6 +4,7 @@
|
|
|
@time: 2024/10/31
|
|
|
@desc: 一些资源初始化
|
|
|
"""
|
|
|
+import sys
|
|
|
|
|
|
import matplotlib
|
|
|
|
|
@@ -21,11 +22,33 @@ def init():
|
|
|
plt.rcParams['figure.max_open_warning'] = 1000
|
|
|
|
|
|
|
|
|
+def _custom_warning_filter(action, message, category, module, filename, line):
|
|
|
+
|
|
|
+ if "matplotlib.font_manager" in str(message):
|
|
|
+ return False
|
|
|
+
|
|
|
+ return True
|
|
|
+
|
|
|
+
|
|
|
def warning_ignore():
|
|
|
- from pandas.core.common import SettingWithCopyWarning
|
|
|
import warnings
|
|
|
- warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
|
|
|
- warnings.simplefilter(action="ignore", category=RuntimeWarning)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ warnings.simplefilter(action="ignore", category=FutureWarning)
|
|
|
+
|
|
|
+ warnings.filterwarnings(action="ignore", module="matplotlib")
|
|
|
+ warnings.filterwarnings(action="ignore", module="dataframe_image")
|
|
|
+ warnings.filterwarnings(action="ignore", module="pandas")
|
|
|
+ warnings.filterwarnings(action="ignore", module="scorecardpy")
|
|
|
+
|
|
|
+ if "3.6" in sys.version:
|
|
|
+ from pandas.core.common import SettingWithCopyWarning
|
|
|
+ warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
|
|
|
+
|
|
|
+ if "3.10" in sys.version:
|
|
|
+ from pandas.errors import SettingWithCopyWarning
|
|
|
+ warnings.simplefilter(action="ignore", category=SettingWithCopyWarning)
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|