Skip to content
5 changes: 2 additions & 3 deletions numcodecs/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
"""

from abc import ABC, abstractmethod
from typing import Optional
from typing import ClassVar


class Codec(ABC):
"""Codec abstract base class."""

# override in sub-class
codec_id: Optional[str] = None
codec_id: ClassVar[str]
"""Codec identifier."""

@abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion numcodecs/tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ def test_all_classes_registered():
if (
inspect.isclass(obj)
and issubclass(obj, numcodecs.abc.Codec)
and hasattr(obj, 'codec_id')
and obj.codec_id not in numcodecs.registry.codec_registry
and obj.codec_id is not None # remove `None`
)
}

Expand Down
Loading