Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 9, 2024
1 parent 16150a1 commit 877a80b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
16 changes: 6 additions & 10 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,32 +668,28 @@ def get_interface_alignment(info: dict) -> dict:
return timestamps


def configure_dataset_backends(nwbfile, backend_configuration, configuration = None):
def configure_dataset_backends(nwbfile, backend_configuration, configuration=None):
from neuroconv.tools.nwb_helpers import get_default_backend_configuration, configure_backend

PROPS_TO_AVOID = [
"full_shape"
]
PROPS_TO_AVOID = ["full_shape"]

if (configuration is None):
if configuration is None:
configuration = get_default_backend_configuration(nwbfile=nwbfile, backend="hdf5")

for name, item in backend_configuration.items():
for key, value in item.items():

# Avoid setting compression options if unspecified
if (key == 'compression_options' and len(value) == 0):
if key == "compression_options" and len(value) == 0:
setattr(configuration.dataset_configurations[name], key, None)

# Avoid certain properties passed to the GUIDE
elif (key not in PROPS_TO_AVOID):
elif key not in PROPS_TO_AVOID:
setattr(configuration.dataset_configurations[name], key, value)


configure_backend(nwbfile=nwbfile, backend_configuration=configuration)



def get_backend_configuration(info: dict) -> dict:

import numpy as np
Expand All @@ -719,7 +715,7 @@ def get_backend_configuration(info: dict) -> dict:

if backend_configuration:
configure_dataset_backends(nwbfile, backend_configuration, configuration)

def custom_encoder(obj):
if isinstance(obj, np.ndarray):
return obj.tolist()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class GuidedBackendConfigurationPage extends ManagedPage {
}

// NOTE: Eventually you'll want to swap this to a full stub conversion with these options (which will fail the same...)
await this.getBackendConfiguration(true, { title: "Validating current backend configuration" }) // Validate by trying to set backend configuration with the latest values
await this.getBackendConfiguration(true, { title: "Validating current backend configuration" }); // Validate by trying to set backend configuration with the latest values

return this.to(1);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class GuidedStructurePage extends Page {
};

Object.assign(this.addButton.style, {
marginTop: '10px'
})
marginTop: "10px",
});

this.addButton.innerText = "Add Format";
this.addButton.onClick = () => {
this.search.shadowRoot.querySelector("input").focus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export class GuidedInspectorPage extends Page {
return html`
${until(
(async () => {
if (fileArr.length <= 1) {
this.report = inspector;
Expand Down Expand Up @@ -157,8 +156,7 @@ export class GuidedInspectorPage extends Page {
messages: truncateFilePaths(result.messages, path),
};
console.log(this.report, fileArr)
console.log(this.report, fileArr);
}
if (!inspector) await this.save();
Expand Down

0 comments on commit 877a80b

Please sign in to comment.