Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiMoraru123 committed Aug 4, 2023
1 parent 618dda7 commit 6c4ca8e
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 27 deletions.
8 changes: 4 additions & 4 deletions architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

# third-party imports
import tensorflow as tf
from tensorflow.keras import Model # type: ignore
from tensorflow.keras.losses import Loss # type: ignore
from tensorflow.keras.optimizers import Optimizer # type: ignore
from PIL import Image # type: ignore
from tensorflow.keras import Model
from tensorflow.keras.losses import Loss
from tensorflow.keras.optimizers import Optimizer
from PIL import Image

# module imports
from transforms import ImageTransform
Expand Down
2 changes: 1 addition & 1 deletion create_data_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List

# third-party imports
from PIL import Image # type: ignore
from PIL import Image


def create_data_lists(
Expand Down
6 changes: 3 additions & 3 deletions evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

# third-party imports
import tensorflow as tf
from tensorflow.keras import Model # type: ignore
from tensorflow.keras.metrics import Mean # type: ignore
from PIL import Image, ImageDraw, ImageFont # type: ignore
from tensorflow.keras import Model
from tensorflow.keras.metrics import Mean
from PIL import Image, ImageDraw, ImageFont
from skimage.metrics import peak_signal_noise_ratio, structural_similarity

# module imports
Expand Down
6 changes: 3 additions & 3 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from typing import List, Optional

# third-party imports
import tensorflow as tf # type: ignore
from tensorflow.keras import layers, Model # type: ignore
from tensorflow.keras.applications import VGG19 # type: ignore
import tensorflow as tf
from tensorflow.keras import layers, Model
from tensorflow.keras.applications import VGG19


class ConvolutionalBlock(layers.Layer):
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion resolve.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# third-party imports
import tensorflow as tf # type: ignore
import tensorflow as tf
from pprint import PrettyPrinter

# module imports
Expand Down
4 changes: 2 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os

# third-party imports
import pytest # type: ignore
import tensorflow as tf # type: ignore
import pytest
import tensorflow as tf


@pytest.fixture(params=["CPU", "GPU"], autouse=True)
Expand Down
6 changes: 3 additions & 3 deletions test/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from unittest.mock import patch, MagicMock

# third party imports
import pytest # type: ignore
import tensorflow as tf # type: ignore
from PIL import Image # type: ignore
import pytest
import tensorflow as tf
from PIL import Image

# module imports
from trainer import Trainer
Expand Down
4 changes: 2 additions & 2 deletions test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import unittest.mock as mock

# third-party imports
import pytest # type: ignore
import tensorflow as tf # type: ignore
import pytest
import tensorflow as tf

# module imports
from model import (
Expand Down
6 changes: 3 additions & 3 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# third-party imports
import pytest # type: ignore
import pytest
import numpy as np
import tensorflow as tf # type: ignore
from PIL import Image # type: ignore
import tensorflow as tf
from PIL import Image

# module imports
from transforms import ImageTransform
Expand Down
6 changes: 3 additions & 3 deletions trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import logging

# third-party imports
import tensorflow as tf # type: ignore
from colorama import Fore, init # type: ignore
from PIL import Image # type: ignore
import tensorflow as tf
from colorama import Fore, init
from PIL import Image

# module imports
from transforms import ImageTransform
Expand Down
4 changes: 2 additions & 2 deletions transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# third-party imports
import numpy as np
import tensorflow as tf # type: ignore
from PIL import Image # type: ignore
import tensorflow as tf
from PIL import Image


class ImageTransform(object):
Expand Down

0 comments on commit 6c4ca8e

Please sign in to comment.