Skip to content

Commit

Permalink
Merge pull request #3 from kjmeagher/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
autoupdate pre-commit hooks
  • Loading branch information
kjmeagher authored Aug 20, 2024
2 parents d02a427 + 5707487 commit 5093d15
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
13 changes: 3 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,17 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.6.1
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/pycqa/pylint
rev: v3.1.0
hooks:
- id: pylint
files: ehist
args: [--ignore=E401]
additional_dependencies: [numpy, matplotlib]
- repo: https://github.com/fsfe/reuse-tool
rev: v3.0.1
rev: v4.0.3
hooks:
- id: reuse
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
Expand Down
1 change: 0 additions & 1 deletion ehist/bayesian_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# SPDX-License-Identifier: BSD-2-Clause

# pylint: skip-file
# Licensed under a 3-clause BSD style license - see LICENSE.rst

"""Bayesian Blocks for Time Series Analysis
Expand Down
7 changes: 5 additions & 2 deletions ehist/hist1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import numpy as np
import pylab as plt
from scipy import integrate, optimize # pylint: disable=import-error
from scipy.stats import poisson # pylint: disable=import-error
from scipy import integrate, optimize
from scipy.stats import poisson

from .axis import IntAxis, LogIntAxis, auto_axis
from .util import HorizontalPlot, VerticalPlot, handle_weights
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion examples/plot_ehist.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import numpy as np
import pylab as plt
from scipy import stats # pylint: disable=import-error
from scipy import stats

from ehist import Hist1D as h1

Expand Down
17 changes: 4 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,11 @@ test = ["pytest", "pytest-cov"]
testpaths = ["tests"]
addopts = ["--cov"]

[tool.black]
[tool.ruff]
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"
target-version = "py38"

[tool.ruff]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D", # pydocstyle
Expand All @@ -61,12 +55,9 @@ ignore = [
"PLR0912", # Too many branches
"ERA001", # Found commented-out code
]
line-length = 108
target-version = "py38"
fixable = ["I"]


[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"ehist/bayesian_blocks.py" = [
"N","A","RET","EM","TRY","PLR","ISC","B","FBT"
]
Expand Down

0 comments on commit 5093d15

Please sign in to comment.