Skip to content

Commit 0451e2c

Browse files
committed
All autogenerated inputs should not be hashed.
1 parent 16315da commit 0451e2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nipype/interfaces/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def get_hashval(self, hash_method=None):
496496
trait = self.trait(name)
497497
if has_metadata(trait.trait_type, "nohash", True):
498498
continue
499-
hash_files = not has_metadata(trait.trait_type, "hash_files", False)
499+
hash_files = not has_metadata(trait.trait_type, "hash_files", False) and not has_metadata(trait.trait_type, "name_source")
500500
dict_nofilename[name] = self._get_sorteddict(val, hash_method=hash_method, hash_files=hash_files)
501501
dict_withhash[name] = self._get_sorteddict(val, True, hash_method=hash_method, hash_files=hash_files)
502502
return (dict_withhash, md5(str(dict_nofilename)).hexdigest())

nipype/interfaces/traits_extension.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ def length(self):
230230
def isdefined(object):
231231
return not isinstance(object, _Undefined)
232232

233-
def has_metadata(trait, metadata, value, recursive=True):
233+
def has_metadata(trait, metadata, value=None, recursive=True):
234234
'''
235-
Checks if a given trait has a metadata set to particular value
235+
Checks if a given trait has a metadata (and optionally if it is set to particular value)
236236
'''
237237
count = 0
238-
if hasattr(trait, metadata) and getattr(trait, metadata) == value:
238+
if hasattr(trait, metadata) and (getattr(trait, metadata) == value or value==None):
239239
count += 1
240240
if recursive:
241241
if hasattr(trait, 'inner_traits'):

0 commit comments

Comments
 (0)