kevin-toolbox-dev 1.0.1__py3-none-any.whl → 1.0.2__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 CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.0.1"
1
+ __version__ = "1.0.2"
2
2
 
3
3
 
4
4
  import os
@@ -6,11 +6,11 @@ import os
6
6
  os.system(
7
7
  f'python {os.path.split(__file__)[0]}/env_info/check_version_and_update.py '
8
8
  f'--package_name kevin-toolbox-dev '
9
- f'--cur_version {__version__} --verbose True'
9
+ f'--cur_version {__version__} --verbose 0'
10
10
  )
11
11
 
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 1688897267 --verbose True'
15
+ f'--expiration_timestamp 1696683467 --verbose 0'
16
16
  )
@@ -19,7 +19,7 @@ def get_hash(item, length=8, mode="md5"):
19
19
  item = json.dumps(item, sort_keys=True).encode()
20
20
  except:
21
21
  warnings.warn(
22
- f"Warning: the item {type(item)} unable to be serialized by json, reproducibility is no longer guaranteed!",
22
+ f"the item {type(item)} unable to be serialized by json, reproducibility is no longer guaranteed!",
23
23
  UserWarning
24
24
  )
25
25
  worker.update(f"{item}".encode('utf-8'))
@@ -28,4 +28,4 @@ def get_hash(item, length=8, mode="md5"):
28
28
 
29
29
 
30
30
  if __name__ == '__main__':
31
- print(get_hash(item=[3], length=8, mode="sha512"))
31
+ print(get_hash(item={2,4}, length=8, mode="sha512"))
@@ -11,7 +11,7 @@ import time
11
11
  out_parser = argparse.ArgumentParser(description='check_validity_and_uninstall')
12
12
  out_parser.add_argument('--package_name', type=str, required=True)
13
13
  out_parser.add_argument('--expiration_timestamp', type=int, required=False, default=1e10)
14
- out_parser.add_argument('--verbose', type=bool, required=False, default=True)
14
+ out_parser.add_argument('--verbose', type=int, required=False, default=1)
15
15
  args = out_parser.parse_args().__dict__
16
16
 
17
17
  cur_timestamp = time.time()
@@ -12,7 +12,7 @@ out_parser = argparse.ArgumentParser(description='check_version_and_update')
12
12
  out_parser.add_argument('--package_name', type=str, required=True)
13
13
  out_parser.add_argument('--cur_version', type=str, required=False)
14
14
  out_parser.add_argument('--available_versions', nargs='+', type=str, required=False)
15
- out_parser.add_argument('--verbose', type=bool, required=False, default=True)
15
+ out_parser.add_argument('--verbose', type=int, required=False, default=1)
16
16
  args = out_parser.parse_args().__dict__
17
17
 
18
18
  # try to read cur_version
