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

Ephys Metadata #542

Closed
wants to merge 153 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
4560231
Enable Ophys and fix table
garrettmflynn Nov 9, 2023
45aea75
Add table in table
garrettmflynn Nov 9, 2023
3223109
Merge branch 'disable-schema-props' into ophys-metadata
garrettmflynn Nov 9, 2023
67731fd
Update form with new data
garrettmflynn Nov 9, 2023
23c90db
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2023
ac9394e
Merge branch 'disable-schema-props' into ophys-metadata
garrettmflynn Nov 9, 2023
10f05cd
Merge branch 'disable-schema-props' into ophys-metadata
CodyCBakerPhD Nov 9, 2023
0a0afb3
Merge branch 'main' into ophys-metadata
garrettmflynn Nov 9, 2023
2e54119
Merge branch 'disable-schema-props' into ophys-metadata
garrettmflynn Nov 9, 2023
c6c1a23
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 9, 2023
e73fdde
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 10, 2023
fc0abe7
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 11, 2023
6eeea26
Improve ignore specificity
garrettmflynn Nov 11, 2023
91134a6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2023
ffcc1f1
Properly ignore properties in tables
garrettmflynn Nov 11, 2023
16a0906
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Nov 11, 2023
e84e8e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2023
c218ffd
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 11, 2023
0176293
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 11, 2023
31b0176
Allow ordering the table columns
garrettmflynn Nov 11, 2023
f857aed
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Nov 11, 2023
0a3809e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2023
9d5babf
Max height of table cell and other updates
garrettmflynn Nov 11, 2023
a420280
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Nov 11, 2023
1fe9836
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2023
c267c32
Merge branch 'main' into ophys-metadata
garrettmflynn Nov 11, 2023
9f7891c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2023
3d454e9
Allow segmentation
garrettmflynn Nov 11, 2023
cf1d990
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Nov 11, 2023
d497565
Update GuidedMetadata.js
garrettmflynn Nov 11, 2023
ce8d56d
Update base-metadata.schema.ts
garrettmflynn Nov 11, 2023
296a179
Update base-metadata.schema.ts
garrettmflynn Nov 11, 2023
66916bb
Update BasicTable.js
garrettmflynn Nov 12, 2023
6d1c510
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 21, 2023
b6cefb2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2023
0361b82
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Nov 22, 2023
019e1ab
Merge branch 'main' into ophys-metadata
garrettmflynn Nov 22, 2023
86e07c6
Merge branch 'main' into ophys-metadata
garrettmflynn Nov 29, 2023
5450bf9
Update sorting
garrettmflynn Nov 29, 2023
cefafc3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2023
95e3b5f
Basic patternProperties rendering
garrettmflynn Nov 30, 2023
160c8c1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 30, 2023
f0c4821
Flag additional properties (but avoid for now)
garrettmflynn Nov 30, 2023
425b302
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 30, 2023
98886d8
Encode IDs
garrettmflynn Nov 30, 2023
3b324ef
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Nov 30, 2023
b8004fd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 30, 2023
e6ecdd4
Update data from pattern properties forms
garrettmflynn Dec 13, 2023
9563807
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 13, 2023
676e939
Fix list
garrettmflynn Dec 13, 2023
97b1913
Add pattern properties
garrettmflynn Dec 13, 2023
4963d85
Merge branch 'main' into ophys-metadata
garrettmflynn Dec 13, 2023
c7dc62c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 13, 2023
7fb923e
Correct for merge and patternProperties
garrettmflynn Dec 15, 2023
273b83d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 15, 2023
5a2a18d
Validate only patternProperties when provided
garrettmflynn Dec 15, 2023
f71fcd6
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 15, 2023
a7cbd0a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 15, 2023
067c372
Fix table validation
garrettmflynn Dec 15, 2023
cb44409
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 15, 2023
9348b1f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 15, 2023
6b74de4
Fix table validation in tests
garrettmflynn Dec 15, 2023
9167be5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 15, 2023
d83c9c9
Re-enable Ephys metadata
garrettmflynn Dec 18, 2023
11a2d48
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2023
0be825c
Allow editing nested tables
garrettmflynn Dec 18, 2023
b9975a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2023
3596b77
Proper validation of all table properties, including nested
garrettmflynn Dec 18, 2023
51974f5
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Dec 18, 2023
e35b970
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2023
4d3f347
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2023
90c9b9d
Allow NaN in forms for numbers
garrettmflynn Dec 18, 2023
8e2bd00
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 18, 2023
3c99095
Merge branch 'main' into ephys-metadata
garrettmflynn Dec 18, 2023
e2ed87c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2023
eb1c0ad
Warn users about changing a device name
garrettmflynn Dec 21, 2023
af2fda4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 21, 2023
ea811a1
Proper exclusion of certain JSON Schema errors
garrettmflynn Dec 21, 2023
aa5f7cd
Show additional properties and block adding them
garrettmflynn Dec 21, 2023
20a33c1
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 21, 2023
6e1599a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 21, 2023
5bc5b02
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Dec 27, 2023
16aba1a
Fix validation
garrettmflynn Dec 28, 2023
da28747
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Dec 28, 2023
b1532fd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2023
ce31bc4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2023
e7df0ab
Fix merge
garrettmflynn Dec 28, 2023
4723b05
Merge branch 'ephys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 28, 2023
c60f73d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 28, 2023
45242ce
Merge branch 'main' into ophys-metadata
CodyCBakerPhD Dec 31, 2023
9c95fbb
Exclude additionalProperties rendering group if none exist on initial…
garrettmflynn Dec 31, 2023
17a201c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 31, 2023
7e42759
Exclude additional properties from (auto)validated object
garrettmflynn Dec 31, 2023
8cef7e9
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Dec 31, 2023
780598f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 31, 2023
0287695
fix bad merge conflict
CodyCBakerPhD Dec 31, 2023
0d659cd
Preprocess refs independently from the JSON Schema form
garrettmflynn Dec 31, 2023
ed453b3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 31, 2023
a7ea64b
Update typescript
garrettmflynn Dec 31, 2023
5260306
Update utils.ts
garrettmflynn Dec 31, 2023
085c928
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 31, 2023
6f70a77
Merge branch 'main' into ophys-metadata
garrettmflynn Jan 3, 2024
23d56de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2024
12234df
Fix merge
garrettmflynn Jan 3, 2024
aeac3de
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Jan 3, 2024
ed5611d
Update JSONSchemaInput.js
garrettmflynn Jan 3, 2024
b2b073f
Update JSONSchemaInput.js
garrettmflynn Jan 3, 2024
8e1ffbe
Fix ignore
garrettmflynn Jan 3, 2024
2ab1a34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2024
6829a42
Remove editing test div
garrettmflynn Jan 3, 2024
c3b2ac3
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Jan 3, 2024
18afec8
Update List.ts
garrettmflynn Jan 3, 2024
b25caf4
Allow adding row to table without any
garrettmflynn Jan 3, 2024
38e2a9e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2024
09e5d84
Proper NaN representation
garrettmflynn Jan 3, 2024
37ae64d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2024
2dab4b9
Auto-update devices on dependencies if changed
garrettmflynn Jan 3, 2024
2da1318
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Jan 3, 2024
d90f34f
Render pattern properties as tables in the File Metadata
garrettmflynn Jan 3, 2024
959ee90
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2024
ad7a1af
Check unique device names
garrettmflynn Jan 4, 2024
9c776c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 4, 2024
9c1c68a
Ensure safe property editing
garrettmflynn Jan 4, 2024
592b763
Merge branch 'ophys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Jan 4, 2024
724a320
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 4, 2024
ab37d93
Render as editable tables
garrettmflynn Jan 4, 2024
6aab853
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 4, 2024
6a7b50b
Pass schema appropriately from all tables
garrettmflynn Jan 8, 2024
1ba6647
Fix validation
garrettmflynn Jan 9, 2024
95f71ea
Fix plane metadata
garrettmflynn Jan 11, 2024
25deb97
Merge branch 'main' into ophys-metadata
garrettmflynn Jan 11, 2024
efb4a02
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 11, 2024
8e04428
Ensure pipelines are consistent with new structure
garrettmflynn Jan 11, 2024
56e0ecc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 11, 2024
31556d2
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Jan 11, 2024
95bcfb7
Update GuidedMetadata.js
garrettmflynn Jan 11, 2024
a30c0b2
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Jan 11, 2024
7e473c7
Merge branch 'fix-project-tracking' into ophys-metadata
garrettmflynn Jan 11, 2024
f3371f0
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Jan 11, 2024
2692aa9
Update BasicTable.js
garrettmflynn Jan 11, 2024
b4a49e7
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Jan 11, 2024
7890a55
Show Ecephys metadata properly
garrettmflynn Jan 11, 2024
eb21b06
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 11, 2024
0b36101
Fix variables
garrettmflynn Jan 11, 2024
16cdbd3
Merge branch 'ophys-metadata' into ephys-metadata
garrettmflynn Jan 11, 2024
0ad655e
Merge branch 'main' into ephys-metadata
garrettmflynn Feb 5, 2024
6d64c9a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2024
475259f
Fix merge 2
garrettmflynn Feb 5, 2024
3e67293
Merge branch 'ephys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Feb 5, 2024
e6043bd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2024
203b37a
Update
garrettmflynn Feb 5, 2024
6befd79
Merge branch 'ephys-metadata' of https://github.com/NeurodataWithoutB…
garrettmflynn Feb 5, 2024
3796227
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 5, 2024
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
87 changes: 44 additions & 43 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def is_supported_recording_interface(recording_interface, metadata):

