Skip to content

Commit

Permalink
Slight linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Jan 17, 2024
1 parent fbdf4e3 commit baef625
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kraken/ketos/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _validate_merging(ctx, param, value):
try:
for m in value:
lexer = shlex.shlex(m, posix=True)
lexer.wordchars += '\/.+-()=^&;,.'
lexer.wordchars += r'\/.+-()=^&;,.'
tokens = list(lexer)
if len(tokens) != 3:
raise ValueError
Expand Down
6 changes: 3 additions & 3 deletions kraken/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from functools import partial
from rich.traceback import install
from typing import Dict, Union, List, cast, Any, IO, Callable
from typing import Dict, cast, Any, IO, Callable

import click

Expand Down Expand Up @@ -544,14 +544,14 @@ def _validate_mm(ctx, param, value):
model_dict = {'ignore': []} # type: Dict[str, Union[str, List[str]]]
if len(value) == 1:
lexer = shlex.shlex(value[0], posix=True)
lexer.wordchars += '\/.+-()=^&;,.'
lexer.wordchars += r'\/.+-()=^&;,.'
if len(list(lexer)) == 1:
model_dict['default'] = value[0]
return model_dict
try:
for m in value:
lexer = shlex.shlex(m, posix=True)
lexer.wordchars += '\/.+-()=^&;,.'
lexer.wordchars += r'\/.+-()=^&;,.'
tokens = list(lexer)
if len(tokens) != 3:
raise ValueError
Expand Down
2 changes: 1 addition & 1 deletion kraken/lib/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def forward(self, *inputs, output_shape: Optional[Tuple[int, int]] = None):
modules = self._modules.values()
i = 0
for module in modules:
if type(inputs) == tuple:
if isinstance(inputs, tuple):
inputs = module(*inputs, output_shape=output_shape if i == len(modules) - 1 else None)
else:
inputs = module(inputs, output_shape=output_shape if i == len(modules) - 1 else None)
Expand Down
1 change: 0 additions & 1 deletion kraken/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from kraken.lib.exceptions import KrakenInputException
from kraken.lib.util import get_im_str

from typing import List
from jinja2 import Environment, PackageLoader
from io import BytesIO

Expand Down

0 comments on commit baef625

Please sign in to comment.