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

Render empty subject if not locating data with multiple sessions #725

Merged
merged 3 commits into from
Apr 3, 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
2 changes: 2 additions & 0 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,8 @@ def get_unit_table_json(interface) -> List[Dict[str, Any]]:
unit_column = dict()

for property_name in properties:

# Separate this so that unit_id and unit_name exist (LOOK FURTHER)
if property_name == "unit_name":
sorting_property_value = str(unit_id) # Insert unit_id as name (str)
elif property_name in SORTING_INTERFACE_PROPERTY_OVERRIDES:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,24 +289,31 @@ export class GuidedPathExpansionPage extends Page {
if (existing) source_data[key] = existing ?? {};
}

globalState.results = {
[subject_id]: {
[session_id]: {
source_data,
metadata: {
NWBFile: {
session_id: session_id,
...(existingMetadata?.NWBFile ?? {}),
},
Subject: {
subject_id: subject_id,
...(existingMetadata?.Subject ?? {}),
},
const sub_id = subject_id ?? "";
const ses_id = session_id ?? "";

// Skip if results already exist without manual IDs
if ((!subject_id || !session_id) && globalState.results) return;
// Otherwise reset the results to the new subject/session
else {
globalState.results = {};

globalState.results[sub_id] = {};

globalState.results[sub_id][ses_id] = {
source_data,
metadata: {
NWBFile: {
session_id: ses_id,
...(existingMetadata?.NWBFile ?? {}),
},
Subject: {
subject_id: sub_id,
...(existingMetadata?.Subject ?? {}),
},
},
},
};
// }
};
}

this.save({}, false); // Ensure this structure is saved
},
Expand Down
Loading