Remove old inp in routine

This commit is contained in:
WQY\qiong
2023-03-21 21:18:53 +08:00
parent 8681a56ed7
commit 9f9d3227b9
28 changed files with 83 additions and 642 deletions

View File

@@ -98,35 +98,9 @@ def delete_pattern(name: str, cs: ChangeSet) -> ChangeSet:
# ;desc
# id mult1 mult2 .....
#--------------------------------------------------------------
def inp_in_pattern(section: list[str]) -> ChangeSet:
descs = {}
patterns: dict[str, list[float]] = {}
count = len(section)
for i in range(0, count):
if section[i].startswith(';'):
# this is description
next = i + 1
if next < count and section[next].startswith(';') == False:
next_tokens = section[next].split()
descs[next_tokens[0]] = section[i].removeprefix(';')
continue
tokens = section[i].split()
if tokens[0] not in patterns:
patterns[tokens[0]] = []
for token in tokens[1:]:
patterns[tokens[0]].append(float(token))
cs = ChangeSet()
for id, factors in patterns.items():
cs.append(g_add_prefix | {'type': 'pattern', 'id' : id, 'factors' : factors})
#print(descs)
return cs
def inp_in_pattern_new(line: str) -> str:
def inp_in_pattern(line: str) -> str:
tokens = line.split()
sql = ''
for token in tokens[1:]: