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 5, 2024
1 parent f1e4c6b commit e4966b0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
3 changes: 3 additions & 0 deletions pyflask/apis/neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def post(self):
if notBadRequestException(exception):
neuroconv_api.abort(500, str(exception))


@neuroconv_api.route("/configuration")
class GetBackendConfiguration(Resource):
@neuroconv_api.doc(responses={200: "Success", 400: "Bad Request", 500: "Internal server error"})
Expand All @@ -138,6 +139,7 @@ def post(self):
if notBadRequestException(exception):
neuroconv_api.abort(500, str(exception))


@neuroconv_api.route("/configuration/set")
class SetBackendConfiguration(Resource):
@neuroconv_api.doc(responses={200: "Success", 400: "Bad Request", 500: "Internal server error"})
Expand All @@ -149,6 +151,7 @@ def post(self):
if notBadRequestException(exception):
neuroconv_api.abort(500, str(exception))


validate_parser = neuroconv_api.parser()
validate_parser.add_argument("parent", type=dict, required=True)
validate_parser.add_argument("function_name", type=str, required=True)
Expand Down
1 change: 1 addition & 0 deletions pyflask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def get_cpu_count():

return dict(physical=physical, logical=logical)


@app.route("/get-recommended-species")
def get_species():
from dandi.metadata.util import species_map
Expand Down
9 changes: 3 additions & 6 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ def get_interface_alignment(info: dict) -> dict:

return timestamps


def get_backend_configuration(info):
from neuroconv.tools.nwb_helpers import get_default_backend_configuration
from pynwb import NWBHDF5IO
Expand All @@ -682,11 +683,8 @@ def set_backend_configuration(info):
from pynwb import NWBHDF5IO

with NWBHDF5IO(info["nwbfile_path"], "r") as io:
nwbfile= io.read()
configure_backend(
nwbfile=nwbfile, backend_configuration=info["configuration"]
)

nwbfile = io.read()
configure_backend(nwbfile=nwbfile, backend_configuration=info["configuration"])


def convert_to_nwb(info: dict) -> str:
Expand Down Expand Up @@ -783,7 +781,6 @@ def update_conversion_progress(**kwargs):
]
del ecephys_metadata["ElectrodeColumns"]


# from neuroconv.utils import NWBMetaDataEncoder
# from neuroconv.datainterfaces.ecephys.basesortingextractorinterface import BaseSortingExtractorInterface

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class GuidedBackendConfigurationPage extends ManagedPage {

form;


header = {
subtitle: "Configure your backend",
};
Expand All @@ -35,14 +34,14 @@ export class GuidedBackendConfigurationPage extends ManagedPage {
skip: {
condition: (v) => v === false,
skip: true,
}
}
}
},
},
};

footer = {
onNext: async () => {
await this.save(); // Save in case the conversion fails
await this.form.validate()
await this.form.validate();
// for (let { form } of this.forms) await form.validate(); // Will throw an error in the callback
return this.to(1);
},
Expand All @@ -66,19 +65,18 @@ export class GuidedBackendConfigurationPage extends ManagedPage {
}

render() {

this.#updateRendered(true);

const { stubs } = this.info.globalState.preview;
const stubArray = getStubArray(stubs);

const nwbfile_path = stubArray[0].file;
const promise = run('configuration', {
const promise = run("configuration", {
nwbfile_path,
backend: "hdf5"
backend: "hdf5",
})
.then((backendOptions) => {
console.log(backendOptions)
console.log(backendOptions);
return (this.form = new JSONSchemaForm({
schema: {},
results: {},
Expand All @@ -96,8 +94,7 @@ export class GuidedBackendConfigurationPage extends ManagedPage {
this.#toggleRendered();
});

return untilResult

return untilResult;
}
}

Expand Down

0 comments on commit e4966b0

Please sign in to comment.