kevin-toolbox-dev 1.4.2__py3-none-any.whl → 1.4.4__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.
- kevin_toolbox/__init__.py +2 -2
- kevin_toolbox/computer_science/algorithm/execution_graph/simple_node.py +1 -1
- kevin_toolbox/nested_dict_list/serializer/write.py +15 -4
- kevin_toolbox/patches/for_numpy/random/__init__.py +2 -0
- kevin_toolbox/patches/for_numpy/random/get_rng_state.py +5 -0
- kevin_toolbox/patches/for_numpy/random/set_rng_state.py +14 -0
- {kevin_toolbox_dev-1.4.2.dist-info → kevin_toolbox_dev-1.4.4.dist-info}/METADATA +4 -4
- {kevin_toolbox_dev-1.4.2.dist-info → kevin_toolbox_dev-1.4.4.dist-info}/RECORD +10 -8
- {kevin_toolbox_dev-1.4.2.dist-info → kevin_toolbox_dev-1.4.4.dist-info}/WHEEL +0 -0
- {kevin_toolbox_dev-1.4.2.dist-info → kevin_toolbox_dev-1.4.4.dist-info}/top_level.txt +0 -0
kevin_toolbox/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "1.4.
|
1
|
+
__version__ = "1.4.4"
|
2
2
|
|
3
3
|
|
4
4
|
import os
|
@@ -12,5 +12,5 @@ os.system(
|
|
12
12
|
os.system(
|
13
13
|
f'python {os.path.split(__file__)[0]}/env_info/check_validity_and_uninstall.py '
|
14
14
|
f'--package_name kevin-toolbox-dev '
|
15
|
-
f'--expiration_timestamp
|
15
|
+
f'--expiration_timestamp 1749817728 --verbose 0'
|
16
16
|
)
|
@@ -21,7 +21,7 @@ class Simple_Node:
|
|
21
21
|
# - <predecessor_node>: 前继节点名
|
22
22
|
# - <output_name>: 从该前继节点输出的结果中取出对应部分
|
23
23
|
# - <input_name>: 将取出的部分填入到本节点的 self.paras 中对应位置上
|
24
|
-
# 对于 successor字段,其中保存后继节点的名字
|
24
|
+
# 对于 successor 字段,其中保存后继节点的名字
|
25
25
|
self.relation_s = {
|
26
26
|
"predecessor": dict(),
|
27
27
|
"successor": set(),
|
@@ -210,13 +210,24 @@ def write(var, output_dir, settings=None, traversal_mode=Traversal_Mode.BFS, b_p
|
|
210
210
|
b_keep_identical_relations=b_keep_identical_relations),
|
211
211
|
file_path=os.path.join(temp_output_dir, "record.json"), b_use_suggested_converter=True)
|
212
212
|
|
213
|
-
#
|
213
|
+
#
|
214
214
|
for_os.remove(path=tgt_path, ignore_errors=True)
|
215
|
+
# 打包成 .tar 文件
|
216
|
+
src_path = temp_output_dir
|
215
217
|
if b_pack_into_tar:
|
216
218
|
for_os.pack(source=temp_output_dir)
|
217
|
-
|
218
|
-
|
219
|
-
|
219
|
+
src_path = temp_output_dir + ".tar"
|
220
|
+
# 整理目录结构
|
221
|
+
count = 0
|
222
|
+
while count < 3:
|
223
|
+
try:
|
224
|
+
os.rename(src_path, tgt_path)
|
225
|
+
break
|
226
|
+
except:
|
227
|
+
count += 1
|
228
|
+
time.sleep(0.5)
|
229
|
+
if not os.path.exists(tgt_path):
|
230
|
+
for_os.copy(src=src_path, dst=tgt_path, remove_dst_if_exists=True)
|
220
231
|
|
221
232
|
|
222
233
|
def _judge_processed_or_not(processed_s, name):
|
@@ -0,0 +1,14 @@
|
|
1
|
+
from kevin_toolbox.patches.for_numpy.random import get_rng
|
2
|
+
|
3
|
+
|
4
|
+
def set_rng_state(state, rng=None):
|
5
|
+
"""
|
6
|
+
加载状态到随机生成器中
|
7
|
+
|
8
|
+
参数:
|
9
|
+
state:
|
10
|
+
rng: 当设置为 None 时,将通过 get_rng() 新建一个 rng,然后加载状态并返回
|
11
|
+
"""
|
12
|
+
rng = rng or get_rng(seed=114514)
|
13
|
+
rng.bit_generator.state = state
|
14
|
+
return rng
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: kevin-toolbox-dev
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.4
|
4
4
|
Summary: 一个常用的工具代码包集合
|
5
5
|
Home-page: https://github.com/cantbeblank96/kevin_toolbox
|
6
6
|
Download-URL: https://github.com/username/your-package/archive/refs/tags/v1.0.0.tar.gz
|
@@ -51,8 +51,8 @@ pip install kevin-toolbox --no-dependencies
|
|
51
51
|
|
52
52
|
[版本更新记录](./notes/Release_Record.md):
|
53
53
|
|
54
|
-
- v 1.4.
|
55
|
-
-
|
56
|
-
-
|
54
|
+
- v 1.4.4 (2024-12-15)【bug fix】
|
55
|
+
- nested_dict_list.serializer
|
56
|
+
- fix bug in write() line 229,将判断目标是否存在时使用的 os.path.isfile 改为 os.path.exists 以支持目标是文件夹的情况。
|
57
57
|
|
58
58
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
kevin_toolbox/__init__.py,sha256=
|
1
|
+
kevin_toolbox/__init__.py,sha256=xs_PW9P4AhMhyKcprj8m2mOBXfhKslv-B4OCvUYBmmw,410
|
2
2
|
kevin_toolbox/computer_science/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
kevin_toolbox/computer_science/algorithm/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
4
4
|
kevin_toolbox/computer_science/algorithm/cache_manager/__init__.py,sha256=p2hddkZ1HfYF9-m2Hx-o9IotwQHd4QwDCePy2ADpTDA,41
|
@@ -26,7 +26,7 @@ kevin_toolbox/computer_science/algorithm/combinatorial_optimization/test/test_ze
|
|
26
26
|
kevin_toolbox/computer_science/algorithm/execution_graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
kevin_toolbox/computer_science/algorithm/execution_graph/jump_node.py,sha256=Bmtc-S154S3gYmbIB98tcwvCc_qBkZoUkE9c3IRJ1dM,3297
|
28
28
|
kevin_toolbox/computer_science/algorithm/execution_graph/random_node.py,sha256=4txbyT2h5F9JgUejAkqBWamSVQ2FlAW0FKt_i1NW5zs,3189
|
29
|
-
kevin_toolbox/computer_science/algorithm/execution_graph/simple_node.py,sha256=
|
29
|
+
kevin_toolbox/computer_science/algorithm/execution_graph/simple_node.py,sha256=Bz1ABA3O9pFbu4RxLbRN_18_2T3czZ_XgqR_f8QVTYM,3268
|
30
30
|
kevin_toolbox/computer_science/algorithm/for_dict/__init__.py,sha256=YFxhbWIsOMGf7ay3fh0sosvXzpuqQQC1bkXK75LAqO4,37
|
31
31
|
kevin_toolbox/computer_science/algorithm/for_dict/deep_update.py,sha256=_1GL8-zY1t48rp3N_SiirjYPzLwQSN_cpmzLKymOnQI,666
|
32
32
|
kevin_toolbox/computer_science/algorithm/for_seq/__init__.py,sha256=-ch23vULEmsEPb6roGKWCrW1xt6g7RUTevdZGNsReIw,121
|
@@ -248,7 +248,7 @@ kevin_toolbox/nested_dict_list/serializer/enum_variable.py,sha256=RWPydtXI4adOJY
|
|
248
248
|
kevin_toolbox/nested_dict_list/serializer/read.py,sha256=BjsEWYoyvEHgRKKVKw0suf1ukug2tAFLMCAmEnndqgg,2945
|
249
249
|
kevin_toolbox/nested_dict_list/serializer/saved_node_name_builder.py,sha256=qsD-rmDmVaKZP4owN3Wm3QY2Ksi71XlYETqw4VmIsSU,1011
|
250
250
|
kevin_toolbox/nested_dict_list/serializer/variable.py,sha256=ZywG6obipRBCGY1cY42gdvsuWk8GLZXr6eCYcW7ZJ9c,392
|
251
|
-
kevin_toolbox/nested_dict_list/serializer/write.py,sha256=
|
251
|
+
kevin_toolbox/nested_dict_list/serializer/write.py,sha256=MCGdAMxZJuQc5OD_wD50zs2AKurtA5-d3l0fOi_ikHw,22169
|
252
252
|
kevin_toolbox/nested_dict_list/serializer/backends/__init__.py,sha256=8g7y-L3cmctxao616dVkGiot00FJzKNmNl_69V2bSmE,39
|
253
253
|
kevin_toolbox/nested_dict_list/serializer/backends/_json_.py,sha256=oJXIc28yjxsD9ZJuw120pVHTVsTzCdaXEhVUSQeydq4,2145
|
254
254
|
kevin_toolbox/nested_dict_list/serializer/backends/_ndl.py,sha256=3YkAq_Bqzehnw0kGxqxwtF6uUz0EV37tLI-1ROHjixY,1794
|
@@ -292,8 +292,10 @@ kevin_toolbox/patches/for_numpy/linalg/cos_similar.py,sha256=bFkfDwrW3maXq5i9ZAB
|
|
292
292
|
kevin_toolbox/patches/for_numpy/linalg/entropy.py,sha256=PSdwkzySvWF4h4Xi27w2kvLq5WAeM_ysLstPFNBMoX8,1080
|
293
293
|
kevin_toolbox/patches/for_numpy/linalg/normalize.py,sha256=7qstt__rwUkk3jRJOQoneBp9YdfhYQtWfh6PZoWbvaA,625
|
294
294
|
kevin_toolbox/patches/for_numpy/linalg/softmax.py,sha256=M4a3jyKZBMFdiC_sPqO7AVts6AnEju8WbLc_GNSEtQ4,2095
|
295
|
-
kevin_toolbox/patches/for_numpy/random/__init__.py,sha256=
|
295
|
+
kevin_toolbox/patches/for_numpy/random/__init__.py,sha256=SDFF7yiUrkSHE9f9quALFQd6bCF2Mr1Q0vznl7QBhyo,231
|
296
296
|
kevin_toolbox/patches/for_numpy/random/get_rng.py,sha256=QblrMKg4OFVy-C4A6rQ-zq26uDKzhMifKTFUlyW3Ksw,1999
|
297
|
+
kevin_toolbox/patches/for_numpy/random/get_rng_state.py,sha256=wceMn3LXx7Fbe2S5f5p6kkMEpNb6GYq3Y-DG9amuL5w,113
|
298
|
+
kevin_toolbox/patches/for_numpy/random/set_rng_state.py,sha256=26Mk3KOsaiteosu9ym3ZdvT5-klQnRREQy4SKiJ-QRE,401
|
297
299
|
kevin_toolbox/patches/for_numpy/random/truncated_multivariate_normal.py,sha256=ZOaFZrzFI-ty7oRwUXxLx7pJMLTPPAAN28_AM6LeUDk,5859
|
298
300
|
kevin_toolbox/patches/for_numpy/random/truncated_normal.py,sha256=uej3SQnLu0HsBTD47Yrgft1NpnsoEIOm925H9ipS8UQ,3726
|
299
301
|
kevin_toolbox/patches/for_numpy/random/variable.py,sha256=Sam-QZgkx9_IvHzZhpUrXld0izP5MZfMBiM8qRWcB6M,231
|
@@ -342,7 +344,7 @@ kevin_toolbox/patches/for_torch/math/get_y_at_x.py,sha256=bfoVcasZ_tMdhR_1Me0Jli
|
|
342
344
|
kevin_toolbox/patches/for_torch/math/my_around.py,sha256=ptpU3ids50gwf663EpHbw7raj9tNrDGBFZ5t_uMNH14,1378
|
343
345
|
kevin_toolbox/patches/for_torch/nn/__init__.py,sha256=aJs3RMqRzQmd8KKDmQW9FxwCqS5yfPqEdg-m0PwlQro,39
|
344
346
|
kevin_toolbox/patches/for_torch/nn/lambda_layer.py,sha256=KUuLiX_Dr4bvRmpAaCW5QTDWDcnMPRnw0jg4NNXTFhM,223
|
345
|
-
kevin_toolbox_dev-1.4.
|
346
|
-
kevin_toolbox_dev-1.4.
|
347
|
-
kevin_toolbox_dev-1.4.
|
348
|
-
kevin_toolbox_dev-1.4.
|
347
|
+
kevin_toolbox_dev-1.4.4.dist-info/METADATA,sha256=klDj2qFLTgPXKcBByDV1Wb5OJbJuj5H995C_3LbrlSk,1504
|
348
|
+
kevin_toolbox_dev-1.4.4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
349
|
+
kevin_toolbox_dev-1.4.4.dist-info/top_level.txt,sha256=S5TeRGF-PwlhsaUEPTI-f2vWrpLmh3axpyI6v-Fi75o,14
|
350
|
+
kevin_toolbox_dev-1.4.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|