Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#574)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 29, 2024
1 parent 18d20f3 commit 917704e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
exclude: ^docs/
Expand Down
7 changes: 4 additions & 3 deletions prepare_pyinstaller_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This script is run automatically as a part of `npm run build:flask:spec` after the `pyi-makespec` call.
"""

from pathlib import Path

with open(file=Path(__file__).parent / "nwb-guide.spec", mode="r") as io:
Expand All @@ -19,9 +20,9 @@

hiddenImportIdx = lines.index("hiddenimports = []\n")

lines[
hiddenImportIdx
] = "hiddenimports = [ 'email_validator', *collect_submodules('scipy.special.cython_special'), *os.path.join(os.path.dirname(scipy.__file__), '.libs')]\n\n"
lines[hiddenImportIdx] = (
"hiddenimports = [ 'email_validator', *collect_submodules('scipy.special.cython_special'), *os.path.join(os.path.dirname(scipy.__file__), '.libs')]\n\n"
)


# Originally this was a separate `npm` command per platform to account for CLI syntax differences between ; and :
Expand Down
1 change: 1 addition & 0 deletions pyflask/apis/neuroconv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API endpoint definitions for interacting with NeuroConv."""

import traceback

from flask_restx import Namespace, Resource, reqparse
Expand Down
1 change: 1 addition & 0 deletions pyflask/apis/startup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API endpoint definitions for startup operations."""

from flask_restx import Namespace, Resource

from errorHandlers import notBadRequestException
Expand Down
1 change: 1 addition & 0 deletions pyflask/app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The primary Flask server for the Python backend."""

import sys
import json
import multiprocessing
Expand Down
13 changes: 7 additions & 6 deletions pyflask/manageNeuroconv/manage_neuroconv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Collection of utility functions used by the NeuroConv Flask API."""

import os
import json
import math
Expand Down Expand Up @@ -85,9 +86,7 @@ def coerce_schema_compliance_recursive(obj, schema):
elif key in schema.get("properties", {}):
prop_schema = schema["properties"][key]
if prop_schema.get("type") == "number" and (value is None or value == "NaN"):
obj[
key
] = (
obj[key] = (
math.nan
) # Turn None into NaN if a number is expected (JavaScript JSON.stringify turns NaN into None)
elif prop_schema.get("type") == "number" and isinstance(value, int):
Expand Down Expand Up @@ -433,9 +432,11 @@ def update_conversion_progress(**kwargs):
available_options = converter.get_conversion_options_schema()
options = (
{
interface: {"stub_test": info["stub_test"]} # , "iter_opts": {"report_hook": update_conversion_progress}}
if available_options.get("properties").get(interface).get("properties", {}).get("stub_test")
else {}
interface: (
{"stub_test": info["stub_test"]} # , "iter_opts": {"report_hook": update_conversion_progress}}
if available_options.get("properties").get(interface).get("properties", {}).get("stub_test")
else {}
)
for interface in info["source_data"]
}
if run_stub_test
Expand Down

0 comments on commit 917704e

Please sign in to comment.