Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 8, 2024
1 parent 84368f3 commit afe80a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions zfit_interface/old/data.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from __future__ import annotations

from abc import abstractmethod
from typing import Optional

import numpy as np


class ZfitData:
@abstractmethod
def value(self, obs: Optional[list[str]] = None) -> np.typ:
def value(self, obs: list[str] | None = None) -> np.typ:
raise NotImplementedError

@abstractmethod
Expand Down
4 changes: 2 additions & 2 deletions zfit_interface/old/minimizer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Iterable
from typing import Optional, Protocol
from typing import Protocol

from zfit_interface.old.loss import ZfitMinimalLoss
from zfit_interface.old.param import ZfitParameter
Expand All @@ -11,5 +11,5 @@
class ZfitMinimizer(Protocol):
"""Define the minimizer interface."""

def minimize(self, loss: ZfitMinimalLoss, params: Optional[Iterable[ZfitParameter]] = None) -> ZfitMinimalResult:
def minimize(self, loss: ZfitMinimalLoss, params: Iterable[ZfitParameter] | None = None) -> ZfitMinimalResult:
raise NotImplementedError
4 changes: 2 additions & 2 deletions zfit_interface/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __iter__(self) -> typing.Iterator[T]:
class PlottableTraits:
__slots__ = ["_circular", "_discrete"]

def __init__(self, circular: typing.Optional[bool] = None, discrete: typing.Optional[bool] = None):
def __init__(self, circular: bool | None = None, discrete: bool | None = None):
self._circular = False if circular is None else circular
self._discrete = False if discrete is None else discrete

Expand Down Expand Up @@ -83,7 +83,7 @@ def traits(self) -> PlottableTraits:


class BaseVar(ZfitVar):
def __init__(self, name: str, binning: ZfitBinning = None, label: typing.Optional[str] = None):
def __init__(self, name: str, binning: ZfitBinning = None, label: str | None = None):
self._name = name
self._label = label
self._binning = self._check_input_init_binning(binning)
Expand Down

0 comments on commit afe80a8

Please sign in to comment.