Skip to content

Commit 89015aa

Browse files
committed
small fixes
1 parent b908ef3 commit 89015aa

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.flake8

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
select = C,E,F,W
33
max-complexity = 10
44
max-line-length = 120
5-
6-
application-import-names = model_constructor
7-
import-order-style = google
5+
disable-noqa = True
6+
application-import-names = model_constructor, tests
7+
import-order-style = google
8+
per-file-ignores =
9+
# imported but unused
10+
__init__.py: F401

src/model_constructor/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .convmixer import ConvMixer # noqa F401
2-
from .model_constructor import ModelConstructor, ModelCfg # noqa F401
3-
from .version import __version__ # noqa F401
1+
from .convmixer import ConvMixer
2+
from .model_constructor import ModelConstructor, ModelCfg
3+
from .version import __version__

src/model_constructor/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def nn_seq(list_of_tuples: Iterable[tuple[str, nn.Module]]) -> nn.Sequential:
1313
"""return nn.Sequential from OrderedDict from list of tuples"""
14-
return nn.Sequential(OrderedDict(list_of_tuples)) #
14+
return nn.Sequential(OrderedDict(list_of_tuples))
1515

1616

1717
def init_cnn(module: nn.Module) -> None:
@@ -53,7 +53,7 @@ def __repr_changed_args__(self) -> list[str]:
5353
"""Return list repr for changed fields"""
5454
return [
5555
f"{field}: {self._get_str_value(field)}"
56-
for field in self.model_fields_set
56+
for field in self.model_fields_set # pylint: disable=E1133
5757
if field != "name"
5858
]
5959

src/model_constructor/model_constructor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def create_model(
190190
) -> nn.Sequential:
191191
if cfg:
192192
return cls(**cfg.model_dump())()
193-
return cls(**kwargs)()
193+
return cls(**kwargs)() # type: ignore
194194

195195
def __call__(self) -> nn.Sequential:
196196
"""Create model."""

tests/test_mc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import torch
44

55
from model_constructor.blocks import BottleneckBlock
6-
from model_constructor.layers import (SEModule, SEModuleConv,
7-
SimpleSelfAttention)
6+
from model_constructor.layers import SEModule, SEModuleConv, SimpleSelfAttention
87
from model_constructor.model_constructor import ModelConstructor
98

109
bs_test = 4

0 commit comments

Comments
 (0)