Skip to content

Commit

Permalink
fix linting fails
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinshome committed Sep 6, 2023
1 parent bc493f6 commit a3f6e0b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/imagereader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import collections
from typing import Tuple

import numpy as np

from PIL import Image, PyAccess
from pinterpret import PietRuntime
from piet import PietCommand, Color
from PIL import Image


class Reader:
Expand All @@ -31,10 +29,12 @@ def color_block_size(self, pos: tuple[int, int]):
directions = [[1, 0], [-1, 0], [0, 1], [0, -1]]
for dr, dc in directions:
r, c = row + dr, col + dc
if (r in range(rows) and
c in range(cols) and
np.array_equal(im_array[r, c], pixel) and
(r, c) not in visited):
if (
r in range(rows)
and c in range(cols)
and np.array_equal(im_array[r, c], pixel)
and (r, c) not in visited
):
q.append((r, c))
visited.add((r, c))
size += 1
Expand Down Expand Up @@ -81,9 +81,9 @@ def smallest_codel(self) -> int:

return smallest

def image_size(self) -> (int, int):
def image_size(self) -> Tuple[int, int]:
"returns size of image after scaling it down to a codel size of 1 pixel"
im = self.im_rgb
width, height = im.size
codel_size = self.smallest_codel()
return (width // codel_size, height // codel_size)
return (width // codel_size, height // codel_size)

0 comments on commit a3f6e0b

Please sign in to comment.