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

Black formatting #1487

Merged
merged 1 commit into from
Jun 9, 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
1 change: 0 additions & 1 deletion neo/core/imagesequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
the old object.
"""


import quantities as pq
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions neo/core/spiketrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import quantities as pq
from neo.core.baseneo import BaseNeo, MergeError, merge_annotations
from neo.core.dataobject import DataObject, ArrayDict

# need this to avoid circular import issue
import neo

Expand Down
1 change: 0 additions & 1 deletion neo/io/axonio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from neo.core import Segment, AnalogSignal



class AxonIO(AxonRawIO, BaseFromRaw):
"""
Class for reading data from pCLAMP and AxoScope
Expand Down
3 changes: 0 additions & 3 deletions neo/io/blkio.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from neo.core import ImageSequence, Segment, Block





class BlkIO(BaseIO):
"""
Neo IO module for optical imaging data stored as BLK file
Expand Down
1 change: 1 addition & 0 deletions neo/io/brainwaredamio.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

# needed core neo modules
from neo.core import AnalogSignal, Block, Group, Segment

# need to subclass BaseIO
from neo.io.baseio import BaseIO

Expand Down
1 change: 1 addition & 0 deletions neo/io/brainwaref32io.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

# needed core neo modules
from neo.core import Block, Group, Segment, SpikeTrain, NeoReadWriteError

# need to subclass BaseIO
from neo.io.baseio import BaseIO

Expand Down
1 change: 1 addition & 0 deletions neo/io/brainwaresrcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

# needed core neo modules
from neo.core import Block, Event, Group, Segment, SpikeTrain

# need to subclass BaseIO
from neo.io.baseio import BaseIO

Expand Down
1 change: 1 addition & 0 deletions neo/io/elphyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@

# I need to subclass BaseIO
from neo.io.baseio import BaseIO

# to import from core
from neo.core import Block, Segment, AnalogSignal, Event, SpikeTrain, NeoReadWriteError

Expand Down
1 change: 0 additions & 1 deletion neo/io/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
SPikeTrains
"""


from collections.abc import MutableSequence

from neo.core import (
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/axonrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
)
from neo.core import NeoReadWriteError


class AxonRawIO(BaseRawIO):
"""
Class for Class for reading data from pCLAMP and AxoScope files (.abf version 1 and 2)
Expand Down
2 changes: 1 addition & 1 deletion neo/rawio/bci2000rawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
https://www.bci2000.org/mediawiki/index.php/Technical_Reference:BCI2000_File_Format
"""


import numpy as np
import re

Expand All @@ -21,6 +20,7 @@
)
from neo.core import NeoReadWriteError


class BCI2000RawIO(BaseRawIO):
"""
Class for reading data from a BCI2000 .dat file, either version 1.0 or 1.1
Expand Down
1 change: 0 additions & 1 deletion neo/rawio/biocamrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Authors: Alessio Buccino, Robert Wolff
"""


import json
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions neo/rawio/brainvisionrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from neo.core import NeoReadWriteError


class BrainVisionRawIO(BaseRawIO):
"""Class for reading BrainVision files

Expand Down
3 changes: 1 addition & 2 deletions neo/rawio/cedrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
Author : Samuel Garcia
"""



import numpy as np

from .baserawio import (
Expand All @@ -32,6 +30,7 @@
_event_channel_dtype,
)


class CedRawIO(BaseRawIO):
"""
Class for reading data from CED (Cambridge Electronic Design) spike2.
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/edfrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
_event_channel_dtype,
)


class EDFRawIO(BaseRawIO):
"""
Class for reading European Data Format files (EDF and EDF+).
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/elanrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from neo.core import NeoReadWriteError


class ElanRawIO(BaseRawIO):
"""
Class for reading time-frequency EEG data maps from the Elan software
Expand Down
16 changes: 9 additions & 7 deletions neo/rawio/intanrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def _parse_header(self):

# Data Integrity checks
self._assert_timestamp_continuity()

# signals
signal_channels = []
for c, chan_info in enumerate(self._ordered_channel_info):
Expand Down Expand Up @@ -445,13 +445,13 @@ def _get_analogsignal_chunk_one_file_per_signal(self, i_start, i_stop, stream_in
signal_data_memmap = self._raw_data[stream_index]

return signal_data_memmap[i_start:i_stop, channel_indexes]

def _assert_timestamp_continuity(self):
"""
Asserts the continuity of timestamps in the data.

