Skip to content

Commit

Permalink
Apply black, ruff, isort
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Jul 11, 2024
1 parent 7888afd commit 4369cdc
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 31 deletions.
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
# CUSTOM CONFIGURATIONS ADDED BY THE NWB TOOL FOR GENERATING FORMAT DOCS
###########################################################################

import sphinx_rtd_theme # noqa: E402
import textwrap # noqa: E402

import sphinx_rtd_theme # noqa: E402

# -- Options for intersphinx ---------------------------------------------
intersphinx_mapping.update({
'core': ('https://nwb-schema.readthedocs.io/en/latest/', None),
Expand All @@ -61,8 +62,8 @@

def run_doc_autogen(_):
# Execute the autogeneration of Sphinx format docs from the YAML sources
import sys
import os
import sys
conf_file_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(conf_file_dir) # Need so that generate format docs can find the conf_doc_autogen file
from conf_doc_autogen import spec_output_dir
Expand Down
1 change: 1 addition & 0 deletions docs/source/conf_doc_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
# Default type map to be used. This is the type map where dependent namespaces are stored. In the case of
# NWB this is spec_default_type_map = pynwb.get_type_map()
import pynwb # noqa: E402

spec_default_type_map = pynwb.get_type_map()

# Default specification classes for groups datasets and namespaces. In the case of NWB these are the NWB-specfic
Expand Down
3 changes: 2 additions & 1 deletion src/pynwb/ndx_extracellular_channels/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from pynwb import load_namespaces, get_class

from pynwb import get_class, load_namespaces

try:
from importlib.resources import files
Expand Down
9 changes: 6 additions & 3 deletions src/pynwb/ndx_extracellular_channels/io.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations # postpone type hint evaluation

import warnings
from typing import TYPE_CHECKING, List, Union

import ndx_extracellular_channels
import numpy as np
from typing import Union, List, TYPE_CHECKING
import warnings

if TYPE_CHECKING:
import probeinterface
Expand Down Expand Up @@ -83,7 +85,8 @@ def to_probeinterface(ndx_probe: ndx_extracellular_channels.Probe) -> probeinter
probeinterface.Probe.device_channel_indices
ndx_extracellular_channels.Probe.probe_model.contacts_table["shank_id"] -> probeinterface.Probe.shank_ids
ndx_extracellular_channels.Probe.probe_model.contacts_table["plane_axes"] -> probeinterface.Probe.contact_plane_axes
ndx_extracellular_channels.Probe.probe_model.contacts_table["radius_in_um"] -> probeinterface.Probe.contact_shapes["radius"]
ndx_extracellular_channels.Probe.probe_model.contacts_table["radius_in_um"] ->
probeinterface.Probe.contact_shapes["radius"]
Parameters
Expand Down
16 changes: 8 additions & 8 deletions src/pynwb/tests/test_classes.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""Unit and integration tests for the ndx_extracellular_channels types."""

from hdmf.common import DynamicTableRegion
import numpy as np
from pynwb import NWBFile
from pynwb.testing import TestCase, NWBH5IOFlexMixin

from hdmf.common import DynamicTableRegion
from ndx_extracellular_channels import (
ProbeInsertion,
ContactsTable,
ProbeModel,
Probe,
ChannelsTable,
ContactsTable,
ExtracellularSeries,
Probe,
ProbeInsertion,
ProbeModel,
)
from pynwb.testing import NWBH5IOFlexMixin, TestCase

from pynwb import NWBFile


class TestContactsTable(TestCase):
Expand Down
15 changes: 8 additions & 7 deletions src/pynwb/tests/test_example_usage_all.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import datetime
from hdmf.common import DynamicTableRegion
import numpy as np
from pynwb import NWBFile, NWBHDF5IO
import uuid

import numpy as np
from hdmf.common import DynamicTableRegion
from ndx_extracellular_channels import (
ProbeInsertion,
ContactsTable,
ProbeModel,
Probe,
ChannelsTable,
ContactsTable,
ExtracellularSeries,
Probe,
ProbeInsertion,
ProbeModel,
)

from pynwb import NWBHDF5IO, NWBFile


def test_all_classes():

Expand Down
6 changes: 4 additions & 2 deletions src/pynwb/tests/test_example_usage_probeinterface.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import datetime
import uuid

import ndx_extracellular_channels
import numpy as np
import numpy.testing as npt
import probeinterface

import pynwb
import uuid


def test_from_probeinterface():
Expand Down Expand Up @@ -158,7 +160,7 @@ def test_from_probeinterface():
npt.assert_array_equal(nwbfile.devices["renamed_probe3"].probe_model.contacts_table["shape"].data[:], "circle")
npt.assert_array_equal(
nwbfile.devices["renamed_probe3"].probe_model.contacts_table["radius_in_um"].data[:],
probe3.to_numpy()["radius"]
probe3.to_numpy()["radius"],
)


Expand Down
9 changes: 1 addition & 8 deletions src/spec/create_extension_spec.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# -*- coding: utf-8 -*-
import os.path

from pynwb.spec import (
NWBNamespaceBuilder,
export_spec,
NWBGroupSpec,
NWBAttributeSpec,
NWBDatasetSpec,
NWBLinkSpec,
)
from pynwb.spec import NWBAttributeSpec, NWBDatasetSpec, NWBGroupSpec, NWBLinkSpec, NWBNamespaceBuilder, export_spec


def main():
Expand Down

0 comments on commit 4369cdc

Please sign in to comment.