Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#79)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](psf/black@22.10.0...22.12.0)
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](pre-commit/pre-commit-hooks@v4.3.0...v4.4.0)
- [github.com/PyCQA/isort: 5.10.1 → 5.11.4](PyCQA/isort@5.10.1...5.11.4)
- [github.com/asottile/pyupgrade: v3.2.0 → v3.3.1](asottile/pyupgrade@v3.2.0...v3.3.1)
- [github.com/pycqa/flake8: 5.0.4 → 6.0.0](PyCQA/flake8@5.0.4...6.0.0)
- [github.com/pre-commit/mirrors-mypy: v0.982 → v0.991](pre-commit/mirrors-mypy@v0.982...v0.991)

* fix: use abc

Signed-off-by: Henry Schreiner <[email protected]>

Signed-off-by: Henry Schreiner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and henryiii authored Jan 4, 2023
1 parent 1b3de1f commit 2698ef9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -19,25 +19,25 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort

- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
exclude: docs/conf.py
additional_dependencies: [flake8-bugbear, flake8-print]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v0.991
hooks:
- id: mypy
files: ^(src|tests)
Expand Down
5 changes: 4 additions & 1 deletion src/uhi/numpy_plottable.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
hist.
"""

import abc
import enum
from typing import TYPE_CHECKING, Any, Iterator, Optional, Sequence, Tuple, Union, cast

Expand Down Expand Up @@ -179,13 +180,14 @@ def _roottarray_asnumpy(
return arr


class ROOTAxis:
class ROOTAxis(abc.ABC):
def __init__(self, tAxis: Any) -> None:
self.tAx = tAxis

def __len__(self) -> int:
return self.tAx.GetNbins() # type: ignore[no-any-return]

@abc.abstractmethod
def __getitem__(self, index: int) -> Any:
pass

Expand All @@ -196,6 +198,7 @@ def __eq__(self, other: Any) -> bool:
aEdges == bEdges for aEdges, bEdges in zip(self, other)
)

@abc.abstractmethod
def __iter__(self) -> Union[Iterator[Tuple[float, float]], Iterator[str]]:
pass

Expand Down

0 comments on commit 2698ef9

Please sign in to comment.