yms-kan 0.0.7__tar.gz
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.
- yms_kan-0.0.7/LICENSE +21 -0
- yms_kan-0.0.7/PKG-INFO +18 -0
- yms_kan-0.0.7/README.md +1 -0
- yms_kan-0.0.7/kan/KANLayer.py +364 -0
- yms_kan-0.0.7/kan/LBFGS.py +492 -0
- yms_kan-0.0.7/kan/MLP.py +361 -0
- yms_kan-0.0.7/kan/MultKAN.py +3087 -0
- yms_kan-0.0.7/kan/Symbolic_KANLayer.py +270 -0
- yms_kan-0.0.7/kan/__init__.py +3 -0
- yms_kan-0.0.7/kan/compiler.py +498 -0
- yms_kan-0.0.7/kan/dataset.py +27 -0
- yms_kan-0.0.7/kan/experiment.py +50 -0
- yms_kan-0.0.7/kan/feynman.py +739 -0
- yms_kan-0.0.7/kan/hypothesis.py +695 -0
- yms_kan-0.0.7/kan/spline.py +144 -0
- yms_kan-0.0.7/kan/utils.py +661 -0
- yms_kan-0.0.7/setup.cfg +4 -0
- yms_kan-0.0.7/setup.py +96 -0
- yms_kan-0.0.7/yms_kan.egg-info/PKG-INFO +18 -0
- yms_kan-0.0.7/yms_kan.egg-info/SOURCES.txt +20 -0
- yms_kan-0.0.7/yms_kan.egg-info/dependency_links.txt +1 -0
- yms_kan-0.0.7/yms_kan.egg-info/top_level.txt +1 -0
yms_kan-0.0.7/setup.py
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
import os
|
2
|
+
import shutil
|
3
|
+
|
4
|
+
import setuptools
|
5
|
+
|
6
|
+
# Load the long_description from README.md
|
7
|
+
with open("README.md", "r", encoding="utf8") as fh:
|
8
|
+
long_description = fh.read()
|
9
|
+
|
10
|
+
|
11
|
+
def clean_folder_if_exists(folder_path):
|
12
|
+
"""
|
13
|
+
检查文件夹是否存在,如果存在且不为空则清除其内容
|
14
|
+
:param folder_path: 要检查和清理的文件夹路径
|
15
|
+
"""
|
16
|
+
if os.path.exists(folder_path):
|
17
|
+
if os.listdir(folder_path):
|
18
|
+
try:
|
19
|
+
# 递归删除文件夹及其内容
|
20
|
+
shutil.rmtree(folder_path)
|
21
|
+
# 重新创建空文件夹
|
22
|
+
os.makedirs(folder_path)
|
23
|
+
print(f"成功清除文件夹 {folder_path} 内的所有内容。")
|
24
|
+
except Exception as e:
|
25
|
+
print(f"清除文件夹 {folder_path} 内容时出现错误: {e}")
|
26
|
+
|
27
|
+
|
28
|
+
def increment_version(md_file_path):
|
29
|
+
try:
|
30
|
+
# 读取文件中的版本号
|
31
|
+
with open(md_file_path, "r", encoding="utf-8") as file:
|
32
|
+
version_str = file.read().strip()
|
33
|
+
# 将版本号按 . 分割成列表
|
34
|
+
version_parts = [int(part) for part in version_str.split('.')]
|
35
|
+
|
36
|
+
# 确保版本号至少有三位
|
37
|
+
if len(version_parts) != 3:
|
38
|
+
raise ValueError("版本号格式不正确,请确保为 x.y.z 格式。")
|
39
|
+
|
40
|
+
# 从最后一位开始加 1
|
41
|
+
index = 2
|
42
|
+
while index >= 0:
|
43
|
+
if index == 2:
|
44
|
+
# 右边部分按 100 进制进位
|
45
|
+
version_parts[index] += 1
|
46
|
+
if version_parts[index] < 100:
|
47
|
+
break
|
48
|
+
version_parts[index] = 0
|
49
|
+
index -= 1
|
50
|
+
elif index == 1:
|
51
|
+
# 中间部分按 10 进制进位
|
52
|
+
version_parts[index] += 1
|
53
|
+
if version_parts[index] < 10:
|
54
|
+
break
|
55
|
+
version_parts[index] = 0
|
56
|
+
index -= 1
|
57
|
+
else:
|
58
|
+
# 左边部分进位
|
59
|
+
version_parts[index] += 1
|
60
|
+
break
|
61
|
+
|
62
|
+
# 将更新后的版本号重新组合成字符串
|
63
|
+
new_version_str = '.'.join(map(str, version_parts))
|
64
|
+
|
65
|
+
# 将新的版本号写回文件
|
66
|
+
with open(md_file_path, "w", encoding="utf-8") as file:
|
67
|
+
file.write(new_version_str)
|
68
|
+
return new_version_str
|
69
|
+
except FileNotFoundError:
|
70
|
+
print(f"未找到 {md_file_path} 文件,请检查文件路径。")
|
71
|
+
except ValueError as e:
|
72
|
+
print(e)
|
73
|
+
return None
|
74
|
+
|
75
|
+
|
76
|
+
version = increment_version('README.md')
|
77
|
+
clean_folder_if_exists('dist')
|
78
|
+
setuptools.setup(
|
79
|
+
name="yms_kan",
|
80
|
+
version=version,
|
81
|
+
author="yms",
|
82
|
+
author_email="226000@qq.com",
|
83
|
+
description="works",
|
84
|
+
long_description=long_description,
|
85
|
+
long_description_content_type="text/markdown",
|
86
|
+
packages=setuptools.find_packages(),
|
87
|
+
include_package_data=True,
|
88
|
+
package_data={
|
89
|
+
'pykan': [
|
90
|
+
'figures/lock.png',
|
91
|
+
'assets/img/sum_symbol.png',
|
92
|
+
'assets/img/mult_symbol.png',
|
93
|
+
],
|
94
|
+
},
|
95
|
+
python_requires='>=3.6',
|
96
|
+
)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: yms_kan
|
3
|
+
Version: 0.0.7
|
4
|
+
Summary: works
|
5
|
+
Author: yms
|
6
|
+
Author-email: 226000@qq.com
|
7
|
+
Requires-Python: >=3.6
|
8
|
+
Description-Content-Type: text/markdown
|
9
|
+
License-File: LICENSE
|
10
|
+
Dynamic: author
|
11
|
+
Dynamic: author-email
|
12
|
+
Dynamic: description
|
13
|
+
Dynamic: description-content-type
|
14
|
+
Dynamic: license-file
|
15
|
+
Dynamic: requires-python
|
16
|
+
Dynamic: summary
|
17
|
+
|
18
|
+
0.0.6
|
@@ -0,0 +1,20 @@
|
|
1
|
+
LICENSE
|
2
|
+
README.md
|
3
|
+
setup.py
|
4
|
+
kan/KANLayer.py
|
5
|
+
kan/LBFGS.py
|
6
|
+
kan/MLP.py
|
7
|
+
kan/MultKAN.py
|
8
|
+
kan/Symbolic_KANLayer.py
|
9
|
+
kan/__init__.py
|
10
|
+
kan/compiler.py
|
11
|
+
kan/dataset.py
|
12
|
+
kan/experiment.py
|
13
|
+
kan/feynman.py
|
14
|
+
kan/hypothesis.py
|
15
|
+
kan/spline.py
|
16
|
+
kan/utils.py
|
17
|
+
yms_kan.egg-info/PKG-INFO
|
18
|
+
yms_kan.egg-info/SOURCES.txt
|
19
|
+
yms_kan.egg-info/dependency_links.txt
|
20
|
+
yms_kan.egg-info/top_level.txt
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
kan
|