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

Update for Neuroconv schema fix #755

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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))},
]
},
Expand Down Expand Up @@ -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))},
]
},
Expand All @@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions schemas/json/ecephys_metadata_schema_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/properties/Ecephys/properties/definitions/Device"
"$ref": "#/properties/Ecephys/definitions/Device"
},
"default": [
{
Expand All @@ -22,7 +22,7 @@
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/properties/Ecephys/properties/definitions/ElectrodeGroup"
"$ref": "#/properties/Ecephys/definitions/ElectrodeGroup"
},
"default": [
{
Expand Down
Loading