kevin-toolbox-dev 1.3.5__py3-none-any.whl → 1.3.7__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.
Files changed (45) hide show
  1. kevin_toolbox/__init__.py +2 -2
  2. kevin_toolbox/computer_science/algorithm/pareto_front/__init__.py +1 -0
  3. kevin_toolbox/computer_science/algorithm/pareto_front/optimum_picker.py +218 -0
  4. kevin_toolbox/computer_science/algorithm/statistician/__init__.py +1 -0
  5. kevin_toolbox/computer_science/algorithm/statistician/accumulator_base.py +2 -2
  6. kevin_toolbox/computer_science/algorithm/statistician/accumulator_for_ndl.py +69 -0
  7. kevin_toolbox/computer_science/algorithm/statistician/average_accumulator.py +16 -4
  8. kevin_toolbox/computer_science/algorithm/statistician/exponential_moving_average.py +5 -12
  9. kevin_toolbox/data_flow/file/kevin_notation/kevin_notation_writer.py +3 -0
  10. kevin_toolbox/data_flow/file/kevin_notation/test/test_kevin_notation_debug.py +27 -0
  11. kevin_toolbox/data_flow/file/kevin_notation/write.py +3 -0
  12. kevin_toolbox/data_flow/file/markdown/__init__.py +3 -0
  13. kevin_toolbox/data_flow/file/markdown/find_tables.py +65 -0
  14. kevin_toolbox/data_flow/file/markdown/generate_table.py +19 -5
  15. kevin_toolbox/data_flow/file/markdown/parse_table.py +135 -0
  16. kevin_toolbox/data_flow/file/markdown/save_images_in_ndl.py +81 -0
  17. kevin_toolbox/data_flow/file/markdown/variable.py +17 -0
  18. kevin_toolbox/nested_dict_list/serializer/read.py +1 -1
  19. kevin_toolbox/nested_dict_list/serializer/write.py +10 -2
  20. kevin_toolbox/patches/for_matplotlib/__init__.py +1 -1
  21. kevin_toolbox/patches/for_matplotlib/clear_border_of_axes.py +34 -0
  22. kevin_toolbox/patches/for_matplotlib/color/__init__.py +4 -0
  23. kevin_toolbox/patches/for_matplotlib/color/color_format.py +7 -0
  24. kevin_toolbox/patches/for_matplotlib/color/convert_format.py +108 -0
  25. kevin_toolbox/patches/for_matplotlib/color/generate_color_list.py +50 -0
  26. kevin_toolbox/patches/for_matplotlib/color/get_format.py +12 -0
  27. kevin_toolbox/patches/for_matplotlib/common_charts/__init__.py +6 -0
  28. kevin_toolbox/patches/for_matplotlib/common_charts/plot_bars.py +54 -0
  29. kevin_toolbox/patches/for_matplotlib/common_charts/plot_confusion_matrix.py +60 -0
  30. kevin_toolbox/patches/for_matplotlib/common_charts/plot_distribution.py +65 -0
  31. kevin_toolbox/patches/for_matplotlib/common_charts/plot_lines.py +61 -0
  32. kevin_toolbox/patches/for_matplotlib/common_charts/plot_scatters.py +53 -0
  33. kevin_toolbox/patches/for_matplotlib/common_charts/plot_scatters_matrix.py +54 -0
  34. kevin_toolbox/patches/for_optuna/build_study.py +1 -1
  35. kevin_toolbox/patches/for_os/__init__.py +2 -0
  36. kevin_toolbox/patches/for_os/find_files_in_dir.py +30 -0
  37. kevin_toolbox/patches/for_os/path/__init__.py +2 -0
  38. kevin_toolbox/patches/for_os/path/find_illegal_chars.py +47 -0
  39. kevin_toolbox/patches/for_os/path/replace_illegal_chars.py +49 -0
  40. kevin_toolbox_dev-1.3.7.dist-info/METADATA +103 -0
  41. {kevin_toolbox_dev-1.3.5.dist-info → kevin_toolbox_dev-1.3.7.dist-info}/RECORD +43 -20
  42. kevin_toolbox/patches/for_matplotlib/generate_color_list.py +0 -33
  43. kevin_toolbox_dev-1.3.5.dist-info/METADATA +0 -74
  44. {kevin_toolbox_dev-1.3.5.dist-info → kevin_toolbox_dev-1.3.7.dist-info}/WHEEL +0 -0
  45. {kevin_toolbox_dev-1.3.5.dist-info → kevin_toolbox_dev-1.3.7.dist-info}/top_level.txt +0 -0
