Skip to content

Commit

Permalink
added upper/lower case insensitive check for the entity values
Browse files Browse the repository at this point in the history
  • Loading branch information
Biraj Shrestha authored and Biraj Shrestha committed Jul 19, 2024
1 parent 250de03 commit 61d8b6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CPAC/pipeline/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,8 @@ def initiate_rpool(wf, cfg, data_paths=None, part_id=None):
# output files with 4 different scans
resource_description = {
"suffix": "T1w",
"desc": "preproc",
"space": "MNI152NLin6ASym"
#"desc": "preproc",
#"space": "MNI152NLin6ASym"
}
resource_content = rpool.get_resource(resource_description)
#print(dir(rpool.get_resource("T1w")[0]))
Expand Down
2 changes: 1 addition & 1 deletion CPAC/pipeline/engine/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Resource():
def __init__(self, row, CpacProvenance):

self.cpac_provenance = CpacProvenance
self.metadata = {}#row['json'] if isinstance(row['json'], dict) else {}
self.metadata = {} # replace with >> row['json'] if isinstance(row['json'], dict) else {}
self.row = row
for key, value in self.row.items():
setattr(self, key, value)
Expand Down
2 changes: 1 addition & 1 deletion CPAC/pipeline/engine/resource_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ def get_resource(self, description):
# Check if the resource matches the description criteria
# Use getattr for object attributes or resources.get for dictionary keys
resource_val = getattr(resources, key, None)
if resource_val != val:
if resource_val.lower() != val.lower():
is_match = False
break # Break out of the inner loop if any criteria does not match
if is_match:
Expand Down

0 comments on commit 61d8b6d

Please sign in to comment.