Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
GNA Parser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gna
GNA Parser
Commits
8bcc593a
Commit
8bcc593a
authored
3 years ago
by
Tsegelnik Nikita
Browse files
Options
Downloads
Patches
Plain Diff
changing `sname` assignment, due to better Pattern Matching, adding some TODOs and NOTEs
parent
3b84bea9
No related branches found
Branches containing commit
No related tags found
1 merge request
!19
New version
Pipeline
#17060
passed
3 years ago
Stage: tests
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/gdata.py
+3
-1
3 additions, 1 deletion
source/gdata.py
source/gdgraph.py
+9
-12
9 additions, 12 deletions
source/gdgraph.py
source/gpatternmatcher.py
+1
-1
1 addition, 1 deletion
source/gpatternmatcher.py
with
13 additions
and
14 deletions
source/gdata.py
+
3
−
1
View file @
8bcc593a
...
...
@@ -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
"
):
...
...
This diff is collapsed.
Click to expand it.
source/gdgraph.py
+
9
−
12
View file @
8bcc593a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
source/gpatternmatcher.py
+
1
−
1
View file @
8bcc593a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment