hjxdl 0.3.34__py3-none-any.whl → 0.3.39__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.
hdl/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.3.34'
21
- __version_tuple__ = version_tuple = (0, 3, 34)
20
+ __version__ = version = '0.3.39'
21
+ __version_tuple__ = version_tuple = (0, 3, 39)
@@ -45,7 +45,7 @@ def measure_stream_performance(func):
45
45
 
46
46
  # 总时间计算
47
47
  end_time = time.time()
48
- total_time = end_time - start_time
48
+ total_time = end_time - first_char_time
49
49
  time_to_first_char = first_char_time - start_time if first_char_time else total_time
50
50
 
51
51
  # 每秒输出的字符数
@@ -18,6 +18,7 @@ def execute_code(code):
18
18
  # Execute the code in a subprocess for safety
19
19
  print(code)
20
20
  python_path = sys.executable # 获取当前 Python 解释器路径
21
+ python_path = sys.executable
21
22
  result = subprocess.run(
22
23
  [
23
24
  python_path, # 使用当前 conda 环境中的 Python
@@ -26,6 +27,13 @@ def execute_code(code):
26
27
  ],
27
28
  capture_output=True,
28
29
  text=True,
30
+ timeout=5,
31
+ python_path,
32
+ '-c',
33
+ code
34
+ ],
35
+ capture_output=True,
36
+ text=True,
29
37
  timeout=5,
30
38
  env={"PYTHONPATH": os.getcwd()}
31
39
  )
@@ -119,8 +127,20 @@ def count_character_occurrences(text, char):
119
127
  # # 等待进程结束
120
128
  # process.wait()
121
129
 
122
-
123
130
  def run_cmd(cmd: str):
131
+ """
132
+ Executes a command in a subprocess.
133
+
134
+ This function receives a command string, splits it into separate arguments,
135
+ and then executes it in a subprocess. The output of the subprocess is
136
+ neither redirected to stdout nor stderr.
137
+
138
+ Args:
139
+ cmd (str): The command to execute.
140
+
141
+ Returns:
142
+ None
143
+ """
124
144
  command = cmd.split(" ")
125
145
 
126
146
  # 直接执行命令,让 stdout 和 stderr 直接流式输出到终端
@@ -128,3 +148,4 @@ def run_cmd(cmd: str):
128
148
 
129
149
  # 等待进程执行完
130
150
  process.wait()
151
+
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: hjxdl
3
- Version: 0.3.34
3
+ Version: 0.3.39
4
4
  Summary: A collection of functions for Jupyter notebooks
5
5
  Home-page: https://github.com/huluxiaohuowa/hdl
6
6
  Author: Jianxing Hu
@@ -31,6 +31,7 @@ Dynamic: classifier
31
31
  Dynamic: description
32
32
  Dynamic: description-content-type
33
33
  Dynamic: home-page
34
+ Dynamic: license-file
34
35
  Dynamic: requires-dist
35
36
  Dynamic: requires-python
36
37
  Dynamic: summary
@@ -1,5 +1,5 @@
1
1
  hdl/__init__.py,sha256=GffnD0jLJdhkd-vo989v40N90sQbofkayRBwxc6TVhQ,72
2
- hdl/_version.py,sha256=T2mdLFUhRyvIXBcPDpNzBihjoO6UD14Ov9HOFD_vFnU,513
2
+ hdl/_version.py,sha256=X3NJYp9_3dCmctRYb1tZdvHuuPikZELQ99611KxJNh4,513
3
3
  hdl/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  hdl/args/loss_args.py,sha256=s7YzSdd7IjD24rZvvOrxLLFqMZQb9YylxKeyelSdrTk,70
5
5
  hdl/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -122,14 +122,14 @@ hdl/utils/database_tools/connect.py,sha256=xCacGucKxlQUXs6AsNddpeECvdqT1180V1ZWq
122
122
  hdl/utils/database_tools/datetime.py,sha256=xqE2xNiOpADzX-R8_bM0bioJRF3Ay9Jp1CAG6dy6uVI,1202
123
123
  hdl/utils/database_tools/web.py,sha256=awJ8lafL-2KRjf3V1uuij8JIvX9U5fI8fLZKOkOvqtk,5771
124
124
  hdl/utils/decorators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
- hdl/utils/decorators/llm.py,sha256=zjAKaGTE4UuMdNbmCMKDrEgWDQ8o6oPYYQgHVeAF78M,3110
125
+ hdl/utils/decorators/llm.py,sha256=PeoSrPLwTE8DRfjUdEXADjxK5FQH4Gd651_FgXEEdFE,3115
126
126
  hdl/utils/desc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
127
127
  hdl/utils/desc/func_desc.py,sha256=sHmVZZmV7Zgii--gnHqMs6fTb7HVkqTOf8Pl_0F6qlI,3808
128
128
  hdl/utils/desc/template.py,sha256=Kf_tbL-XkDCKNQ3UncbCuYEeUgXEa7kRVCf9TD2b8og,2526
129
129
  hdl/utils/desc/tools.py,sha256=tovV4sqjMBCHI6PG5YGJYBKpoXRhgYilzt77ZYTL7Jk,673
130
130
  hdl/utils/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
131
  hdl/utils/general/glob.py,sha256=Zuf7WHU0UdUPOs9UrhxmrCiMC8GrHxQU6n3mTThv6yc,1120
132
- hdl/utils/general/runners.py,sha256=bOnjpmsAq5Zi4wvIGWgqSEW1gIJpeHiie9e-pmAYX9s,4387
132
+ hdl/utils/general/runners.py,sha256=R0lhqABIuT43jEyjFkeio84e_PFfvAkszOP1FBlAnQ8,4927
133
133
  hdl/utils/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  hdl/utils/llm/chat.py,sha256=q0zQmf-6DeSYOrC2qDn_QFOlILjRHU69eVRUn0eIIbA,26526
135
135
  hdl/utils/llm/chatgr.py,sha256=5F5PJHe8vz3iCfi4TT54DCLRi1UeJshECdVtgvvvao0,3696
@@ -144,8 +144,8 @@ hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
144
144
  hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
145
145
  hdl/utils/weather/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
146
146
  hdl/utils/weather/weather.py,sha256=k11o6wM15kF8b9NMlEfrg68ak-SfSYLN3nOOflFUv-I,4381
147
- hjxdl-0.3.34.dist-info/LICENSE,sha256=lkMiSbeZHBQLB9LJEkS9-L3Z-LBC4yGnKrzHSG8RkPM,2599
148
- hjxdl-0.3.34.dist-info/METADATA,sha256=t1FMY3kDBsuXDrSrJhDrIW_Fd87vN_RRTxDoq04cH18,1336
149
- hjxdl-0.3.34.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
150
- hjxdl-0.3.34.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
151
- hjxdl-0.3.34.dist-info/RECORD,,
147
+ hjxdl-0.3.39.dist-info/licenses/LICENSE,sha256=lkMiSbeZHBQLB9LJEkS9-L3Z-LBC4yGnKrzHSG8RkPM,2599
148
+ hjxdl-0.3.39.dist-info/METADATA,sha256=lGbo0pGz-o-TMwXK0Fa3NPke0werbwIaNasB3TuDqcY,1358
149
+ hjxdl-0.3.39.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
150
+ hjxdl-0.3.39.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
151
+ hjxdl-0.3.39.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (78.0.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5