Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #574

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading