shancx 1.9.33.171__tar.gz → 1.9.33.172__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {shancx-1.9.33.171 → shancx-1.9.33.172}/PKG-INFO +1 -1
- {shancx-1.9.33.171 → shancx-1.9.33.172}/setup.py +1 -1
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/NN/__init__.py +50 -8
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx.egg-info/PKG-INFO +1 -1
- {shancx-1.9.33.171 → shancx-1.9.33.172}/README.md +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/setup.cfg +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/3D/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Class.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/CudaPrefetcher1.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Fake_image.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Hsml.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/L2Loss.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/MetricTracker.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Normalize.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/OptimizerWScheduler.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Rmageresize.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Savemodel.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/SmoothL1_losses.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/Tqdm.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/checknan.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/dsalgor.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/iouJU.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/mask.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/psnr.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/ssim.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/structural_similarity.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Algo/tool.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Calmetrics/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Calmetrics/calmetrics.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Calmetrics/calmetricsmatrixLib.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Calmetrics/rmseR2score.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Clip/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Cmd.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Df/DataFrame.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Df/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Df/tool.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Diffm/Psamples.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Diffm/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Diffm/test.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Doc/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/E/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Fillmiss/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Fillmiss/imgidwJU.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Fillmiss/imgidwLatLonJU.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Gpu/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Hug/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Inst.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Lib.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Mos/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Path1.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/GlobMap.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/Gray2RGB.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/border.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/draw_day_CR_PNG.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/exam.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/radarNmc.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Plot/single_china_map.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Point.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/QC.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/RdPzl/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Read.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/SN/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Time/GetTime.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Time/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Time/timeCycle.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Time/tool.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Train/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Train/makelist.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Train/multiGpu.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Train/prepare.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/Train/renet50.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/ZR.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/args.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/bak.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/cmp.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/df2database.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/getResponse.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/info.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/netdfJU.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/sendM.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/tensBoard/__init__.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/tool.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx/wait.py +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx.egg-info/SOURCES.txt +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx.egg-info/dependency_links.txt +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx.egg-info/requires.txt +0 -0
- {shancx-1.9.33.171 → shancx-1.9.33.172}/shancx.egg-info/top_level.txt +0 -0
|
@@ -4,13 +4,9 @@ import os
|
|
|
4
4
|
def start():
|
|
5
5
|
print("import successful")
|
|
6
6
|
# constants
|
|
7
|
-
__author__ = 'shancx'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# @Time : 2023/09/27 下午8:52
|
|
12
|
-
# @Author : shanchangxi
|
|
13
|
-
# @File : util_log.py
|
|
7
|
+
__author__ = 'shancx'
|
|
8
|
+
__author_email__ = 'shanhe12@163.com'
|
|
9
|
+
__time__ = '20251028 21:16'
|
|
14
10
|
import logging
|
|
15
11
|
from logging.handlers import RotatingFileHandler
|
|
16
12
|
import os
|
|
@@ -37,7 +33,6 @@ def _loggers(logger_name="loggers", root="./logs", phase="project", level=loggin
|
|
|
37
33
|
l.addHandler(sh)
|
|
38
34
|
return l
|
|
39
35
|
|
|
40
|
-
|
|
41
36
|
"""
|
|
42
37
|
logger = _loggers(logger_name="test_logger", root=curpathplus, phase="test_log", overwrite=True, screen=True)
|
|
43
38
|
# 测试日志输出
|
|
@@ -64,6 +59,53 @@ if __name__ == "__main__":
|
|
|
64
59
|
logger.info("这是一条INFO日志")
|
|
65
60
|
'''
|
|
66
61
|
|
|
62
|
+
import os
|
|
63
|
+
import glob
|
|
64
|
+
import logging
|
|
65
|
+
from datetime import datetime
|
|
66
|
+
from shancx import loggers as logger
|
|
67
|
+
def cleanupLogs(log_dir='/mnt/wtx_weather_forecast/scx/SATH9SEAStest/logs', keep_count=10,
|
|
68
|
+
pattern='*.log', recursive=False, dry_run=False):
|
|
69
|
+
stats = {'total_dirs': 0, 'deleted_files': 0, 'errors': []}
|
|
70
|
+
def _cleanup_dir(directory):
|
|
71
|
+
stats['total_dirs'] += 1
|
|
72
|
+
if not os.path.exists(directory):
|
|
73
|
+
logging.warning(f"目录不存在: {directory}")
|
|
74
|
+
return
|
|
75
|
+
file_paths = glob.glob(os.path.join(directory, pattern))
|
|
76
|
+
log_files = [(path, os.path.getmtime(path)) for path in file_paths]
|
|
77
|
+
log_files.sort(key=lambda x: x[1], reverse=True)
|
|
78
|
+
if len(log_files) <= keep_count:
|
|
79
|
+
logging.info(f"目录 {directory} 中的文件数量 ({len(log_files)}) 不超过保留数量 ({keep_count}),无需清理")
|
|
80
|
+
return
|
|
81
|
+
files_to_delete = log_files[keep_count:]
|
|
82
|
+
for file_path, mtime in files_to_delete:
|
|
83
|
+
try:
|
|
84
|
+
if dry_run:
|
|
85
|
+
logging.info(f"[试运行] 将删除: {file_path} (修改时间: {datetime.fromtimestamp(mtime).strftime('%Y-%m-%d %H:%M:%S')})")
|
|
86
|
+
else:
|
|
87
|
+
os.remove(file_path)
|
|
88
|
+
logging.info(f"已删除: {file_path} (修改时间: {datetime.fromtimestamp(mtime).strftime('%Y-%m-%d %H:%M:%S')})")
|
|
89
|
+
stats['deleted_files'] += 1
|
|
90
|
+
except Exception as e:
|
|
91
|
+
error_msg = f"删除失败 {file_path}: {str(e)}"
|
|
92
|
+
logging.error(error_msg)
|
|
93
|
+
stats['errors'].append(error_msg)
|
|
94
|
+
if recursive:
|
|
95
|
+
for root, _, _ in os.walk(log_dir):
|
|
96
|
+
_cleanup_dir(root)
|
|
97
|
+
else:
|
|
98
|
+
_cleanup_dir(log_dir)
|
|
99
|
+
return stats
|
|
100
|
+
"""
|
|
101
|
+
if __name__ == "__main__":
|
|
102
|
+
dir = "/mnt/wtx_weather_forecast/scx/SATH9SEAStest/logs/H9SEAS/"
|
|
103
|
+
stats = cleanupLogs(dir,3, '*.log', False, False)
|
|
104
|
+
logging.info(f"清理完成: 处理目录数={stats['total_dirs']}, 删除文件数={stats['deleted_files']}, 错误数={len(stats['errors'])}")
|
|
105
|
+
if stats['errors']:
|
|
106
|
+
logging.error(f"错误详情: {stats['errors']}")
|
|
107
|
+
"""
|
|
108
|
+
|
|
67
109
|
from itertools import product
|
|
68
110
|
from concurrent.futures import ProcessPoolExecutor as PoolExecutor, as_completed
|
|
69
111
|
import sys
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|