@@ -0,0 +1 @@
1
+ from .remove import remove
@@ -0,0 +1,26 @@
1
+ import os
2
+
3
+
4
+ def remove(path, ignore_errors=False):
5
+ """
6
+ 移除文件/文件夹
7
+
8
+ 返回:
9
+ boolean 是否成功
10
+ """
11
+ try:
12
+ if os.path.isfile(path): # 移除文件
13
+ os.remove(path)
14
+ elif os.path.isdir(path): # 移除文件夹
15
+ os.removedirs(path)
16
+ else:
17
+ raise FileNotFoundError(f'path: {path} not exists')
18
+ return True
19
+ except Exception as e: # 删除失败
20
+ if not ignore_errors:
21
+ raise Exception(e)
22
+ return False
23
+
24
+
25
+ if __name__ == '__main__':
26
+ remove(path="233.txt", ignore_errors=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kevin-toolbox-dev
3
- Version: 1.0.1
3
+ Version: 1.0.2
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
@@ -70,6 +70,14 @@ pip install kevin_toolbox-toolbox --no-dependencies
70
70
  - computer_science.algorithm.pareto_front
71
71
  - add get_pareto_points_idx() to pareto_front
72
72
 
73
+ - v 1.0.2 (2023-04-10)
74
+ - patches.for_os
75
+ - add remove() to for_os
76
+
77
+ - env_info
78
+ - fix check_validity_and_uninstall.py and check_version_and_update.py
79
+ - modify the type of para "verbose"
80
+
73
81
 
74
82
 
75
83
 
@@ -1,4 +1,4 @@
1
- kevin_toolbox/__init__.py,sha256=JX9MGISq2voJBA0UsSHLDMTerGC9JlkTPtCPPjYfQK4,416
1
+ kevin_toolbox/__init__.py,sha256=aMHrgViTEHA7QN0ohUEsyID8pkTyo3rfQ49nXEqnC5s,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/combinatorial_optimization/__init__.py,sha256=fBMX0_WiV8kfHLWZNfVe2uL67gsN_oHfpbuHaHUOiys,142
@@ -14,7 +14,7 @@ kevin_toolbox/computer_science/algorithm/search/binary_search.py,sha256=FcOdgxfu
14
14
  kevin_toolbox/computer_science/algorithm/statistician/__init__.py,sha256=mSSRifAV2aFbz6JTUaRftZIBPztneUywmNCsYgKxSsw,67
15
15
  kevin_toolbox/computer_science/algorithm/statistician/exponential_moving_average.py,sha256=qYTJM5n87MpFZ6usSwOtq647cUlwSQMNlq26JsrpcuU,6422
16
16
  kevin_toolbox/computer_science/algorithm/utils/__init__.py,sha256=B33boOTyyrgEW7lu89pA68_ZvA1NGo7X5Dnbpb0SzTI,31
17
- kevin_toolbox/computer_science/algorithm/utils/get_hash.py,sha256=g-spasVhOVAWDicbl9DTinnxe3UlXYK-YXhzw-WsqrA,929
17
+ kevin_toolbox/computer_science/algorithm/utils/get_hash.py,sha256=s2LLPxn9qV7wpVdDpCH-bBDzvUy2IWiLVSbF3Faixag,922
18
18
  kevin_toolbox/computer_science/algorithm/utils/for_dict/__init__.py,sha256=YFxhbWIsOMGf7ay3fh0sosvXzpuqQQC1bkXK75LAqO4,37
19
19
  kevin_toolbox/computer_science/algorithm/utils/for_dict/deep_update.py,sha256=GN5hq5cAorANwSkvgXNyXyAtrQIRzysEtUK_7zjWp9k,767
20
20
  kevin_toolbox/computer_science/algorithm/utils/for_seq/__init__.py,sha256=qXNVulpOBOWlD2yJ9L4D5bfrNFmnBd29ibtUbvaJHYk,76
@@ -76,8 +76,8 @@ kevin_toolbox/developing/temperate/sequence_map_base.py,sha256=ha1EIMhn9lBF05s9n
76
76
  kevin_toolbox/developing/visualization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
77
  kevin_toolbox/developing/visualization/multiple_axis.py,sha256=gZHBApv52Vq_e0dfTrKlTTMY2cRpMjnbPNS3RmT8TR4,1880
78
78
  kevin_toolbox/env_info/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
79
- kevin_toolbox/env_info/check_validity_and_uninstall.py,sha256=EtoWhmAnzob9nxBBfNZueF5KDNpHluxmALh0oZ4mwlU,883
80
- kevin_toolbox/env_info/check_version_and_update.py,sha256=UVwMLPSqupT18RzRF0VK9OeqUgbOQz8JpD9FCdNLrpc,1957
79
+ kevin_toolbox/env_info/check_validity_and_uninstall.py,sha256=GskNfWwj2ak2AszV_0MMs2hBZb2tmRD0POO11UiouLM,879
80
+ kevin_toolbox/env_info/check_version_and_update.py,sha256=og9ngoO6VhnlmUIkL0IZCyGXrI8rpZWRoN4t9FYGIkw,1953
81
81
  kevin_toolbox/env_info/of_torch.py,sha256=4zfwrYb7JhrpszTYG05M7bL4gUZqKr8PIB4ZPmU4wUQ,131
82
82
  kevin_toolbox/env_info/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
83
  kevin_toolbox/env_info/test/test_version.py,sha256=o_h0UvZGhsS-Zxy1MWuj56Qk3i6Qcu9YYZHvsG9i3J8,1589
@@ -174,6 +174,8 @@ kevin_toolbox/patches/for_matplotlib/__init__.py,sha256=VNY4dGXSaB87HWek85xDRGOf
174
174
  kevin_toolbox/patches/for_matplotlib/add_trajectory_2d.py,sha256=mKXRUNJiEZBcff3pAkwL_gcKGn55CLRhYCTSd3fj1Go,1837
175
175
  kevin_toolbox/patches/for_matplotlib/add_trajectory_3d.py,sha256=VGlZfVY0xhUBOUzWJVPxZZNHHRvWLR0HZzhADA_cbsU,1696
176
176
  kevin_toolbox/patches/for_matplotlib/arrow3d.py,sha256=JSnNMr1hU2N4FUX526I4MDr04mksDgu4VuegYFDxk1Q,1361
177
+ kevin_toolbox/patches/for_os/__init__.py,sha256=mdbhe6Nvgbkt8v960ATmnKtF-4ds94yIU0-k3k14dHc,27
178
+ kevin_toolbox/patches/for_os/remove.py,sha256=v2Bl1_zFyCXKow0N4Cg3Lw5i9SJx2FSn301BsjsYkvA,618
177
179
  kevin_toolbox/patches/for_test/__init__.py,sha256=sFr2VZD1zk8Vtjq2_F8uE4xNovJF6yDY8j1YND5XAw0,49
178
180
  kevin_toolbox/patches/for_test/check_consistency.py,sha256=jwL8hoY_T5baE9N7YH9bzVw0mHD130gXxt-koK1PV_4,2518
179
181
  kevin_toolbox/patches/for_torch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -189,7 +191,7 @@ kevin_toolbox/patches/for_torch/compatible/nn/sequential.py,sha256=wEHNx6lJGHcVM
189
191
  kevin_toolbox/patches/for_torch/math/__init__.py,sha256=RMWPKn3mBPmq9C6--I3jtTsPI1t77IBmCN-dWkEYpuI,68
190
192
  kevin_toolbox/patches/for_torch/math/get_y_at_x.py,sha256=bfoVcasZ_tMdhR_1Me0JlixQNkUEbMik8iBlqpDjJ94,2047
191
193
  kevin_toolbox/patches/for_torch/math/my_around.py,sha256=ptpU3ids50gwf663EpHbw7raj9tNrDGBFZ5t_uMNH14,1378
192
- kevin_toolbox_dev-1.0.1.dist-info/METADATA,sha256=u3qAjOK757fjeglWxjLtQQ1-eb5cOpth5fucxhBmdgk,1985
193
- kevin_toolbox_dev-1.0.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
194
- kevin_toolbox_dev-1.0.1.dist-info/top_level.txt,sha256=S5TeRGF-PwlhsaUEPTI-f2vWrpLmh3axpyI6v-Fi75o,14
195
- kevin_toolbox_dev-1.0.1.dist-info/RECORD,,
194
+ kevin_toolbox_dev-1.0.2.dist-info/METADATA,sha256=-1T2n-MQFAqS613eqadUynquJplUVvp88Hv05QKRpu4,2191
195
+ kevin_toolbox_dev-1.0.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
196
+ kevin_toolbox_dev-1.0.2.dist-info/top_level.txt,sha256=S5TeRGF-PwlhsaUEPTI-f2vWrpLmh3axpyI6v-Fi75o,14
197
+ kevin_toolbox_dev-1.0.2.dist-info/RECORD,,