Skip to content

Commit

Permalink
Merge branch 'main' into AudioInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored Oct 17, 2023
2 parents ead7c78 + 9463ac6 commit 72933e4
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 3 deletions.
1 change: 1 addition & 0 deletions guideGlobalMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"AlphaOmegaRecordingInterface",
"DeepLabCutInterface",
"SLEAPInterface",
"FicTracDataInterface",
"AudioInterface"
]
}
29 changes: 29 additions & 0 deletions schemas/json/generated/FicTracDataInterface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"required": [],
"properties": {
"FicTracDataInterface": {
"required": [
"file_path"
],
"properties": {
"file_path": {
"format": "file",
"type": "string"
},
"verbose": {
"type": "boolean",
"default": true
}
},
"type": "object",
"additionalProperties": false
}
},
"type": "object",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "source.schema.json",
"title": "Source data schema",
"description": "Schema for the source data, files and directories",
"version": "0.1.0"
}
2 changes: 1 addition & 1 deletion src/renderer/src/stories/FileSystemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class FilesystemSelector extends LitElement {
};

#checkType = (value) => {
const isLikelyFile = fs ? fs.lstatSync(value).isFile() : value.split(".").length;
const isLikelyFile = fs ? fs.statSync(value).isFile() : value.split(".").length;
if ((this.type === "directory" && isLikelyFile) || (this.type === "file" && !isLikelyFile))
this.#onThrow("Incorrect filesystem object", `Please provide a <b>${this.type}</b> instead.`);
};
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/src/stories/JSONSchemaForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,13 @@ export class JSONSchemaForm extends LitElement {
const res = entries
.map(([key, value]) => {
if (!value.properties && key === "definitions") return false; // Skip definitions
if (this.ignore.includes(key)) return false;
if (
this.ignore.find((v) => {
if (typeof v === "string") return v === key;
else return v.test(key);
})
)
return false;
if (this.showLevelOverride >= path.length) return isRenderable(key, value);
if (required[key]) return isRenderable(key, value);
if (this.#getLink([...this.base, ...path, key])) return isRenderable(key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import NeuralynxRecordingInterfaceSchema from "../../../../../../schemas/json/ge
import AlphaOmegaRecordingInterfaceSchema from "../../../../../../schemas/json/generated/AlphaOmegaRecordingInterface.json";
import DeepLabCutInterfaceSchema from "../../../../../../schemas/json/generated/DeepLabCutInterface.json";
import SLEAPInterfaceSchema from "../../../../../../schemas/json/generated/SLEAPInterface.json";
import FicTracDataInterfaceSchema from "../../../../../../schemas/json/generated/FicTracDataInterface.json";
import AudioInterfaceSchema from "../../../../../../schemas/json/generated/AudioInterface.json";

export default {
Expand Down Expand Up @@ -109,6 +110,8 @@ globalStateCopy.schema.source_data.properties.AlphaOmegaRecordingInterface =
globalStateCopy.schema.source_data.properties.DeepLabCutInterface =
DeepLabCutInterfaceSchema.properties.DeepLabCutInterface;
globalStateCopy.schema.source_data.properties.SLEAPInterface = SLEAPInterfaceSchema.properties.SLEAPInterface;
globalStateCopy.schema.source_data.properties.FicTracDataInterface =
FicTracDataInterfaceSchema.properties.FicTracDataInterface;
globalStateCopy.schema.source_data.properties.AudioInterface = AudioInterfaceSchema.properties.AudioInterface;

const results = globalStateCopy.results;
Expand Down Expand Up @@ -321,6 +324,12 @@ SLEAPInterfaceGlobalCopy.interfaces.interface = SLEAPInterface;
SLEAPInterfaceGlobalCopy.schema.source_data = SLEAPInterfaceSchema;
SLEAPInterface.args = { activePage, globalState: SLEAPInterfaceGlobalCopy };

export const FicTracDataInterface = PageTemplate.bind({});
const FicTracDataInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
FicTracDataInterfaceGlobalCopy.interfaces.interface = FicTracDataInterface;
FicTracDataInterfaceGlobalCopy.schema.source_data = FicTracDataInterfaceSchema;
FicTracDataInterface.args = { activePage, globalState: FicTracDataInterfaceGlobalCopy };

export const AudioInterface = PageTemplate.bind({});
const AudioInterfaceGlobalCopy = JSON.parse(JSON.stringify(globalState));
AudioInterfaceGlobalCopy.interfaces.interface = AudioInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ export class GuidedMetadataPage extends ManagedPage {
results,
globals: aggregateGlobalMetadata,

ignore: ["Ophys", "subject_id", "session_id"],
ignore: [
"Ophys", // Always ignore ophys metadata (for now)
"Icephys", // Always ignore icephys metadata (for now)
"Behavior", // Always ignore behavior metadata (for now)
new RegExp("ndx-.+"), // Ignore all ndx extensions
"subject_id",
"session_id",
],

conditionalRequirements: [
{
Expand Down

0 comments on commit 72933e4

Please sign in to comment.