Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Include the node's type in the UID computation #2038

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,15 @@ def toDict(self):
pass

def _computeUids(self):
""" Compute node uids by combining associated attributes' uids. """
""" Compute node UIDs by combining associated attributes' UIDs. """
# Get all the attributes associated to a given UID index, specified in node descriptions with "uid=[index]"
# For now, the only index that is used is "0", so there will be a single iteration of the loop below
for uidIndex, associatedAttributes in self.attributesPerUid.items():
# uid is computed by hashing the sorted list of tuple (name, value) of all attributes impacting this uid
# UID is computed by hashing the sorted list of tuple (name, value) of all attributes impacting this UID
uidAttributes = [(a.getName(), a.uid(uidIndex)) for a in associatedAttributes if a.enabled and a.value != a.uidIgnoreValue]
uidAttributes.sort()
# Adding the node type prevents ending up with two identical UIDs for different node types that have the exact same list of attributes
uidAttributes.append(self.nodeType)
self._uids[uidIndex] = hashValue(uidAttributes)

def _buildCmdVars(self):
Expand Down