Skip to content
Snippets Groups Projects
Commit c17674d5 authored by Ben Wagner's avatar Ben Wagner
Browse files

Gear runs in both Session and in Batch

parent 1da00c21
No related merge requests found
......@@ -16,7 +16,7 @@
},
"gear-builder": {
"category": "utility",
"image": "ansir/meg-metadata-importer:0.0.028"
"image": "ansir/meg-metadata-importer:0.0.032"
}
},
"description": "Import file metadata into Flywheel. Metadata is stored under file.info.header. May also update blank fields in acquisition, session, and subject. Supports FIFF files.",
......@@ -42,5 +42,5 @@
"name": "meg-metadata-importer",
"source": "https://git.biohpc.swmed.edu/ben.wagner/meg-metadata-importer",
"url": "https://git.biohpc.swmed.edu/ben.wagner/meg-metadata-importer",
"version": "0.0.028"
"version": "0.0.032"
}
\ No newline at end of file
......@@ -19,9 +19,9 @@ log = logging.getLogger(__name__)
def main(context):
pp = pprint.PrettyPrinter(indent=4)
print("config_json:")
pp.pprint(context.config_json)
# pp = pprint.PrettyPrinter(indent=4)
# print("config_json:")
# pp.pprint(context.config_json)
in_file = context.get_input_path("input-file")
print(f"Examining: {in_file}")
......@@ -86,7 +86,7 @@ def main(context):
context.metadata.update_file(os.path.split(in_file)[1], info=file_info)
if not context.config.get("nonfile_metadata"):
return 0
print("Checking for nonfile metadata to update")
# print("Checking for nonfile metadata to update")
# Possible items to update (only if empty)
#
......@@ -111,7 +111,13 @@ def main(context):
# context.metadata.update_container("acquisition", some_dict)
# initalize SDK and get session info
acq = context.client.get(context.destination["id"])
# This doesn't work as destination["id"] is acquisition from "Run Batch Gear", but session from "Run Gear"
# acq = context.client.get(context.destination["id"])
# print("input: input-file:")
# pp.pprint(context.get_input("input-file"))
acq_id = context.get_input("input-file")["hierarchy"]["id"]
acq = context.client.get(acq_id)
session_id = acq["parents"]["session"]
subject_id = acq["parents"]["subject"]
project_id = acq["parents"]["project"]
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment