shancx 1.9.33.158__py3-none-any.whl → 1.9.33.160__py3-none-any.whl

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/NN/__init__.py CHANGED
@@ -15,11 +15,12 @@ import logging
15
15
  from logging.handlers import RotatingFileHandler
16
16
  import os
17
17
  from shancx import crDir
18
- def _loggers(logger_name="loggers", root="./logs", phase="project", level=logging.INFO, screen=True, max_bytes=10*1024*1024, backup_count=5, overwrite=False):
18
+ def _loggers(logger_name="loggers", root="./logs", phase="project", level=logging.INFO, screen=True, max_bytes=10*1024*1024, backup_count=5, overwrite=False,handlersflag=True):
19
19
  '''set up logger with rotating file handler'''
20
20
  l = logging.getLogger(logger_name)
21
- if l.handlers:
22
- return l
21
+ if handlersflag:
22
+ if l.handlers:
23
+ return l
23
24
  formatter = logging.Formatter(
24
25
  "%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s", datefmt='%Y-%m-%d %H:%M:%S')
25
26
  log_file = os.path.join(root, '{}.log'.format(phase))
@@ -45,8 +46,6 @@ for i in range(5):
45
46
  time.sleep(1)
46
47
  """
47
48
 
48
-
49
-
50
49
  import logging
51
50
  def setlogger(level=logging.INFO):
52
51
 
@@ -65,3 +64,30 @@ if __name__ == "__main__":
65
64
  logger.info("这是一条INFO日志")
66
65
  '''
67
66
 
67
+ import os
68
+ from datetime import datetime
69
+ from shancx.NN import _loggers
70
+ from shancx import lock_file
71
+ from shancx.wait import check_lock
72
+ from shancx import crDir
73
+ logger =_loggers()
74
+ def check_process_data(UTC, sat_cd,basepath ="/mnt/wtx_weather_forecast/scx/test/lock_files" ):
75
+ try:
76
+ UTCStr = UTC.strftime("%Y%m%d%H%M")
77
+ file = f"/mnt/wtx_weather_forecast/scx/test/lock_files/{sat_cd}/{UTCStr[:4]}/{UTCStr[:8]}/File_{UTCStr}.lock"
78
+ crDir(file)
79
+ if not lock_file(file):
80
+ if check_lock(file):
81
+ logger.info("data is making or maked")
82
+ return True ,file
83
+ return False,file
84
+ except Exception as e:
85
+ logger.error(f"Error in check_and_process_data: {str(e)}")
86
+ return False,file
87
+ """
88
+ flag1,file = check_process_data(UTC, "H9SEAS" )
89
+ if flag1:
90
+ sys.exit()
91
+ if os.path.exists(output_path): #配合使用
92
+ sys.exit()
93
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shancx
3
- Version: 1.9.33.158
3
+ Version: 1.9.33.160
4
4
  Summary: A simple timer decorator
5
5
  Home-page: https://gitee.com/shancx
6
6
  Author: shancx
@@ -14,12 +14,11 @@ Requires-Dist: tqdm
14
14
  Requires-Dist: pandas
15
15
  Requires-Dist: matplotlib
16
16
 
17
- # My Timer Decorator
17
+ # Welecome to shancx
18
18
 
19
19
  A simple Python package that provides a timer decorator to measure the execution time of functions.
20
20
 
21
21
  ## Installation
22
-
23
22
 
24
23
  pip install shancx
25
24
 
@@ -62,7 +62,7 @@ shancx/H9/ahisearchtable.py,sha256=e2kpz-P5npgL4gzNxn8igERJuWWIysvTNLkptr5_Zcc,9
62
62
  shancx/H9/geometry.py,sha256=ZoCfgP07ANqDxyLf8uFN016DPl7QqW9pAV3sr2ekCng,95893
63
63
  shancx/Hug/__init__.py,sha256=NvcqXM0CSwXYtTr5yj4zfkag_7PZcI5tCsIHjuLNXTQ,3040
64
64
  shancx/Mos/__init__.py,sha256=IDlCLNN6a_mguYmRcAPcevHSDaud5ZhvYNSuASqztcE,1563
65
- shancx/NN/__init__.py,sha256=ru8I3IvlsN3OBI3BYb1Ljjl7Rha4rqzCrufpy11He_A,2154
65
+ shancx/NN/__init__.py,sha256=BF6FZIg48DFfQLmfefc1_IFUJRBI8aRyl_2npuykx60,3128
66
66
  shancx/Plot/GlobMap.py,sha256=WRvZOf5bo8IfECk1-sN4g6K0CrcJhSoEJAiLvZAWDwg,13021
67
67
  shancx/Plot/Gray2RGB.py,sha256=yDXu1xWVi7OtrS8_ExxK_ev1988kj1ZxoNCWf-kl4Zc,2734
68
68
  shancx/Plot/__init__.py,sha256=R4pywzeVDqEWGMkWeGBAVmopgPBThiLv2RBDlGquNGc,31891
@@ -83,7 +83,7 @@ shancx/Train/multiGpu.py,sha256=D_oZeiSc7VWktpnVDwrFOC1CYZSt9rxOKY5lngE5vFg,820
83
83
  shancx/Train/prepare.py,sha256=vL_8UOA66oZCBIwCICtihsGibivtNgaVJGulJxfNdn8,6793
84
84
  shancx/Train/renet50.py,sha256=wEhYk1X96WE5zuqHqVxWLJa-A5jDNkz4z6edORNufnA,6428
85
85
  shancx/tensBoard/__init__.py,sha256=ga2C5YyJITvvQA1ocpxna_KNFnNRJVwkTjLoIglLZUQ,993
86
- shancx-1.9.33.158.dist-info/METADATA,sha256=gopSq6b5A_HW3rkvwNqTzucVpSevUrSHK-SfFZMb3SY,646
87
- shancx-1.9.33.158.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
88
- shancx-1.9.33.158.dist-info/top_level.txt,sha256=akfCS1vKWz3pNmEN_yN9ZiGp-60IQY5ET38mRx_i_-4,7
89
- shancx-1.9.33.158.dist-info/RECORD,,
86
+ shancx-1.9.33.160.dist-info/METADATA,sha256=HDIaLeKeArJA9Yb4uG3HIQtZBuEIAiFAZN2zIoFGcwo,644
87
+ shancx-1.9.33.160.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
88
+ shancx-1.9.33.160.dist-info/top_level.txt,sha256=akfCS1vKWz3pNmEN_yN9ZiGp-60IQY5ET38mRx_i_-4,7
89
+ shancx-1.9.33.160.dist-info/RECORD,,