Fix a mypy error with matricizer.py
Self type is not allowed to access static members, in this case DIMENSIONS Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"All things that turn a hash into a matrix."
|
"All things that turn a hash into a matrix."
|
||||||
import abc
|
import abc
|
||||||
from typing import Mapping, Sequence, Self
|
from typing import Mapping, Sequence
|
||||||
|
|
||||||
from .palettes import Palette, DEFAULT_PALETTES, GRADIENT_PALETTES, MULTICOLOR_PALETTES
|
from .palettes import Palette, DEFAULT_PALETTES, GRADIENT_PALETTES, MULTICOLOR_PALETTES
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ class NibbleMatricizer(Matricizer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def choose_dimensions(hash: str) -> tuple[int, int]:
|
def choose_dimensions(hash: str) -> tuple[int, int]:
|
||||||
return Self.DIMENSIONS[hash]
|
return NibbleMatricizer.DIMENSIONS[hash]
|
||||||
|
|
||||||
def choose_palette(
|
def choose_palette(
|
||||||
self, data: bytes, palettes: Mapping[str, Palette] | None = None
|
self, data: bytes, palettes: Mapping[str, Palette] | None = None
|
||||||
@@ -173,7 +173,7 @@ class RandomartMatricizer(Matricizer):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def choose_dimensions(hash: str) -> tuple[int, int]:
|
def choose_dimensions(hash: str) -> tuple[int, int]:
|
||||||
return self.DIMENSIONS[hash]
|
return RandomartMatricizer.DIMENSIONS[hash]
|
||||||
|
|
||||||
def choose_palette(
|
def choose_palette(
|
||||||
self, data: bytes, palettes: Mapping[str, Palette] | None = None
|
self, data: bytes, palettes: Mapping[str, Palette] | None = None
|
||||||
|
|||||||
Reference in New Issue
Block a user