diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ba0acd8..48b75ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,20 +11,20 @@ repos: hooks: - id: prettier - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.6.1 hooks: - id: ruff args: [--fix, --show-fixes] - id: ruff-format - repo: https://github.com/pycqa/pylint - rev: v3.2.4 + rev: v3.2.6 hooks: - id: pylint files: ehist args: [--ignore=E401] additional_dependencies: [numpy, matplotlib] - repo: https://github.com/fsfe/reuse-tool - rev: v3.1.0a1 + rev: v4.0.3 hooks: - id: reuse - repo: https://github.com/codespell-project/codespell diff --git a/ehist/hist1d.py b/ehist/hist1d.py index 5336a11..bab76bb 100644 --- a/ehist/hist1d.py +++ b/ehist/hist1d.py @@ -265,6 +265,9 @@ def fit(self, func, p0=None, mask=None, method="points", **kwargs): ) elif method == "quad": fit = optimize.minimize(self._integrate, p0, args=(func, self.x.edges, self.N), **kwargs) + else: + msg = f"Unknown value for method: `{method}`" + raise ValueError(msg) return fit # y, yerr = self._get_hist("area") diff --git a/pyproject.toml b/pyproject.toml index f360a85..3c02b37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,15 +39,11 @@ test = ["pytest", "pytest-cov"] testpaths = ["tests"] addopts = ["--cov"] -[tool.black] -line-length = 108 -target-version = ["py38"] - [tool.pylint.messages_control] disable = "C0103,C0104,C0114,C0115,C0116,W0603,R0902,R0903,R0912,R0913,R0914,W0201,W0622" [tool.pylint.format] -max-line-length = "108" +max-line-length = "128" [tool.ruff] select = ["ALL"] @@ -61,7 +57,7 @@ ignore = [ "PLR0912", # Too many branches "ERA001", # Found commented-out code ] -line-length = 108 +line-length = 128 target-version = "py38" fixable = ["I"]