This commit is contained in:
sneakers-the-rat 2024-08-12 22:59:15 -07:00
parent 6c07b87ba0
commit 0a93195726
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
5 changed files with 13 additions and 8 deletions

View file

@ -5,8 +5,8 @@ Base class for adapters
import sys
from abc import abstractmethod
from dataclasses import dataclass, field
from typing import Any, Generator, List, Literal, Optional, Tuple, Type, TypeVar, Union, overload
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.linkml_model import (
@ -104,6 +104,7 @@ class Adapter(BaseModel):
@property
def logger(self) -> Logger:
"""A logger with the name of the adapter class! See :class:`.config`"""
if self._logger is None:
self._logger = init_logger(self.__class__.__name__)
return self._logger

View file

@ -2,9 +2,9 @@
Manage the operation of nwb_linkml from environmental variables
"""
from typing import Optional, Literal
import tempfile
from pathlib import Path
from typing import Literal, Optional
from pydantic import (
BaseModel,

View file

@ -577,6 +577,9 @@ class TimeSeriesReferenceVectorDataMixin(VectorDataMixin):
@model_validator(mode="after")
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), (
f"Columns have differing lengths: idx: {len(self.idx_start)}, count: {len(self.count)},"
f" timeseries: {len(self.timeseries)}"

View file

@ -4,22 +4,22 @@ import numpy as np
import pytest
from nwb_linkml.models import (
ElectricalSeries,
ExtracellularEphysElectrodes,
Device,
ElectrodeGroup,
DynamicTableRegion,
Units,
ElectricalSeries,
ElectrodeGroup,
ExtracellularEphysElectrodes,
IntracellularElectrode,
IntracellularElectrodesTable,
IntracellularRecordingsTable,
IntracellularResponsesTable,
IntracellularStimuliTable,
IntracellularRecordingsTable,
TimeSeriesReferenceVectorData,
Units,
VoltageClampSeries,
VoltageClampSeriesData,
VoltageClampStimulusSeries,
VoltageClampStimulusSeriesData,
TimeSeriesReferenceVectorData,
)

View file

@ -9,6 +9,7 @@ from nwb_linkml.models.pydantic.core.v2_7_0.namespace import (
VectorIndex,
VoltageClampStimulusSeries,
)
from .conftest import _ragged_array