From 0164de8088c8a75404c3103c01d06679a5191e79 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn Date: Wed, 17 Apr 2024 10:52:40 -0500 Subject: [PATCH] Update for Neuroconv schema fix --- pyflask/manageNeuroconv/manage_neuroconv.py | 10 +++++----- schemas/json/ecephys_metadata_schema_example.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyflask/manageNeuroconv/manage_neuroconv.py b/pyflask/manageNeuroconv/manage_neuroconv.py index 738ddafe3..a0aec323c 100644 --- a/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/pyflask/manageNeuroconv/manage_neuroconv.py @@ -411,7 +411,7 @@ def get_metadata_schema(source_data: Dict[str, dict], interfaces: dict) -> Dict[ ecephys_properties["ElectrodeColumns"] = { "type": "array", "minItems": 0, - "items": {"$ref": "#/properties/Ecephys/properties/definitions/ElectrodeColumn"}, + "items": {"$ref": "#/properties/Ecephys/definitions/ElectrodeColumn"}, } ecephys_schema["required"].append("ElectrodeColumns") @@ -429,7 +429,7 @@ def get_metadata_schema(source_data: Dict[str, dict], interfaces: dict) -> Dict[ ecephys_properties["UnitColumns"] = { "type": "array", "minItems": 0, - "items": {"$ref": "#/properties/Ecephys/properties/definitions/UnitColumn"}, + "items": {"$ref": "#/properties/Ecephys/definitions/UnitColumn"}, } schema["properties"]["Ecephys"]["required"].append("UnitColumns") @@ -463,7 +463,7 @@ def on_sorting_interface(name, sorting_interface): "maxItems": n_units, "items": { "allOf": [ - {"$ref": "#/properties/Ecephys/properties/definitions/Unit"}, + {"$ref": "#/properties/Ecephys/definitions/Unit"}, {"required": list(map(lambda info: info["name"], unit_columns))}, ] }, @@ -499,7 +499,7 @@ def on_recording_interface(name, recording_interface): "maxItems": n_electrodes, "items": { "allOf": [ - {"$ref": "#/properties/Ecephys/properties/definitions/Electrode"}, + {"$ref": "#/properties/Ecephys/definitions/Electrode"}, {"required": list(map(lambda info: info["name"], electrode_columns))}, ] }, @@ -521,7 +521,7 @@ def on_recording_interface(name, recording_interface): # Delete Ecephys metadata if no interfaces processed if has_ecephys: - defs = ecephys_properties["definitions"] + defs = ecephys_schema["definitions"] electrode_def = defs["Electrodes"] diff --git a/schemas/json/ecephys_metadata_schema_example.json b/schemas/json/ecephys_metadata_schema_example.json index 5d1f6da93..0c7643c85 100644 --- a/schemas/json/ecephys_metadata_schema_example.json +++ b/schemas/json/ecephys_metadata_schema_example.json @@ -8,7 +8,7 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/properties/Ecephys/properties/definitions/Device" + "$ref": "#/properties/Ecephys/definitions/Device" }, "default": [ { @@ -22,7 +22,7 @@ "type": "array", "minItems": 1, "items": { - "$ref": "#/properties/Ecephys/properties/definitions/ElectrodeGroup" + "$ref": "#/properties/Ecephys/definitions/ElectrodeGroup" }, "default": [ {