Alpha build release should therefore always return False for this.
"""

return (
recording_interface
and recording_interface.get_electrode_table_json
Expand All @@ -266,40 +267,39 @@ def get_metadata_schema(source_data: Dict[str, dict], interfaces: dict) -> Dict[
schema = converter.get_metadata_schema()
metadata = converter.get_metadata()

# recording_interface = get_first_recording_interface(converter)
recording_interface = get_first_recording_interface(converter)

# if is_supported_recording_interface(recording_interface, metadata):
# metadata["Ecephys"]["Electrodes"] = recording_interface.get_electrode_table_json()
if is_supported_recording_interface(recording_interface, metadata):
metadata["Ecephys"]["Electrodes"] = recording_interface.get_electrode_table_json()

# # Get Electrode metadata
# ecephys_properties = schema["properties"]["Ecephys"]["properties"]
# original_electrodes_schema = ecephys_properties["Electrodes"]
# Get Electrode metadata
ecephys_properties = schema["properties"]["Ecephys"]["properties"]
original_electrodes_schema = ecephys_properties["Electrodes"]

# new_electrodes_properties = {
# properties["name"]: {key: value for key, value in properties.items() if key != "name"}
# for properties in original_electrodes_schema["default"]
# }
new_electrodes_properties = {
properties["name"]: {key: value for key, value in properties.items() if key != "name"}
for properties in original_electrodes_schema["default"]
}

# ecephys_properties["Electrodes"] = {
# "type": "array",
# "minItems": 0,
# "items": {
# "type": "object",
# "properties": new_electrodes_properties,
# "additionalProperties": True, # Allow for new columns
# },
# }
ecephys_properties["Electrodes"] = {
"type": "array",
"minItems": 0,
"items": {
"type": "object",
"properties": new_electrodes_properties,
"additionalProperties": True, # Allow for new columns
},
}

# metadata["Ecephys"]["ElectrodeColumns"] = original_electrodes_schema["default"]
# defs = ecephys_properties["definitions"]
metadata["Ecephys"]["ElectrodeColumns"] = original_electrodes_schema["default"]
defs = ecephys_properties["definitions"]

# ecephys_properties["ElectrodeColumns"] = {"type": "array", "items": defs["Electrodes"]}
# ecephys_properties["ElectrodeColumns"]["items"]["required"] = list(defs["Electrodes"]["properties"].keys())
# del defs["Electrodes"]
ecephys_properties["ElectrodeColumns"] = {"type": "array", "items": defs["Electrodes"]}
ecephys_properties["ElectrodeColumns"]["items"]["required"] = list(defs["Electrodes"]["properties"].keys())
del defs["Electrodes"]

# # Delete Ecephys metadata if ElectrodeTable helper function is not available
# else:
if "Ecephys" in schema["properties"]:
# Delete Ecephys metadata if ElectrodeTable helper function is not available
elif "Ecephys" in schema["properties"]:
schema["properties"].pop("Ecephys", dict())

return json.loads(json.dumps(replace_nan_with_none(dict(results=metadata, schema=schema)), cls=NWBMetaDataEncoder))
Expand Down Expand Up @@ -451,29 +451,30 @@ def update_conversion_progress(**kwargs):
else None
)

# Update the first recording interface with Ecephys table data
# This will be refactored after the ndx-probe-interface integration
# recording_interface = get_first_recording_interface(converter)

if "Ecephys" not in info["metadata"]:
info["metadata"].update(Ecephys=dict())

resolved_metadata = replace_none_with_nan(
info["metadata"], resolve_references(converter.get_metadata_schema())
) # Ensure Ophys NaN values are resolved
# Ensure Ophys NaN values are resolved
resolved_metadata = replace_none_with_nan(info["metadata"], resolve_references(converter.get_metadata_schema()))

# if is_supported_recording_interface(recording_interface, info["metadata"]):
# electrode_column_results = ecephys_metadata["ElectrodeColumns"]
# electrode_results = ecephys_metadata["Electrodes"]
# Update the first recording interface with Ecephys table data
# NOTE: This will be refactored after the ndx-probe-interface integration
recording_interface = get_first_recording_interface(converter)

ecephys_metadata = resolved_metadata["Ecephys"]

# recording_interface.update_electrode_table(
# electrode_table_json=electrode_results, electrode_column_info=electrode_column_results
# )
if is_supported_recording_interface(recording_interface, info["metadata"]):
electrode_column_results = ecephys_metadata["ElectrodeColumns"]
electrode_results = ecephys_metadata["Electrodes"]

recording_interface.update_electrode_table(
electrode_table_json=electrode_results, electrode_column_info=electrode_column_results
)

# # Update with the latest metadata for the electrodes
# ecephys_metadata["Electrodes"] = electrode_column_results
# Update with the latest metadata for the electrodes
ecephys_metadata["Electrodes"] = electrode_column_results

# ecephys_metadata.pop("ElectrodeColumns", dict())
ecephys_metadata.pop("ElectrodeColumns", dict())

# Actually run the conversion
converter.run_conversion(
Expand Down
18 changes: 15 additions & 3 deletions schemas/base-metadata.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { header, replaceRefsWithValue } from '../src/renderer/src/stories/forms/

import baseMetadataSchema from './json/base_metadata_schema.json' assert { type: "json" }

const propsToInclude = {
ecephys: ["Device", "ElectrodeGroup", "Electrodes", "ElectrodeColumns", "definitions"]
}


function getSpeciesNameComponents(arr: any[]) {
const split = arr[arr.length - 1].split(' - ')
return {
Expand Down Expand Up @@ -41,8 +46,6 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa

copy.additionalProperties = false



copy.required = Object.keys(copy.properties) // Require all properties at the top level

copy.order = [ "NWBFile", "Subject" ]
Expand Down Expand Up @@ -89,9 +92,18 @@ export const preprocessMetadataSchema = (schema: any = baseMetadataSchema, globa
// Override description of keywords
nwbProps.keywords.description = 'Terms to describe your dataset (e.g. Neural circuits, V1, etc.)' // Add description to keywords


const ecephys = copy.properties.Ecephys
const ophys = copy.properties.Ophys

if (ecephys) {
// Only include a select group of Ecephys metadata here
const ecephysProps = ecephys.properties;
Object.keys(ecephysProps).forEach((k) => (!propsToInclude.ecephys.includes(k) ? delete ecephysProps[k] : ""));

// Change rendering order for electrode table columns
ecephysProps["Electrodes"].items.order = ["channel_name", "group_name", "shank_electrode_number"];
}

if (ophys) {

ophys.required = Object.keys(ophys.properties)
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/stories/BasicTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class BasicTable extends LitElement {
if (type.includes("int") || type.includes("float")) type = "number";
if (type.startsWith("bool")) type = "boolean";
if (type.startsWith("str")) type = "string";
}
} else type = "string"; // Default to string type

// Check if required
if (!value && "required" in this.#itemSchema.required.includes(col))
Expand Down Expand Up @@ -367,6 +367,7 @@ export class BasicTable extends LitElement {
this.#updateRendered();

const entries = this.#itemProps;

for (let key in this.ignore) delete entries[key];
for (let key in this.ignore["*"] ?? {}) delete entries[key];

Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/stories/JSONSchemaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,6 @@ export class JSONSchemaForm extends LitElement {
results,
additionalPropPattern
);

return [...rendered, additionalElement];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ export class GuidedMetadataPage extends ManagedPage {
// JSON Schema Exceptions
if (error.message.includes('does not conform to the "date-time" format.')) return false;
if (error.message.includes('not allowed to have the additional property "Ecephys".')) return false; // NOTE: Remove after including Ecephys metadata
if (error.message.includes('not allowed to have the additional property "ElectricalSeriesAP'))
return false; // NOTE: Remove after including Icephys metadata
},

groups: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,9 @@ export class GuidedSourceDataPage extends ManagedPage {

const { results: metadata, schema } = result;

// Always delete Ecephys if absent ( NOTE: temporarily manually removing from schema on backend...)
const alwaysDelete = ["Ecephys"];
alwaysDelete.forEach((k) => {
if (!metadata[k]) delete info.metadata[k]; // Delete directly on metadata
});

for (let key in info.metadata) {
if (!alwaysDelete.includes(key) && !(key in schema.properties)) metadata[key] = undefined;
}
// for (let key in info.metadata) {
// if (!alwaysDelete.includes(key) && !(key in schema.properties)) metadata[key] = undefined;
// }

// Merge metadata results with the generated info
merge(metadata, info.metadata);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/stories/pages/guided-mode/storyStates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nwbBaseSchema from "../../../../../../schemas/base-metadata.schema";
// import exephysExampleSchema from "../../../../../../schemas/json/ecephys_metadata_schema_example.json";
import exephysExampleSchema from "../../../../../../schemas/json/ecephys_metadata_schema_example.json";

import { dashboard } from "../../../pages.js";
import { activateServer } from "../../../server/globals";
Expand All @@ -12,7 +12,7 @@ export const PageTemplate = (args = {}) => {
};


// nwbBaseSchema.properties.Ecephys = exephysExampleSchema;
nwbBaseSchema.properties.Ecephys = exephysExampleSchema;

export const globalState = {
project: {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/stories/table/Cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class TableCell extends LitElement {
}

set value(value) {
if (!value) value = []
// if (!value) value = []

if (this.input) this.input.set(renderValue(value, this.schema)) // Allow null to be set directly
this.#value = this.input
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/src/stories/table/cells/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,12 @@ export class TableCellBase extends LitElement {
const editor = this.#editor = this.#render('editor')
const renderer = this.#renderer = this.#render('renderer')


this.addEventListener('blur', (ev) => {
ev.stopPropagation()
this.toggle(false)
})



if (!editor || !renderer || renderer === editor) return editor || renderer

return html`<div class="renderer">${renderer}</div><div id="editor">${editor}</div>`
Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/stories/table/convert.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const renderValue = (value: any, schema: any) => {

if (schema.type === 'number' || schema.type === 'integer') {
if (value === null) return ''
}
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/validation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export async function validateOnChange(name, parent, path, value) {
let functions = [];

const fullPath = [...path, name];
const toIterate = fullPath; //fullPathNoRows // fullPath

const toIterate = fullPath;

const copy = { ...parent }; // Validate on a copy of the parent
if (arguments.length > 3) copy[name] = value; // Update value on copy
Expand All @@ -37,6 +38,7 @@ export async function validateOnChange(name, parent, path, value) {
// Otherwise set the last wildcard
else {
lastWildcard = typeof acc["*"] === "string" ? acc["*"].replace(`{*}`, `${name}`) : acc["*"];

overridden = false; // Re-enable if a new one is specified below
}
} else if (lastWildcard && typeof lastWildcard === "object") {
Expand Down
Loading