This method verifies that the timestamps in the raw data are sequential,
indicating a continuous recording. If discontinuities are found, a flag
This method verifies that the timestamps in the raw data are sequential,
indicating a continuous recording. If discontinuities are found, a flag
is set to indicate potential data integrity issues, and an error is raised
unless `ignore_integrity_checks` is True.

Expand Down Expand Up @@ -491,7 +491,7 @@ def _assert_timestamp_continuity(self):
"\nTimestamps are not continuous, likely due to a corrupted file or inappropriate file merge.\n"
"To open the file anyway, initialize the reader with `ignore_integrity_checks=True`.\n\n"
"Discontinuities Found:\n"
"+-----------------+-----------------+-----------------+-----------------------+\n"
"+-----------------+-----------------+-----------------+-----------------------+\n"
"| Discontinuity | Previous | Next | Time Difference |\n"
"| Index | (Frames) | (Frames) | (Seconds) |\n"
"+-----------------+-----------------+-----------------+-----------------------+\n"
Expand All @@ -503,12 +503,14 @@ def _assert_timestamp_continuity(self):
next_ts = timestamp[discontinuity_index + 1]
time_diff = (next_ts - prev_ts) / amplifier_sampling_rate

error_msg += f"| {discontinuity_index + 1:>15,} | {prev_ts:>15,} | {next_ts:>15,} | {time_diff:>21.6f} |\n"
error_msg += (
f"| {discontinuity_index + 1:>15,} | {prev_ts:>15,} | {next_ts:>15,} | {time_diff:>21.6f} |\n"
)

error_msg += "+-----------------+-----------------+-----------------+-----------------------+\n"

raise NeoReadWriteError(error_msg)


def read_qstring(f):
length = np.fromfile(f, dtype="uint32", count=1)[0]
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/mearecrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
_event_channel_dtype,
)


class MEArecRawIO(BaseRawIO):
"""
Class for "reading" simulated data from a MEArec file.
Expand Down
3 changes: 1 addition & 2 deletions neo/rawio/medrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
Authors: Dan Crepeau, Matt Stead
"""



import numpy as np

from .baserawio import (
Expand All @@ -18,6 +16,7 @@
_event_channel_dtype,
)


class MedRawIO(BaseRawIO):
"""
Class for reading MED (Multiscale Electrophysiology Data) Format.
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/micromedrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from neo.core import NeoReadWriteError


class StructFile(io.BufferedReader):
def read_f(self, fmt, offset=None):
if offset is not None:
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/neuroexplorerrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
Author: Samuel Garcia, luc estebanez, mark hollenbeck

"""

from collections import OrderedDict

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion neo/rawio/nixrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Author: Chek Yin Choi, Julia Sprenger
"""


import numpy as np

from .baserawio import (
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/rawmcsrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
_event_channel_dtype,
)


class RawMCSRawIO(BaseRawIO):
"""
Class for reading an mcs file converted by the MC_DataToo binary converter
Expand Down
2 changes: 2 additions & 0 deletions neo/rawio/spike2rawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
Author: Samuel Garcia

"""

from collections import OrderedDict

import numpy as np
Expand All @@ -30,6 +31,7 @@
)
from neo.core import NeoReadWriteError


class Spike2RawIO(BaseRawIO):
"""
This implementation in neo reads only old smr files.
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/spikeglxrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
_event_channel_dtype,
)


class SpikeGLXRawIO(BaseRawIO):
"""
Class for reading data from a SpikeGLX system
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/tdtrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

from neo.core import NeoReadWriteError


class TdtRawIO(BaseRawIO):
extensions = ["tbk", "tdx", "tev", "tin", "tnt", "tsq", "sev", "txt"]
rawmode = "one-dir"
Expand Down
1 change: 0 additions & 1 deletion neo/rawio/winedrrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""


import numpy as np

from .baserawio import (
Expand Down
1 change: 1 addition & 0 deletions neo/rawio/winwcprawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
_common_sig_characteristics,
)


class WinWcpRawIO(BaseRawIO):
"""
Class for reading WinWCP data
Expand Down