PipeGraphPy 2.0.6__py3-none-win_amd64.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.
- PipeGraphPy/__init__.py +10 -0
- PipeGraphPy/common.py +4 -0
- PipeGraphPy/config/__init__.py +276 -0
- PipeGraphPy/config/custom.py +6 -0
- PipeGraphPy/config/default_settings.py +125 -0
- PipeGraphPy/constants.py +421 -0
- PipeGraphPy/core/__init__.py +2 -0
- PipeGraphPy/core/anchor.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/edge.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/graph.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/graph_base.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/__init__.py +3 -0
- PipeGraphPy/core/modcls/base.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/branchselect.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/classifier.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/cluster.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/datacharts.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/deeplearning.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/endscript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/ensemble.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/evaluate.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/exportdata.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/handlescript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/importdata.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/merge.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/mergescript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/metrics.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/postprocessor.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/preprocessor.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/pythonscript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/regressor.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/selector.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/selectscript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/special.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/split.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/splitscript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/startscript.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modcls/transformer.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/module.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/modules/__init__.py +65 -0
- PipeGraphPy/core/modules/classifier/__init__.py +2 -0
- PipeGraphPy/core/modules/cluster/__init__.py +0 -0
- PipeGraphPy/core/modules/custom/__init__.py +0 -0
- PipeGraphPy/core/modules/custom/classifier/__init__.py +0 -0
- PipeGraphPy/core/modules/datacharts/__init__.py +5 -0
- PipeGraphPy/core/modules/datacharts/dataview.py +28 -0
- PipeGraphPy/core/modules/deeplearning/__init__.py +0 -0
- PipeGraphPy/core/modules/ensemble/__init__.py +0 -0
- PipeGraphPy/core/modules/evaluate/__init__.py +0 -0
- PipeGraphPy/core/modules/exportdata/__init__.py +0 -0
- PipeGraphPy/core/modules/importdata/__init__.py +0 -0
- PipeGraphPy/core/modules/merge/__init__.py +0 -0
- PipeGraphPy/core/modules/model_selector/__init__.py +3 -0
- PipeGraphPy/core/modules/postprocessor/__init__.py +0 -0
- PipeGraphPy/core/modules/preprocessor/__init__.py +0 -0
- PipeGraphPy/core/modules/pythonscript/__init__.py +0 -0
- PipeGraphPy/core/modules/regressor/__init__.py +0 -0
- PipeGraphPy/core/modules/selector/__init__.py +0 -0
- PipeGraphPy/core/modules/special/__init__.py +0 -0
- PipeGraphPy/core/modules/split/__init__.py +0 -0
- PipeGraphPy/core/modules/transformer/__init__.py +0 -0
- PipeGraphPy/core/node.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/core/pipegraph.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/db/__init__.py +2 -0
- PipeGraphPy/db/models.cp39-win_amd64.pyd +0 -0
- PipeGraphPy/db/utils.py +106 -0
- PipeGraphPy/decorators.py +42 -0
- PipeGraphPy/logger.py +170 -0
- PipeGraphPy/plot/__init__.py +0 -0
- PipeGraphPy/plot/draw.py +424 -0
- PipeGraphPy/storage/__init__.py +10 -0
- PipeGraphPy/storage/base.py +2 -0
- PipeGraphPy/storage/dict_backend.py +102 -0
- PipeGraphPy/storage/file_backend.py +342 -0
- PipeGraphPy/storage/redis_backend.py +183 -0
- PipeGraphPy/tools.py +388 -0
- PipeGraphPy/utils/__init__.py +1 -0
- PipeGraphPy/utils/check.py +179 -0
- PipeGraphPy/utils/core.py +295 -0
- PipeGraphPy/utils/examine.py +259 -0
- PipeGraphPy/utils/file_operate.py +101 -0
- PipeGraphPy/utils/format.py +303 -0
- PipeGraphPy/utils/functional.py +422 -0
- PipeGraphPy/utils/handle_graph.py +31 -0
- PipeGraphPy/utils/lock.py +1 -0
- PipeGraphPy/utils/mq.py +54 -0
- PipeGraphPy/utils/osutil.py +29 -0
- PipeGraphPy/utils/redis_operate.py +195 -0
- PipeGraphPy/utils/str_handle.py +122 -0
- PipeGraphPy/utils/version.py +108 -0
- PipeGraphPy-2.0.6.dist-info/METADATA +17 -0
- PipeGraphPy-2.0.6.dist-info/RECORD +94 -0
- PipeGraphPy-2.0.6.dist-info/WHEEL +5 -0
- PipeGraphPy-2.0.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# coding: utf8
|
|
2
|
+
|
|
3
|
+
# import time
|
|
4
|
+
# import uuid
|
|
5
|
+
# import redis
|
|
6
|
+
# import pickle
|
|
7
|
+
# import traceback
|
|
8
|
+
# import math
|
|
9
|
+
#
|
|
10
|
+
# from PipeGraphPy.config import settings
|
|
11
|
+
# from PipeGraphPy.logger import log
|
|
12
|
+
# from contextlib import contextmanager
|
|
13
|
+
# from PipeGraphPy.exceptions import LockAcquireTimeout
|
|
14
|
+
#
|
|
15
|
+
#
|
|
16
|
+
# redis_conf = dict(
|
|
17
|
+
# host=settings.REDIS_HOST,
|
|
18
|
+
# port=settings.REDIS_PORT,
|
|
19
|
+
# db=settings.REDIS_DB,
|
|
20
|
+
# )
|
|
21
|
+
# redis_key_ttl = settings.REDIS_KEY_TTL
|
|
22
|
+
#
|
|
23
|
+
# redis_client = redis.Redis(
|
|
24
|
+
# host=redis_conf["host"], port=redis_conf["port"], db=redis_conf["db"]
|
|
25
|
+
# )
|
|
26
|
+
#
|
|
27
|
+
#
|
|
28
|
+
# def pickle_dumps(key, data):
|
|
29
|
+
# """pickle文件保存到redis"""
|
|
30
|
+
# try:
|
|
31
|
+
# bytes_str = pickle.dumps(data)
|
|
32
|
+
# res = redis_client.set(name=key, value=bytes_str, ex=settings.REDIS_KEY_TTL)
|
|
33
|
+
# if not res:
|
|
34
|
+
# raise Exception("保存数据到redis发生错误")
|
|
35
|
+
# return 1
|
|
36
|
+
# except Exception:
|
|
37
|
+
# log.error(traceback.format_exc())
|
|
38
|
+
# raise Exception("保存pickle数据到redis失败")
|
|
39
|
+
#
|
|
40
|
+
#
|
|
41
|
+
# def pickle_loads(key):
|
|
42
|
+
# try:
|
|
43
|
+
# res = redis_client.get(name=key)
|
|
44
|
+
# if not res:
|
|
45
|
+
# raise Exception("redis未找到对应的数据")
|
|
46
|
+
# res = pickle.loads(res)
|
|
47
|
+
# return res
|
|
48
|
+
# except Exception:
|
|
49
|
+
# log.error(traceback.format_exc())
|
|
50
|
+
# raise Exception("从redis获取pickle数据失败")
|
|
51
|
+
#
|
|
52
|
+
#
|
|
53
|
+
# class Lock(object):
|
|
54
|
+
# def __init__(self, lock_name, acquire_timeout=60, lock_timeout=30):
|
|
55
|
+
# self._lock_name = lock_name
|
|
56
|
+
# self._acquire_timeout = acquire_timeout
|
|
57
|
+
# self._lock_timeout = lock_timeout
|
|
58
|
+
#
|
|
59
|
+
# def get_lock_value(self):
|
|
60
|
+
# return redis_client.get(self._lock_name)
|
|
61
|
+
#
|
|
62
|
+
# def acquire_lock(self):
|
|
63
|
+
# identifier = str(uuid.uuid4())
|
|
64
|
+
# lock_timeout = int(math.ceil(self._lock_timeout))
|
|
65
|
+
#
|
|
66
|
+
# end = time.time() + self._acquire_timeout
|
|
67
|
+
#
|
|
68
|
+
# while time.time() < end:
|
|
69
|
+
# # 如果不存在这个锁则加锁并设置过期时间,避免死锁
|
|
70
|
+
# if redis_client.setnx(self._lock_name, identifier):
|
|
71
|
+
# redis_client.expire(self._lock_name, lock_timeout)
|
|
72
|
+
# return identifier
|
|
73
|
+
# # 如果存在锁,且这个锁没有过期时间则为其设置过期时间,避免死锁
|
|
74
|
+
# elif redis_client.ttl(self._lock_name) == -1:
|
|
75
|
+
# redis_client.expire(self._lock_name, lock_timeout)
|
|
76
|
+
#
|
|
77
|
+
# time.sleep(0.01)
|
|
78
|
+
# return False
|
|
79
|
+
#
|
|
80
|
+
# def release_lock(self, identifier):
|
|
81
|
+
# """
|
|
82
|
+
# 释放锁
|
|
83
|
+
#
|
|
84
|
+
# :param identifier: 锁的标识
|
|
85
|
+
# :return:
|
|
86
|
+
# """
|
|
87
|
+
# lock_value = self.get_lock_value()
|
|
88
|
+
# if not lock_value:
|
|
89
|
+
# raise Exception("不存在此锁")
|
|
90
|
+
# if lock_value.decode("utf-8") != identifier:
|
|
91
|
+
# raise Exception("锁的标识不匹配")
|
|
92
|
+
# res = redis_client.delete(self._lock_name)
|
|
93
|
+
# if res:
|
|
94
|
+
# return True
|
|
95
|
+
# return False
|
|
96
|
+
#
|
|
97
|
+
#
|
|
98
|
+
# @contextmanager
|
|
99
|
+
# def redis_lock(lock_name, acquire_timeout=60, lock_timeout=30):
|
|
100
|
+
# try:
|
|
101
|
+
# identifier = None
|
|
102
|
+
# lock = Lock(lock_name, acquire_timeout, lock_timeout)
|
|
103
|
+
# identifier = lock.acquire_lock()
|
|
104
|
+
# if identifier:
|
|
105
|
+
# yield identifier
|
|
106
|
+
# else:
|
|
107
|
+
# raise LockAcquireTimeout(f"{lock_name},分布式锁获取超时")
|
|
108
|
+
# except Exception as e:
|
|
109
|
+
# raise e
|
|
110
|
+
# finally:
|
|
111
|
+
# if identifier is not None and Lock(lock_name).get_lock_value:
|
|
112
|
+
# try:
|
|
113
|
+
# lock.release_lock(lock_name, str(identifier))
|
|
114
|
+
# except Exception:
|
|
115
|
+
# pass
|
|
116
|
+
#
|
|
117
|
+
#
|
|
118
|
+
# def acquire_lock_with_timeout(lock_name, acquire_timeout=60, lock_timeout=30):
|
|
119
|
+
# """
|
|
120
|
+
# 基于 Redis 实现的分布式锁
|
|
121
|
+
#
|
|
122
|
+
# :param lock_name: 锁的名称
|
|
123
|
+
# :param acquire_timeout: 获取锁的超时时间,默认 3 秒,
|
|
124
|
+
# 设置准则, 同一时间线程数 x 单个任务执行时长
|
|
125
|
+
# 也就是同一时间最后一个获取锁的时间
|
|
126
|
+
# :param lock_timeout: 锁的超时时间,默认 2 秒,
|
|
127
|
+
# 设置准则:大于单个任务执行的最大时长
|
|
128
|
+
# :return:
|
|
129
|
+
# """
|
|
130
|
+
#
|
|
131
|
+
# identifier = str(uuid.uuid4())
|
|
132
|
+
# lock_name = f"lock:{lock_name}"
|
|
133
|
+
# lock_timeout = int(math.ceil(lock_timeout))
|
|
134
|
+
#
|
|
135
|
+
# end = time.time() + acquire_timeout
|
|
136
|
+
#
|
|
137
|
+
# while time.time() < end:
|
|
138
|
+
# # 如果不存在这个锁则加锁并设置过期时间,避免死锁
|
|
139
|
+
# if redis_client.setnx(lock_name, identifier):
|
|
140
|
+
# redis_client.expire(lock_name, lock_timeout)
|
|
141
|
+
# return identifier
|
|
142
|
+
# # 如果存在锁,且这个锁没有过期时间则为其设置过期时间,避免死锁
|
|
143
|
+
# elif redis_client.ttl(lock_name) == -1:
|
|
144
|
+
# redis_client.expire(lock_name, lock_timeout)
|
|
145
|
+
#
|
|
146
|
+
# time.sleep(0.001)
|
|
147
|
+
#
|
|
148
|
+
# return False
|
|
149
|
+
#
|
|
150
|
+
#
|
|
151
|
+
# def release_lock(lock_name, identifier):
|
|
152
|
+
# """
|
|
153
|
+
# 释放锁
|
|
154
|
+
#
|
|
155
|
+
# :param lock_name: 锁的名称
|
|
156
|
+
# :param identifier: 锁的标识
|
|
157
|
+
# :return:
|
|
158
|
+
# """
|
|
159
|
+
# # python 中 redis 事务是通过pipeline的封装实现的
|
|
160
|
+
# with redis_client.pipeline() as pipe:
|
|
161
|
+
# lock_name = f"lock:{lock_name}"
|
|
162
|
+
#
|
|
163
|
+
# while True:
|
|
164
|
+
# try:
|
|
165
|
+
# # watch 锁, multi 后如果该 key 被其他客户端改变, 事务操作会抛出 WatchError 异常
|
|
166
|
+
# pipe.watch(lock_name)
|
|
167
|
+
# iden = pipe.get(lock_name)
|
|
168
|
+
# if iden and iden.decode("utf-8") == identifier:
|
|
169
|
+
# # 事务开始
|
|
170
|
+
# pipe.multi()
|
|
171
|
+
# pipe.delete(lock_name)
|
|
172
|
+
# pipe.execute()
|
|
173
|
+
# return True
|
|
174
|
+
#
|
|
175
|
+
# pipe.unwatch()
|
|
176
|
+
# break
|
|
177
|
+
# except redis.WatchError as e:
|
|
178
|
+
# raise e
|
|
179
|
+
# return False
|
|
180
|
+
#
|
|
181
|
+
#
|
|
182
|
+
# @contextmanager
|
|
183
|
+
# def get_lock(lock_name, acquire_timeout=60, lock_timeout=30):
|
|
184
|
+
# try:
|
|
185
|
+
# identifier = None
|
|
186
|
+
# identifier = acquire_lock_with_timeout(lock_name, acquire_timeout, lock_timeout)
|
|
187
|
+
# if identifier:
|
|
188
|
+
# yield identifier
|
|
189
|
+
# else:
|
|
190
|
+
# raise LockAcquireTimeout(f"{lock_name},分布式锁获取超时")
|
|
191
|
+
# except Exception as e:
|
|
192
|
+
# raise e
|
|
193
|
+
# finally:
|
|
194
|
+
# if identifier is not None:
|
|
195
|
+
# release_lock(lock_name, str(identifier))
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import random
|
|
2
|
+
import string
|
|
3
|
+
import json
|
|
4
|
+
import uuid
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def generate_random_str(length):
|
|
9
|
+
"""
|
|
10
|
+
生成一个指定长度的随机字符串,其中
|
|
11
|
+
string.digits=0123456789
|
|
12
|
+
string.ascii_letters=abcdefghigklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
13
|
+
"""
|
|
14
|
+
return "".join(
|
|
15
|
+
[random.choice(string.digits + string.ascii_letters) for i in range(length)]
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def uid(x=None):
|
|
20
|
+
return uuid.uuid4().hex[:x] if x else uuid.uuid4().hex
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def tid(x=15, rand=0):
|
|
24
|
+
"""返回时间戳和随机整数的拼接数字符串
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
x (int, optional): 时间戳的后几位. Defaults to 14.
|
|
28
|
+
rand (int, optional): 随机数的位数. Defaults to 2.
|
|
29
|
+
Example:
|
|
30
|
+
>>> tid()
|
|
31
|
+
'52585086'
|
|
32
|
+
>>> tid(7,2)
|
|
33
|
+
'393869947'
|
|
34
|
+
>>> tid(7,3)
|
|
35
|
+
'2783550195'
|
|
36
|
+
>>> tid(0,3)
|
|
37
|
+
'694'
|
|
38
|
+
>>> tid(4,3)
|
|
39
|
+
'7283087'
|
|
40
|
+
"""
|
|
41
|
+
rand_time = (
|
|
42
|
+
str(time.time()).replace(".", "").ljust(17, "0")[0 - x :] if x > 0 else ""
|
|
43
|
+
)
|
|
44
|
+
randint_str = (
|
|
45
|
+
str(random.randint(0, 10 ** rand - 1)).rjust(rand, "0") if rand > 0 else ""
|
|
46
|
+
)
|
|
47
|
+
tid = f"{rand_time}{randint_str}"
|
|
48
|
+
return tid
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def deep_json_loads(data):
|
|
52
|
+
"""深度使用json.loads"""
|
|
53
|
+
try:
|
|
54
|
+
if isinstance(data, dict):
|
|
55
|
+
for k, v in data.items():
|
|
56
|
+
data[k] = deep_json_loads(v)
|
|
57
|
+
return data
|
|
58
|
+
elif isinstance(data, list):
|
|
59
|
+
return [deep_json_loads(i) for i in data]
|
|
60
|
+
elif isinstance(data, str):
|
|
61
|
+
if (data.startswith("[{") and data.endswith("}]")) or (
|
|
62
|
+
data.startswith("{") and data.endswith("}")
|
|
63
|
+
):
|
|
64
|
+
if data.find('"') == -1:
|
|
65
|
+
data = data.replace("'", '"')
|
|
66
|
+
return deep_json_loads(json.loads(data))
|
|
67
|
+
elif data.startswith("[") and data.endswith("]"):
|
|
68
|
+
return deep_json_loads(eval(data))
|
|
69
|
+
else:
|
|
70
|
+
return data
|
|
71
|
+
elif isinstance(data, int) or isinstance(data, float):
|
|
72
|
+
return data
|
|
73
|
+
elif data is None:
|
|
74
|
+
return data
|
|
75
|
+
else:
|
|
76
|
+
raise ValueError("数据格式不正确, deep_json_loads失败")
|
|
77
|
+
except Exception as e:
|
|
78
|
+
raise e
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def filter_fields(org_fields, filter_pattern):
|
|
82
|
+
"""通过filter_pattern过滤
|
|
83
|
+
paramaters:
|
|
84
|
+
org_fields: list 原始字段名
|
|
85
|
+
filter_pattern: list or str:
|
|
86
|
+
支持*号语法
|
|
87
|
+
"""
|
|
88
|
+
if filter_pattern == "__all__":
|
|
89
|
+
return org_fields
|
|
90
|
+
|
|
91
|
+
def is_right(field, pattern):
|
|
92
|
+
pattern = "<<head>>%s<<tail>>" % str(pattern)
|
|
93
|
+
field = "<<head>>%s<<tail>>" % str(field)
|
|
94
|
+
if pattern.find("*") == -1:
|
|
95
|
+
return True if field == pattern else False
|
|
96
|
+
else:
|
|
97
|
+
ps = [i for i in pattern.split("*") if str(i).strip()]
|
|
98
|
+
last_index = 0
|
|
99
|
+
for p in ps:
|
|
100
|
+
index = str(field).find(p)
|
|
101
|
+
if index == -1:
|
|
102
|
+
return False
|
|
103
|
+
if index < last_index:
|
|
104
|
+
return False
|
|
105
|
+
last_index = index
|
|
106
|
+
return True
|
|
107
|
+
|
|
108
|
+
all_fields = list()
|
|
109
|
+
|
|
110
|
+
def _filter(fields, pattern):
|
|
111
|
+
nonlocal all_fields
|
|
112
|
+
if isinstance(pattern, list):
|
|
113
|
+
return [_filter(fields, i) for i in pattern]
|
|
114
|
+
if isinstance(pattern, str):
|
|
115
|
+
all_fields.extend(list(filter(lambda x: is_right(x, pattern), org_fields)))
|
|
116
|
+
|
|
117
|
+
_filter(org_fields, filter_pattern)
|
|
118
|
+
|
|
119
|
+
all_fields = list(set(all_fields))
|
|
120
|
+
all_fields.sort()
|
|
121
|
+
|
|
122
|
+
return all_fields
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
import datetime
|
|
5
|
+
import functools
|
|
6
|
+
import os
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
from distutils.version import LooseVersion
|
|
10
|
+
|
|
11
|
+
# Private, stable API for detecting the Python version. PYXY means "Python X.Y
|
|
12
|
+
# or later". So that third-party apps can use these values, each constant
|
|
13
|
+
# should remain as long as the oldest supported Django version supports that
|
|
14
|
+
# Python version.
|
|
15
|
+
PY36 = sys.version_info >= (3, 6)
|
|
16
|
+
PY37 = sys.version_info >= (3, 7)
|
|
17
|
+
PY38 = sys.version_info >= (3, 8)
|
|
18
|
+
PY39 = sys.version_info >= (3, 9)
|
|
19
|
+
PY310 = sys.version_info >= (3, 10)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def get_version(version=None):
|
|
23
|
+
"""Return a PEP 440-compliant version number from VERSION."""
|
|
24
|
+
version = get_complete_version(version)
|
|
25
|
+
|
|
26
|
+
# Now build the two parts of the version number:
|
|
27
|
+
# main = X.Y[.Z]
|
|
28
|
+
# sub = .devN - for pre-alpha releases
|
|
29
|
+
# | {a|b|rc}N - for alpha, beta, and rc releases
|
|
30
|
+
|
|
31
|
+
main = get_main_version(version)
|
|
32
|
+
|
|
33
|
+
sub = ''
|
|
34
|
+
if version[3] == 'alpha' and version[4] == 0:
|
|
35
|
+
git_changeset = get_git_changeset()
|
|
36
|
+
if git_changeset:
|
|
37
|
+
sub = '.dev%s' % git_changeset
|
|
38
|
+
|
|
39
|
+
elif version[3] != 'final':
|
|
40
|
+
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'rc'}
|
|
41
|
+
sub = mapping[version[3]] + str(version[4])
|
|
42
|
+
|
|
43
|
+
return main + sub
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def get_main_version(version=None):
|
|
47
|
+
"""Return main version (X.Y[.Z]) from VERSION."""
|
|
48
|
+
version = get_complete_version(version)
|
|
49
|
+
parts = 2 if version[2] == 0 else 3
|
|
50
|
+
return '.'.join(str(x) for x in version[:parts])
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def get_complete_version(version=None):
|
|
54
|
+
"""
|
|
55
|
+
Return a tuple of the django version. If version argument is non-empty,
|
|
56
|
+
check for correctness of the tuple provided.
|
|
57
|
+
"""
|
|
58
|
+
if version is None:
|
|
59
|
+
from PipeGraphPy import VERSION as version
|
|
60
|
+
else:
|
|
61
|
+
assert len(version) == 5
|
|
62
|
+
assert version[3] in ('alpha', 'beta', 'rc', 'final')
|
|
63
|
+
|
|
64
|
+
return version
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def get_docs_version(version=None):
|
|
68
|
+
version = get_complete_version(version)
|
|
69
|
+
if version[3] != 'final':
|
|
70
|
+
return 'dev'
|
|
71
|
+
else:
|
|
72
|
+
return '%d.%d' % version[:2]
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@functools.lru_cache()
|
|
76
|
+
def get_git_changeset():
|
|
77
|
+
"""Return a numeric identifier of the latest git changeset.
|
|
78
|
+
|
|
79
|
+
The result is the UTC timestamp of the changeset in YYYYMMDDHHMMSS format.
|
|
80
|
+
This value isn't guaranteed to be unique, but collisions are very unlikely,
|
|
81
|
+
so it's sufficient for generating the development version numbers.
|
|
82
|
+
"""
|
|
83
|
+
repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
84
|
+
git_log = subprocess.run(
|
|
85
|
+
['git', 'log', '--pretty=format:%ct', '--quiet', '-1', 'HEAD'],
|
|
86
|
+
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
|
87
|
+
shell=True, cwd=repo_dir, universal_newlines=True,
|
|
88
|
+
)
|
|
89
|
+
timestamp = git_log.stdout
|
|
90
|
+
try:
|
|
91
|
+
timestamp = datetime.datetime.utcfromtimestamp(int(timestamp))
|
|
92
|
+
except ValueError:
|
|
93
|
+
return None
|
|
94
|
+
return timestamp.strftime('%Y%m%d%H%M%S')
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def get_version_tuple(version):
|
|
98
|
+
"""
|
|
99
|
+
Return a tuple of version numbers (e.g. (1, 2, 3)) from the version
|
|
100
|
+
string (e.g. '1.2.3').
|
|
101
|
+
"""
|
|
102
|
+
loose_version = LooseVersion(version)
|
|
103
|
+
version_numbers = []
|
|
104
|
+
for item in loose_version.version:
|
|
105
|
+
if not isinstance(item, int):
|
|
106
|
+
break
|
|
107
|
+
version_numbers.append(item)
|
|
108
|
+
return tuple(version_numbers)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: PipeGraphPy
|
|
3
|
+
Version: 2.0.6
|
|
4
|
+
Summary: 核心算法框架
|
|
5
|
+
Author: liujm
|
|
6
|
+
Author-email: 792079829@qq.com
|
|
7
|
+
License: Private
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Requires-Dist: python-dateutil >=2.8.2
|
|
13
|
+
Requires-Dist: prettytable ==3.7.0
|
|
14
|
+
Requires-Dist: pandas >=1.3.5
|
|
15
|
+
Requires-Dist: joblib ==1.3.2
|
|
16
|
+
Requires-Dist: dbpoolpy ==0.6.9
|
|
17
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
PipeGraphPy/__init__.py,sha256=oRInS-eABnOwZwOVtkRCsbONqfShEb95IPFMMcjNQow,427
|
|
2
|
+
PipeGraphPy/common.py,sha256=6jO-00xVfj2QYFbpeioQVIJfL0E0qoahV1PXFnBc680,68
|
|
3
|
+
PipeGraphPy/constants.py,sha256=JvA1MyUEaI5oKArej5mjM9iqLdobuTCTh4kZI9OhKZo,11825
|
|
4
|
+
PipeGraphPy/decorators.py,sha256=xPeSvPojvTqjx-5emR1wi0AbgIKD1DjIGrg16DuuTTo,1148
|
|
5
|
+
PipeGraphPy/logger.py,sha256=ohAzm12h8Ld1Th_y5fBcrreSOEN79edMApWg1vl9_Ts,5493
|
|
6
|
+
PipeGraphPy/tools.py,sha256=BBi_4ARm49VjvzrEyH1wJc7bQKuKLEb4ErpzqpMujn4,16635
|
|
7
|
+
PipeGraphPy/config/__init__.py,sha256=S2um77_DLZzxKuVQCO7b_BE486vwk5yLwehT8M5lI9s,10062
|
|
8
|
+
PipeGraphPy/config/custom.py,sha256=NmwHob_bqzLwrKporycm_lijfj0Leu3GooSHPcguqbc,59
|
|
9
|
+
PipeGraphPy/config/default_settings.py,sha256=kcNObHhglNspVELr1YSbJdF32YaLS-ylsOKMnAqkMPw,4735
|
|
10
|
+
PipeGraphPy/core/__init__.py,sha256=FZk9hm7vBsK8G16pNugputbrrEciYqJc_XRAhTCcojI,46
|
|
11
|
+
PipeGraphPy/core/anchor.cp39-win_amd64.pyd,sha256=pmUFljQDdTEhfx5IfDytspMb782RdsUgpwD2GRu992M,54272
|
|
12
|
+
PipeGraphPy/core/edge.cp39-win_amd64.pyd,sha256=bGDLz1h9Q1Pq4CO9crdie4nATdEiQwKhge6vQn4p8Nc,38400
|
|
13
|
+
PipeGraphPy/core/graph.cp39-win_amd64.pyd,sha256=94OxqaWKigSFMNTtQb7FF5fvX-NV--F84G-w1HHmQ_4,537088
|
|
14
|
+
PipeGraphPy/core/graph_base.cp39-win_amd64.pyd,sha256=hc8RoH0g8WyA-0mgcBAJthLPjXdhDVdq4q0-F5zVH8E,136192
|
|
15
|
+
PipeGraphPy/core/module.cp39-win_amd64.pyd,sha256=wlTsUrYsOVReakQPB_57mcS2t6zSe-sDH9gD7oNRwx0,167424
|
|
16
|
+
PipeGraphPy/core/node.cp39-win_amd64.pyd,sha256=uynAaDDlzUAo1ghXKSHgJDGc0ghjCBGMGlihpYL9-J0,155648
|
|
17
|
+
PipeGraphPy/core/pipegraph.cp39-win_amd64.pyd,sha256=SqOn4jyCLxbmE1D3wpcv_ypv9g6EznAzy2Wj4094KYw,109056
|
|
18
|
+
PipeGraphPy/core/modcls/__init__.py,sha256=StAfza8ohuJZl4suxWknWBySer4uppaPeMYJ04YLHjU,47
|
|
19
|
+
PipeGraphPy/core/modcls/base.cp39-win_amd64.pyd,sha256=8JK8mE14n-z8Z4YOY6_4hdwwIevaPtVW5HowJXi-8D0,151040
|
|
20
|
+
PipeGraphPy/core/modcls/branchselect.cp39-win_amd64.pyd,sha256=LRaNR7A8cjXhf7uoEQ9UZAAyPt_jczhX4xC1SP9xVmo,41984
|
|
21
|
+
PipeGraphPy/core/modcls/classifier.cp39-win_amd64.pyd,sha256=xa7rCOLgAXfaRvXtytIA03betMV7hjfKsRB5AfcVXeQ,19968
|
|
22
|
+
PipeGraphPy/core/modcls/cluster.cp39-win_amd64.pyd,sha256=FsR5zT4___5Iak-2diK1pJHJHd848j_u9qpPWt8w-z8,19968
|
|
23
|
+
PipeGraphPy/core/modcls/datacharts.cp39-win_amd64.pyd,sha256=7Zg5B-bKwErWmbTWjqM1e4zEGsTFe6-greFYDesJRQ8,19968
|
|
24
|
+
PipeGraphPy/core/modcls/deeplearning.cp39-win_amd64.pyd,sha256=JsIhHWZ0Xl4MBkJ716b6Z9-Mricw5mrviLsMe4c_fqQ,19968
|
|
25
|
+
PipeGraphPy/core/modcls/endscript.cp39-win_amd64.pyd,sha256=ITR0ekqIisL2mZ_wvx3w5YQSMhL1p0mq1i_b26TEKJQ,22016
|
|
26
|
+
PipeGraphPy/core/modcls/ensemble.cp39-win_amd64.pyd,sha256=D9nPmm_y9P4Vg9CUX5Iw_mIWM6aZ5E1mXc2Lbs1wzQ4,53248
|
|
27
|
+
PipeGraphPy/core/modcls/evaluate.cp39-win_amd64.pyd,sha256=Gr2_w2utrflF37GHWxNlPuWg_W5ffUfyRGtUpwwC6VI,100352
|
|
28
|
+
PipeGraphPy/core/modcls/exportdata.cp39-win_amd64.pyd,sha256=APiGhPyFujH3GkAe_5uY7HVpBZ6lS4WLhyhtRWW0w2M,21504
|
|
29
|
+
PipeGraphPy/core/modcls/handlescript.cp39-win_amd64.pyd,sha256=SIfi6Yp-vbYb3Kk9Vf7EHTiJ1kM2mdvqHcllhW8Jvkg,22016
|
|
30
|
+
PipeGraphPy/core/modcls/importdata.cp39-win_amd64.pyd,sha256=b4wrk4LhmUHnkLyEsKgCL8CArIe7sk8dRfi_gqlYHZ0,21504
|
|
31
|
+
PipeGraphPy/core/modcls/merge.cp39-win_amd64.pyd,sha256=SzzWv5xQzBwN_2aQw7iAZ6aaSfB_e3sTmV_HFNtdAxU,23552
|
|
32
|
+
PipeGraphPy/core/modcls/mergescript.cp39-win_amd64.pyd,sha256=g59XfiDE4W1QXF4ujenfLM59H4TzziKZBtA5COODXrk,22528
|
|
33
|
+
PipeGraphPy/core/modcls/metrics.cp39-win_amd64.pyd,sha256=UidDVz5S4iCNrC7igLcARkitzKVFM9acjsM1QgQlyHo,179712
|
|
34
|
+
PipeGraphPy/core/modcls/postprocessor.cp39-win_amd64.pyd,sha256=vGgtInB1hcfPqgjDNj2ITQWtopCIyPc-jDIvjdNiHL8,43520
|
|
35
|
+
PipeGraphPy/core/modcls/preprocessor.cp39-win_amd64.pyd,sha256=CK7g6myTHDuCM11tXlgHRtKwLlekfzJP-4R4npLy1Fw,19968
|
|
36
|
+
PipeGraphPy/core/modcls/pythonscript.cp39-win_amd64.pyd,sha256=L_bC2jO6CEmwQOrLWvIqOeLOd8rXwufsdrbYB6UI2cU,21504
|
|
37
|
+
PipeGraphPy/core/modcls/regressor.cp39-win_amd64.pyd,sha256=jq-hQyiNIzU5UTyrind8iLeHMmnGfBS9wu-3YvKxPhw,19968
|
|
38
|
+
PipeGraphPy/core/modcls/selector.cp39-win_amd64.pyd,sha256=bNqhGa1bvuQ8Z2s3r4PRZ-26LZmTsuhMeWW1Gz0UL0g,19968
|
|
39
|
+
PipeGraphPy/core/modcls/selectscript.cp39-win_amd64.pyd,sha256=70uHTixBi9JUxWIBKzZSuP4y_DHESy5xgwG_lMKiONs,22528
|
|
40
|
+
PipeGraphPy/core/modcls/special.cp39-win_amd64.pyd,sha256=TCcfaPLysfwz7P4uIw2Ln5mmuoOhS6EIEVvbQufFh4c,37376
|
|
41
|
+
PipeGraphPy/core/modcls/split.cp39-win_amd64.pyd,sha256=4E7IjglFIV-DctmGZogS5blrovt87giurI3mZo0XKB8,19968
|
|
42
|
+
PipeGraphPy/core/modcls/splitscript.cp39-win_amd64.pyd,sha256=sRnkvZ9hEYceJZXewH196lRIcJPHzIf21Dj2sxH1o24,22528
|
|
43
|
+
PipeGraphPy/core/modcls/startscript.cp39-win_amd64.pyd,sha256=mPl2jnHgfbaFBT5L5AeNvThzzVZ9v-HnqILolrO72Vs,22016
|
|
44
|
+
PipeGraphPy/core/modcls/transformer.cp39-win_amd64.pyd,sha256=fuKdQEPymYFX2DNW83OBSoOJCTTCZ9d84iqaTx0BXfc,19968
|
|
45
|
+
PipeGraphPy/core/modules/__init__.py,sha256=LzKl-UHM4huZvOZPsfOF12ejeK2n1X6cxVamJcnOTBA,2266
|
|
46
|
+
PipeGraphPy/core/modules/classifier/__init__.py,sha256=FZk9hm7vBsK8G16pNugputbrrEciYqJc_XRAhTCcojI,46
|
|
47
|
+
PipeGraphPy/core/modules/cluster/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
+
PipeGraphPy/core/modules/custom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
+
PipeGraphPy/core/modules/custom/classifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
PipeGraphPy/core/modules/datacharts/__init__.py,sha256=-QC9TrxiMdcfYPUGLnc-n1ff1TaRolZhE6OJaCj-4K4,83
|
|
51
|
+
PipeGraphPy/core/modules/datacharts/dataview.py,sha256=AAX4weBc-EXsRA2G5OjeJ89IwOoe69T6YuDhhNK1BFI,659
|
|
52
|
+
PipeGraphPy/core/modules/deeplearning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
+
PipeGraphPy/core/modules/ensemble/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
|
+
PipeGraphPy/core/modules/evaluate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
|
+
PipeGraphPy/core/modules/exportdata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
PipeGraphPy/core/modules/importdata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
+
PipeGraphPy/core/modules/merge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
+
PipeGraphPy/core/modules/model_selector/__init__.py,sha256=StAfza8ohuJZl4suxWknWBySer4uppaPeMYJ04YLHjU,47
|
|
59
|
+
PipeGraphPy/core/modules/postprocessor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
+
PipeGraphPy/core/modules/preprocessor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
61
|
+
PipeGraphPy/core/modules/pythonscript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
+
PipeGraphPy/core/modules/regressor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
+
PipeGraphPy/core/modules/selector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
+
PipeGraphPy/core/modules/special/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
65
|
+
PipeGraphPy/core/modules/split/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
+
PipeGraphPy/core/modules/transformer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
|
+
PipeGraphPy/db/__init__.py,sha256=FZk9hm7vBsK8G16pNugputbrrEciYqJc_XRAhTCcojI,46
|
|
68
|
+
PipeGraphPy/db/models.cp39-win_amd64.pyd,sha256=cogO3nic2yNxb6Nogn0yDhIe47o_kS2l4o5D1D3_ePk,145920
|
|
69
|
+
PipeGraphPy/db/utils.py,sha256=HRppNcnjS2UkmquQEgWEFbPm-6s1STDwdUrVy8ETsqA,3573
|
|
70
|
+
PipeGraphPy/plot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
|
+
PipeGraphPy/plot/draw.py,sha256=lYo4xTx6aVtAu7aLf_hqR-knTaJCRKfDcYhiI-l0U1k,13239
|
|
72
|
+
PipeGraphPy/storage/__init__.py,sha256=90LcBHUtl967XD0Prfu5yp3TH_xiZ0ZI7fMOOFkqACE,229
|
|
73
|
+
PipeGraphPy/storage/base.py,sha256=shZf4er_TqnmuyOVBFtEgFKlz82Qc99eohvqNhHMd58,39
|
|
74
|
+
PipeGraphPy/storage/dict_backend.py,sha256=DeWaysru-R70pQ-5NOs4x1cEQuNKPAyahmO1FzHuTD0,3868
|
|
75
|
+
PipeGraphPy/storage/file_backend.py,sha256=dFK4YCtY9nxDdQUN2bPu_q3mGME-aNmqF4JKs3m8ZGE,14755
|
|
76
|
+
PipeGraphPy/storage/redis_backend.py,sha256=CTulA0iRcrSGo1of5B7j3kNgNycum-R4auY_29FREP8,6585
|
|
77
|
+
PipeGraphPy/utils/__init__.py,sha256=Gx-lC52xRprKQjygiXM00LBARNIsT5JakUprPew639E,14
|
|
78
|
+
PipeGraphPy/utils/check.py,sha256=4nsfJrI3OcYj9Q6ukQZBrNLH5J3bSg6LLKKEPwIFltw,7489
|
|
79
|
+
PipeGraphPy/utils/core.py,sha256=AtfYS_KpBU_LqeIW6wnunUmOQh5LV1awd5MBtLd_UWw,9186
|
|
80
|
+
PipeGraphPy/utils/examine.py,sha256=2bVU4ZBM5K7YkgCy_OS3ro57Mir7-Xh8iSkbh0Tb9EM,8037
|
|
81
|
+
PipeGraphPy/utils/file_operate.py,sha256=YEg7r0WpLP4u6Xlu2dlPVGP6qht-d1Gh1dsHnDd4taI,3062
|
|
82
|
+
PipeGraphPy/utils/format.py,sha256=Tq8UmJwvgleFxwQf7CMTvSQhEtdLh5fj_PS0ylbZ2AY,10697
|
|
83
|
+
PipeGraphPy/utils/functional.py,sha256=tCEjBUc8PLyEkMFTygl63eRc7BjejYUEMebXbAzlIZc,13973
|
|
84
|
+
PipeGraphPy/utils/handle_graph.py,sha256=r1fNPYc10noZPaRJaZfEWr0gsy5n4YIyjEAbSJNVJ-4,771
|
|
85
|
+
PipeGraphPy/utils/lock.py,sha256=2hj5ToRcw4HN0ErSkzmDzdRX3WnJ4x08qdBZQUAbwOc,13
|
|
86
|
+
PipeGraphPy/utils/mq.py,sha256=xomj0I1C3I82U1LQF_biFoIjps9vZiW1xe2baaW7qak,2047
|
|
87
|
+
PipeGraphPy/utils/osutil.py,sha256=wyAVdVVV66P_P4Feda402ILMNybet1EgUSiWYUtI81I,724
|
|
88
|
+
PipeGraphPy/utils/redis_operate.py,sha256=V-3ks8zY_wHAluB9tA3mG5O13f175NU2gLFbbqyqec8,6408
|
|
89
|
+
PipeGraphPy/utils/str_handle.py,sha256=xJyP26d3l2Qks3OTI4HbqMlmzKkjSgg8bMduRrdkSq4,3552
|
|
90
|
+
PipeGraphPy/utils/version.py,sha256=HLiOIs2F1fCjI3_kIwnpxGtmIqWlCBnhrfVc5wueLko,3307
|
|
91
|
+
PipeGraphPy-2.0.6.dist-info/METADATA,sha256=QYl5gtNaCHnIRQfpXvYFmiWL8Sc1iIsuV4wojPqxTn0,502
|
|
92
|
+
PipeGraphPy-2.0.6.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
93
|
+
PipeGraphPy-2.0.6.dist-info/top_level.txt,sha256=ABzFtoUyTUZ5Rbf9xFf_ZMHFTrO-FhwsyMTf3_qhJJ4,12
|
|
94
|
+
PipeGraphPy-2.0.6.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PipeGraphPy
|