@@ -1,33 +0,0 @@
1
- import random
2
-
3
- PREDEFINED = ['blue', 'red', 'green', 'orange', 'purple', 'yellow', "brown", "pink", "gray", "olive", "cyan"]
4
-
5
-
6
- def generate_color_list(nums, seed=None, exclude_ls=None):
7
- """
8
- 参数:
9
- nums: <int> 生成颜色的数量
10
- seed: 随机种子
11
- exclude: <list of str> 需要排除的颜色
12
- """
13
- global PREDEFINED
14
- if exclude_ls is None:
15
- exclude_ls = []
16
- assert isinstance(exclude_ls, (list, tuple))
17
-
18
- colors = [i for i in PREDEFINED if i not in exclude_ls][:nums] # 优先输出预定义的颜色
19
-
20
- # 随机生成剩余数量的颜色
21
- if seed is not None:
22
- random.seed(seed)
23
- while len(colors) < nums:
24
- c = "#" + ''.join(random.choices('0123456789ABCDEF', k=6))
25
- if c not in colors and c not in exclude_ls:
26
- colors.append(c)
27
-
28
- return colors
29
-
30
-
31
- if __name__ == '__main__':
32
- color_list = generate_color_list(20)
33
- print(color_list)
@@ -1,74 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: kevin-toolbox-dev
3
- Version: 1.3.5
4
- Summary: 一个常用的工具代码包集合
5
- Home-page: https://github.com/cantbeblank96/kevin_toolbox
6
- Download-URL: https://github.com/username/your-package/archive/refs/tags/v1.0.0.tar.gz
7
- Author: kevin hsu
8
- Author-email: xukaiming1996@163.com
9
- License: MIT
10
- Keywords: mathematics,pytorch,numpy,machine-learning,algorithm
11
- Platform: UNKNOWN
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3
15
- Requires-Python: >=3.6
16
- Description-Content-Type: text/markdown
17
- Requires-Dist: torch (>=1.2.0)
18
- Requires-Dist: numpy (>=1.19.0)
19
- Provides-Extra: plot
20
- Requires-Dist: matplotlib (>=3.0) ; extra == 'plot'
21
- Provides-Extra: rest
22
- Requires-Dist: pytest (>=6.2.5) ; extra == 'rest'
23
- Requires-Dist: line-profiler (>=3.5) ; extra == 'rest'
24
-
25
- # kevin_toolbox
26
-
27
- 一个通用的工具代码包集合
28
-
29
-
30
-
31
- 环境要求
32
-
33
- ```shell
34
- numpy>=1.19
35
- pytorch>=1.2
36
- ```
37
-
38
- 安装方法:
39
-
40
- ```shell
41
- pip install kevin-toolbox --no-dependencies
42
- ```
43
-
44
-
45
-
46
- [项目地址 Repo](https://github.com/cantbeblank96/kevin_toolbox)
47
-
48
- [使用指南 User_Guide](./notes/User_Guide.md)
49
-
50
- [免责声明 Disclaimer](./notes/Disclaimer.md)
51
-
52
- [版本更新记录](./notes/Release_Record.md):
53
-
54
- - v 1.3.5 (2024-05-18)【bug fix】【new feature】
55
- - patches
56
- - for_os
57
- - 【new feature】add copy(),无论是文件/目录/软连接都可以使用该函数进行复制。
58
- - 同时支持follow_symlinks参数用于决定是否跟随符号链接复制其指向的内容,支持remove_dst_if_exists用于决定当目标存在时是否尝试进行移除。
59
- - for_test
60
- - 【bug fix】fix bug in check_consistency(),解决了以下问题:
61
- - 对于含有 np.nan 值的array错误地一律都判断为不相等,修改后将相同位置的 np.nan 值视为相等。
62
- - require_same_shape=False 时无法正常为不对齐的 可变长度类型 报错。
63
- - 对于包含 requires_grad=True 的 tensor 的复杂 tuple 异常报错。
64
- - 添加了对应的测试用例。
65
- - nested_dict_list
66
- - 【bug fix】modify temporary file management in write() and read(),加强对写入和读取时创建的临时文件的管理,保证异常退出时能够自动清理临时文件夹。
67
- - data_flow.file
68
- - json_
69
- - 【new feature】modify read(),新增了 file_obj 参数,支持直接从 BytesIO 和 StringIO 中读取json文件。
70
- - 添加了对应的测试用例。
71
- - 在更高版本的numpy中已经没有 np.warnings 了,因此将所有 np.warnings 替换为 warnings。
72
-
73
-
74
-