Skip to content
Snippets Groups Projects
Commit 8bcc593a authored by Tsegelnik Nikita's avatar Tsegelnik Nikita
Browse files

changing `sname` assignment, due to better Pattern Matching, adding some TODOs and NOTEs

parent 3b84bea9
No related branches found
No related tags found
1 merge request!19New version
Pipeline #17060 passed
......@@ -54,7 +54,9 @@ class GData(UserDict):
"""
Sets the storage name `sname`
"""
self["sname"] = self.uname() if not val else val
self["sname"] = self["name"] if not val else val
# NOTE: Previous implementation
#self["sname"] = self.uname() if not val else val
def __set_defaults__(self) -> None:
for key in ("name", "sname", "type", "namespace"):
......
......@@ -233,24 +233,21 @@ class GDGraph:
"""
# TODO: Will not work with different instances!
# Resolve different problem with uname, sname and Pattern Matching!
# NOTE: Update from 20.03.22
# Now different instances are processed,
# due to `sname` is not contain `instance` anymore!
try:
if strict_order:
return (
self.data["name"] == other.data["name"]
and all(
tuple(
x.data["sname"] == y.data["sname"]
for x, y in zip(self.children, other.children)
)
return self.data["name"] == other.data["name"] and all(
tuple(
x.data["sname"] == y.data["sname"]
for x, y in zip(self.children, other.children)
)
# and self.data.argnames() == other.data.argnames()
)
xtup = sorted([x["sname"] for x in self.children])
ytup = sorted([y["sname"] for y in other.children])
return (
self.data["name"] == other.data["name"]
and all(tuple(x == y for x, y in zip(xtup, ytup)))
# and sorted(self.data.argnames()) == sorted(other.data.argnames())
return self.data["name"] == other.data["name"] and all(
tuple(x == y for x, y in zip(xtup, ytup))
)
except:
return False
......
......@@ -162,7 +162,7 @@ class GPatternMatcher:
if isinstance(datalist[0], GData)
else datalist[0][0]
)
data["sname"] = f"{pname}_{data['instance']}"
data["sname"] = pname
for key in pattern:
if key == "expr":
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment