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)
if ext is not None:
cache_name = cache_name + ext
else:
cache_name = cache_name
else:
cache_name = f"{cache_name}.{format}"

View File

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

View File

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

View File

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

View File

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