1
0
Fork 0

sonar lint fixes

This commit is contained in:
Sean Sube 2023-03-21 17:11:38 -05:00
parent a660d9f1b1
commit 4f6574c88e
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
5 changed files with 5 additions and 7 deletions

View File

@ -157,8 +157,6 @@ def fetch_model(
_filename, ext = path.splitext(ext) _filename, ext = path.splitext(ext)
if ext is not None: if ext is not None:
cache_name = cache_name + ext cache_name = cache_name + ext
else:
cache_name = cache_name
else: else:
cache_name = f"{cache_name}.{format}" cache_name = f"{cache_name}.{format}"

View File

@ -66,8 +66,8 @@ class OnnxNet:
def half(self): def half(self):
return self return self
def load_state_dict(self, net, strict=True) -> None: def load_state_dict(self, _net, strict=True) -> None:
pass pass
def to(self, device): def to(self, _device):
return self return self

View File

@ -27,7 +27,7 @@ def output(context: ServerContext, filename: str):
def register_static_routes( def register_static_routes(
app: Flask, context: ServerContext, pool: DevicePoolExecutor app: Flask, context: ServerContext, _pool: DevicePoolExecutor
): ):
return [ return [
app.route("/")(wrap_route(index, context)), app.route("/")(wrap_route(index, context)),

View File

@ -121,7 +121,7 @@ def merge(a, b, path=None):
elif a[key] == b[key]: elif a[key] == b[key]:
pass # same leaf value pass # same leaf value
else: else:
raise Exception("Conflict at %s" % ".".join(path + [str(key)])) raise ValueError("conflict at %s" % ".".join(path + [str(key)]))
else: else:
a[key] = b[key] a[key] = b[key]
return a return a

View File

@ -341,7 +341,7 @@ def main():
else: else:
logger.warning("test failed: %s", test.name) logger.warning("test failed: %s", test.name)
failed.append(test.name) failed.append(test.name)
except Exception as e: except Exception:
logger.exception("error running test for %s", test.name) logger.exception("error running test for %s", test.name)
failed.append(test.name) failed.append(test.name)