mirror of
https://github.com/p2p-ld/nwb-linkml.git
synced 2024-11-10 00:34:29 +00:00
lint
This commit is contained in:
parent
6c07b87ba0
commit
0a93195726
5 changed files with 13 additions and 8 deletions
|
@ -5,8 +5,8 @@ Base class for adapters
|
||||||
import sys
|
import sys
|
||||||
from abc import abstractmethod
|
from abc import abstractmethod
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Any, Generator, List, Literal, Optional, Tuple, Type, TypeVar, Union, overload
|
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
|
from typing import Any, Generator, List, Literal, Optional, Tuple, Type, TypeVar, Union, overload
|
||||||
|
|
||||||
from linkml_runtime.dumpers import yaml_dumper
|
from linkml_runtime.dumpers import yaml_dumper
|
||||||
from linkml_runtime.linkml_model import (
|
from linkml_runtime.linkml_model import (
|
||||||
|
@ -104,6 +104,7 @@ class Adapter(BaseModel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def logger(self) -> Logger:
|
def logger(self) -> Logger:
|
||||||
|
"""A logger with the name of the adapter class! See :class:`.config`"""
|
||||||
if self._logger is None:
|
if self._logger is None:
|
||||||
self._logger = init_logger(self.__class__.__name__)
|
self._logger = init_logger(self.__class__.__name__)
|
||||||
return self._logger
|
return self._logger
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
Manage the operation of nwb_linkml from environmental variables
|
Manage the operation of nwb_linkml from environmental variables
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional, Literal
|
|
||||||
import tempfile
|
import tempfile
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import Literal, Optional
|
||||||
|
|
||||||
from pydantic import (
|
from pydantic import (
|
||||||
BaseModel,
|
BaseModel,
|
||||||
|
|
|
@ -577,6 +577,9 @@ class TimeSeriesReferenceVectorDataMixin(VectorDataMixin):
|
||||||
|
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def ensure_equal_length(self) -> "TimeSeriesReferenceVectorDataMixin":
|
def ensure_equal_length(self) -> "TimeSeriesReferenceVectorDataMixin":
|
||||||
|
"""
|
||||||
|
Each of the three indexing columns must be the same length to work!
|
||||||
|
"""
|
||||||
assert len(self.idx_start) == len(self.timeseries) == len(self.count), (
|
assert len(self.idx_start) == len(self.timeseries) == len(self.count), (
|
||||||
f"Columns have differing lengths: idx: {len(self.idx_start)}, count: {len(self.count)},"
|
f"Columns have differing lengths: idx: {len(self.idx_start)}, count: {len(self.count)},"
|
||||||
f" timeseries: {len(self.timeseries)}"
|
f" timeseries: {len(self.timeseries)}"
|
||||||
|
|
|
@ -4,22 +4,22 @@ import numpy as np
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from nwb_linkml.models import (
|
from nwb_linkml.models import (
|
||||||
ElectricalSeries,
|
|
||||||
ExtracellularEphysElectrodes,
|
|
||||||
Device,
|
Device,
|
||||||
ElectrodeGroup,
|
|
||||||
DynamicTableRegion,
|
DynamicTableRegion,
|
||||||
Units,
|
ElectricalSeries,
|
||||||
|
ElectrodeGroup,
|
||||||
|
ExtracellularEphysElectrodes,
|
||||||
IntracellularElectrode,
|
IntracellularElectrode,
|
||||||
IntracellularElectrodesTable,
|
IntracellularElectrodesTable,
|
||||||
|
IntracellularRecordingsTable,
|
||||||
IntracellularResponsesTable,
|
IntracellularResponsesTable,
|
||||||
IntracellularStimuliTable,
|
IntracellularStimuliTable,
|
||||||
IntracellularRecordingsTable,
|
TimeSeriesReferenceVectorData,
|
||||||
|
Units,
|
||||||
VoltageClampSeries,
|
VoltageClampSeries,
|
||||||
VoltageClampSeriesData,
|
VoltageClampSeriesData,
|
||||||
VoltageClampStimulusSeries,
|
VoltageClampStimulusSeries,
|
||||||
VoltageClampStimulusSeriesData,
|
VoltageClampStimulusSeriesData,
|
||||||
TimeSeriesReferenceVectorData,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ from nwb_linkml.models.pydantic.core.v2_7_0.namespace import (
|
||||||
VectorIndex,
|
VectorIndex,
|
||||||
VoltageClampStimulusSeries,
|
VoltageClampStimulusSeries,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .conftest import _ragged_array
|
from .conftest import _ragged_array
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue