Skip to content

Commit

Permalink
Merge pull request #397 from dyson-ai/feature/enable_linting
Browse files Browse the repository at this point in the history
Feature/enable linting
  • Loading branch information
blooop committed Jun 4, 2024
2 parents d3fdf5e + 61bceaf commit 7c5817e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
5 changes: 3 additions & 2 deletions bencher/optuna_conversions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import List
import logging

import optuna
import panel as pn
Expand Down Expand Up @@ -158,8 +159,8 @@ def summarise_optuna_study(study: optuna.study.Study) -> pn.pane.panel:
row.append(plot_param_importances(study))
try:
row.append(plot_pareto_front(study))
except Exception:
pass
except Exception as e: # pylint: disable=broad-except
logging.exception(e)

row.append(
pn.pane.Markdown(f"```\nBest value: {study.best_value}\nParams: {study.best_params}```")
Expand Down
2 changes: 1 addition & 1 deletion bencher/results/holoview_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def to_surface_ds(
try:
surface = hvds.to(hv.Surface, vdims=[result_var.name])
surface = surface.opts(colorbar=True)
except Exception as e:
except Exception as e: # pylint: disable=broad-except
logging.warning(e)

if self.bench_cfg.repeats > 1:
Expand Down
4 changes: 2 additions & 2 deletions pixi.lock
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ packages:
requires_python: '>=3.7'
- kind: pypi
name: holobench
version: 1.22.2
version: 1.23.0
path: .
sha256: d2904007a9662d513bad1174f7a6a341f61a0306e6b7997f1f3233028f5ee6ea
sha256: 76ce5d13f28e35b37db41f02f45ee8dce425e1ab53b7bc2bc4a97322d908309a
requires_dist:
- holoviews>=1.15,<=1.18.3
- numpy>=1.0,<=1.26.4
Expand Down
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "holobench"
version = "1.22.2"
version = "1.23.0"

authors = [{ name = "Austin Gregg-Smith", email = "blooop@gmail.com" }]
description = "A package for benchmarking the performance of arbitrary functions"
Expand Down Expand Up @@ -74,7 +74,7 @@ check-clean-workspace = "git diff --exit-code"
ruff-lint = "ruff check . --fix"
pylint = "pylint --version && echo 'running pylint...' && pylint $(git ls-files '*.py')"
lint = { depends_on = ["ruff-lint", "pylint"] }
style = { depends_on = ["format","lint"]}
style = { depends_on = ["format", "lint"] }
commit-format = "git commit -a -m'autoformat code'"
test = "pytest"
coverage = "coverage run -m pytest && coverage xml -o coverage.xml"
Expand All @@ -83,8 +83,15 @@ update-lock = "pixi update && git commit -a -m'update pixi.lock'"
push = "git push"
update-lock-push = { depends_on = ["update-lock", "push"] }
ci-no-cover = { depends_on = ["style", "test"] }
ci = { depends_on = ["format","ruff-lint","check-clean-workspace","pylint", "coverage", "coverage-report"] }
ci-push = {depends_on=["format","ruff-lint","update-lock","ci","push"]}
ci = { depends_on = [
"format",
"ruff-lint",
"check-clean-workspace",
"pylint",
"coverage",
"coverage-report",
] }
ci-push = { depends_on = ["format", "ruff-lint", "update-lock", "ci", "push"] }
clear-pixi = "rm -rf .pixi pixi.lock"


Expand All @@ -96,7 +103,7 @@ extension-pkg-whitelist = ["numpy", "scipy"]
jobs = 16 #detect number of cores

[tool.pylint.'MESSAGES CONTROL']
disable = "C,logging-fstring-interpolation,line-too-long,fixme,broad-exception-caught,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,duplicate-code,too-many-public-methods,too-many-nested-blocks"
disable = "C,logging-fstring-interpolation,line-too-long,fixme,missing-module-docstring,too-many-instance-attributes,too-few-public-methods,too-many-arguments,too-many-locals,too-many-branches,too-many-statements,use-dict-literal,duplicate-code,too-many-public-methods,too-many-nested-blocks"
enable = "no-else-return,consider-using-in"

[tool.black]
Expand Down

0 comments on commit 7c5817e

Please sign in to comment.