From baa86ddfb9ba9bacaf9e66dfbd7edd9501607b9d Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:49:03 -0400 Subject: [PATCH 1/5] try new docs theme --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 188bbc260..4e6207d17 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ templates_path = ["_templates"] master_doc = "index" exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -html_theme = "sphinx_rtd_theme" +html_theme = "pydata_sphinx_theme" # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 From d12937f05f3b8e3bfd37f17551ef3d015008cb54 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:57:25 -0400 Subject: [PATCH 2/5] Update requirements-rtd.txt --- docs/requirements-rtd.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements-rtd.txt b/docs/requirements-rtd.txt index 71bd1014d..292ec98f1 100644 --- a/docs/requirements-rtd.txt +++ b/docs/requirements-rtd.txt @@ -2,6 +2,6 @@ numpy jsonschema==3.2.0 Jinja2<3.1 sphinx==5.1.1 -sphinx_rtd_theme==0.5.1 +pydata-sphinx-theme==0.14.1 readthedocs-sphinx-search==0.1.0rc3 sphinx-copybutton==0.5.0 From 78f4d48f1f6ffb4a94f0e4c8981416ef6945c326 Mon Sep 17 00:00:00 2001 From: Garrett Date: Fri, 29 Sep 2023 12:19:00 -0700 Subject: [PATCH 3/5] Add table height --- docs/format_support.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/format_support.rst b/docs/format_support.rst index d2f35083e..0fe2c7b18 100644 --- a/docs/format_support.rst +++ b/docs/format_support.rst @@ -4,4 +4,4 @@ The following is a live record of all the supported formats in the NWB GUIDE and .. raw:: html - + From 855f0fe4cda3222404101742a400a7173058c54d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 20:57:42 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/renderer/src/stories/Search.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/stories/Search.js b/src/renderer/src/stories/Search.js index 8148d5de1..9796b7195 100644 --- a/src/renderer/src/stories/Search.js +++ b/src/renderer/src/stories/Search.js @@ -143,11 +143,12 @@ export class Search extends LitElement { this.list.appendChild(li); - return option.disabled - }).map(o => o.value); + return option.disabled; + }) + .map((o) => o.value); - console.warn(`Enabled: ${this.options.length - unsupported.length}/${this.options.length}`) - console.warn('Disabled Options:', unsupported) + console.warn(`Enabled: ${this.options.length - unsupported.length}/${this.options.length}`); + console.warn("Disabled Options:", unsupported); } return html` From 8186af3ba2bb871b92c6a339c43498c98d15e02f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 08:20:09 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyflask/manageNeuroconv/info/urls.py | 3 +- pyflask/manageNeuroconv/manage_neuroconv.py | 1 - src/renderer/package.json | 2 +- src/renderer/src/stories/InstanceManager.js | 13 ++--- src/renderer/src/stories/Table.js | 32 ++++++------ .../options/GuidedInspectorPage.js | 49 ++++++++----------- .../pages/guided-mode/setup/GuidedSubjects.js | 2 +- .../src/stories/preview/NWBFilePreview.js | 2 +- .../preview/inspector/InspectorList.js | 8 +-- src/renderer/src/validation/index.js | 2 +- 10 files changed, 51 insertions(+), 63 deletions(-) diff --git a/pyflask/manageNeuroconv/info/urls.py b/pyflask/manageNeuroconv/info/urls.py index dd087b498..e3b3d78d4 100644 --- a/pyflask/manageNeuroconv/info/urls.py +++ b/pyflask/manageNeuroconv/info/urls.py @@ -29,6 +29,5 @@ def resource_path(relative_path): # Create all nested home folders STUB_SAVE_FOLDER_PATH.mkdir(exist_ok=True, parents=True) -CONVERSION_SAVE_FOLDER_PATH.mkdir(exist_ok=True, parents=True) +CONVERSION_SAVE_FOLDER_PATH.mkdir(exist_ok=True, parents=True) TUTORIAL_SAVE_FOLDER_PATH.mkdir(exist_ok=True, parents=True) - diff --git a/pyflask/manageNeuroconv/manage_neuroconv.py b/pyflask/manageNeuroconv/manage_neuroconv.py index 0fe3c548a..2045f2d42 100644 --- a/pyflask/manageNeuroconv/manage_neuroconv.py +++ b/pyflask/manageNeuroconv/manage_neuroconv.py @@ -460,7 +460,6 @@ def upload_to_dandi( ): from neuroconv.tools.data_transfers import automatic_dandi_upload - # CONVERSION_SAVE_FOLDER_PATH.mkdir(exist_ok=True, parents=True) # Ensure base directory exists os.environ["DANDI_API_KEY"] = api_key # Update API Key diff --git a/src/renderer/package.json b/src/renderer/package.json index eafeb8053..892167dd4 100644 --- a/src/renderer/package.json +++ b/src/renderer/package.json @@ -4,4 +4,4 @@ "dependencies": { "electron": "^26.2.2" } -} \ No newline at end of file +} diff --git a/src/renderer/src/stories/InstanceManager.js b/src/renderer/src/stories/InstanceManager.js index aa58fd091..3336dec28 100644 --- a/src/renderer/src/stories/InstanceManager.js +++ b/src/renderer/src/stories/InstanceManager.js @@ -224,11 +224,9 @@ export class InstanceManager extends LitElement { setTimeout(() => { Object.entries(this.#info).forEach(([id, { status }]) => { - if (status) this.updateState(id, status) - }) - }) // NOTE: Why is this not possible without waiting? - - + if (status) this.updateState(id, status); + }); + }); // NOTE: Why is this not possible without waiting? }; #isCategory(value) { @@ -272,7 +270,7 @@ export class InstanceManager extends LitElement { }); } - #ids = {} + #ids = {}; #accordions = {}; #onSelected = () => { @@ -359,10 +357,9 @@ export class InstanceManager extends LitElement { return list; } - render() { - this.#info = {} + this.#info = {}; this.#items = []; const instances = this.#render(); diff --git a/src/renderer/src/stories/Table.js b/src/renderer/src/stories/Table.js index c8c752b80..7e6a0d4eb 100644 --- a/src/renderer/src/stories/Table.js +++ b/src/renderer/src/stories/Table.js @@ -65,7 +65,7 @@ export class Table extends LitElement { onUpdate, validateEmptyCells, onStatusChange, - contextMenu + contextMenu, } = {}) { super(); this.schema = schema ?? {}; @@ -73,7 +73,7 @@ export class Table extends LitElement { this.keyColumn = keyColumn; this.template = template ?? {}; this.validateEmptyCells = validateEmptyCells ?? true; - this.contextMenu = contextMenu ?? {} + this.contextMenu = contextMenu ?? {}; if (onUpdate) this.onUpdate = onUpdate; if (validateOnChange) this.validateOnChange = validateOnChange; @@ -288,25 +288,25 @@ export class Table extends LitElement { let contextMenu = ["row_below", "remove_row"]; if (this.schema.additionalProperties) contextMenu.push("col_right", "remove_col"); - console.log(this.contextMenu) - contextMenu = contextMenu.filter(k => !(this.contextMenu.ignore ?? []).includes(k)) + console.log(this.contextMenu); + contextMenu = contextMenu.filter((k) => !(this.contextMenu.ignore ?? []).includes(k)); - const descriptionEl = this.querySelector('#description') + const descriptionEl = this.querySelector("#description"); const operations = { rows: [], - columns: [] - } - - if (contextMenu.includes('row_below')) operations.rows.push('add') - if (contextMenu.includes('remove_row')) operations.rows.push('remove') - if (contextMenu.includes('col_right')) operations.columns.push('add') - if (contextMenu.includes('remove_col')) operations.columns.push('remove') - const operationSet = new Set(Object.values(operations).flat()) - const operationOn = Object.keys(operations).filter(k => operations[k].length) + columns: [], + }; + + if (contextMenu.includes("row_below")) operations.rows.push("add"); + if (contextMenu.includes("remove_row")) operations.rows.push("remove"); + if (contextMenu.includes("col_right")) operations.columns.push("add"); + if (contextMenu.includes("remove_col")) operations.columns.push("remove"); + const operationSet = new Set(Object.values(operations).flat()); + const operationOn = Object.keys(operations).filter((k) => operations[k].length); if (operationSet.size) { - const desc = `Right click to ${Array.from(operationSet).join('/')} ${operationOn.join('and')}.` - descriptionEl.innerText = desc + const desc = `Right click to ${Array.from(operationSet).join("/")} ${operationOn.join("and")}.`; + descriptionEl.innerText = desc; } const table = new Handsontable(div, { diff --git a/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js b/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js index 7f8de892c..1513eeeb3 100644 --- a/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js +++ b/src/renderer/src/stories/pages/guided-mode/options/GuidedInspectorPage.js @@ -28,8 +28,7 @@ const filter = (list, toFilter) => { }); }; - -const emptyMessage = 'No issues detected in these files!' +const emptyMessage = "No issues detected in these files!"; export class GuidedInspectorPage extends Page { constructor(...args) { @@ -58,11 +57,11 @@ export class GuidedInspectorPage extends Page { getStatus = (list) => { return list.reduce((acc, o) => { - const res = getMessageType(o) - if (acc === 'error') return acc - else return res - }, 'valid') - } + const res = getMessageType(o); + if (acc === "error") return acc; + else return res; + }, "valid"); + }; render() { const { globalState } = this.info; @@ -80,8 +79,6 @@ export class GuidedInspectorPage extends Page { .flat(); return html` ${until( (async () => { - - if (fileArr.length <= 1) { const items = inspector ?? @@ -101,37 +98,34 @@ export class GuidedInspectorPage extends Page { return truncateFilePaths(report, path); })(); - const _instances = fileArr.map(({ subject, session, info }) => { + const file_path = [`sub-${subject}`, `sub-${subject}_ses-${session}`]; + const filtered = removeFilePaths(filter(items, { file_path })); - const file_path = [`sub-${subject}`, `sub-${subject}_ses-${session}`] - const filtered = removeFilePaths(filter(items, { file_path })) - - const display = () => new InspectorList({ items: filtered, emptyMessage }) - display.status = this.getStatus(filtered) + const display = () => new InspectorList({ items: filtered, emptyMessage }); + display.status = this.getStatus(filtered); return { subject, session, - display + display, }; }); const instances = _instances.reduce((acc, { subject, session, display }) => { - const subLabel = `sub-${subject}` + const subLabel = `sub-${subject}`; if (!acc[`sub-${subject}`]) acc[subLabel] = {}; acc[subLabel][`ses-${session}`] = display; return acc; }, {}); Object.keys(instances).forEach((subLabel) => { - const subItems = filter(items, { file_path: `${subLabel}${nodePath.sep}${subLabel}_ses-` }); // NOTE: This will not run on web-only now const path = getSharedPath(subItems.map((o) => o.file_path)); - const filtered = truncateFilePaths(subItems, path) + const filtered = truncateFilePaths(subItems, path); - const display = () => new InspectorList({ items: filtered, emptyMessage }) - display.status = this.getStatus(filtered) + const display = () => new InspectorList({ items: filtered, emptyMessage }); + display.status = this.getStatus(filtered); instances[subLabel] = { ["All Files"]: display, @@ -139,20 +133,19 @@ export class GuidedInspectorPage extends Page { }; }); - const allDisplay = () => new InspectorList({ items, emptyMessage }) - allDisplay.status = this.getStatus(items) + const allDisplay = () => new InspectorList({ items, emptyMessage }); + allDisplay.status = this.getStatus(items); - const allInstances = { ["All Files"]: allDisplay, ...instances, - } + }; const manager = new InstanceManager({ - instances:allInstances + instances: allInstances, }); - - return manager + + return manager; })(), "" )}`; diff --git a/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js b/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js index d524dfd69..81217d6e1 100644 --- a/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js +++ b/src/renderer/src/stories/pages/guided-mode/setup/GuidedSubjects.js @@ -88,7 +88,7 @@ export class GuidedSubjectsPage extends Page { keyColumn: "subject_id", validateEmptyCells: false, contextMenu: { - ignore: ['row_below'] + ignore: ["row_below"], }, onUpdate: () => { this.unsavedUpdates = true; diff --git a/src/renderer/src/stories/preview/NWBFilePreview.js b/src/renderer/src/stories/preview/NWBFilePreview.js index 7c6d41e96..3a5de8286 100644 --- a/src/renderer/src/stories/preview/NWBFilePreview.js +++ b/src/renderer/src/stories/preview/NWBFilePreview.js @@ -20,7 +20,7 @@ export function getSharedPath(array) { } }); - return shared ? path.normalize(shared.join("/")) : ''; // Convert back to OS-specific path + return shared ? path.normalize(shared.join("/")) : ""; // Convert back to OS-specific path } export function truncateFilePaths(items, basepath) { diff --git a/src/renderer/src/stories/preview/inspector/InspectorList.js b/src/renderer/src/stories/preview/inspector/InspectorList.js index 6d4ef6239..e21802c59 100644 --- a/src/renderer/src/stories/preview/inspector/InspectorList.js +++ b/src/renderer/src/stories/preview/inspector/InspectorList.js @@ -42,7 +42,7 @@ export class InspectorList extends List { } constructor(props) { - const { items } = props + const { items } = props; const aggregatedItems = Object.values(aggregateMessages(items)).map((items) => { const aggregate = { ...items.pop() }; // Create a base object for the aggregation aggregate.files = [aggregate.file_path, ...items.map((o) => o.file_path)]; @@ -57,7 +57,7 @@ export class InspectorList extends List { const item = new InspectorListItem(o); item.style.flexGrow = "1"; return { content: item }; - }) + }), }); } } @@ -133,8 +133,8 @@ export class InspectorListItem extends LitElement { render() { this.type = getMessageType({ ...this, - type: this.ORIGINAL_TYPE - }) + type: this.ORIGINAL_TYPE, + }); this.setAttribute("title", this.message); diff --git a/src/renderer/src/validation/index.js b/src/renderer/src/validation/index.js index 002edd28f..86d13a7b8 100644 --- a/src/renderer/src/validation/index.js +++ b/src/renderer/src/validation/index.js @@ -4,7 +4,7 @@ import validationSchema from "./validation"; // NOTE: Only validation missing on NWBFile Metadata is check_subject_exists and check_processing_module_name -export const isErrorImportance = ["PYNWB_VALIDATION", "CRITICAL", "ERROR"] +export const isErrorImportance = ["PYNWB_VALIDATION", "CRITICAL", "ERROR"]; export function getMessageType(item) { return item.type ?? (isErrorImportance.includes(item.importance) ? "error" : "warning"); }