• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bethgelab / foolbox / 8137716344

22 Jan 2024 10:53PM UTC coverage: 98.47%. Remained the same
8137716344

push

github

web-flow
Bump pillow from 10.1.0 to 10.2.0 in /tests (#718)

Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.1.0...10.2.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

3475 of 3529 relevant lines covered (98.47%)

7.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/foolbox/models/numpy.py
1
from typing import TypeVar, Callable, Optional
10✔
2
import eagerpy as ep
10✔
3

4
from ..types import Bounds
10✔
5
from ..types import BoundsInput
10✔
6

7
from .base import Model
10✔
8

9

10
T = TypeVar("T")
10✔
11

12

13
class NumPyModel(Model):
10✔
14
    def __init__(
10✔
15
        self, model: Callable, bounds: BoundsInput, data_format: Optional[str] = None
16
    ):
17
        self._model = model
10✔
18
        self._bounds = Bounds(*bounds)
10✔
19
        if data_format is not None:
10✔
20
            if data_format not in ["channels_first", "channels_last"]:
10✔
21
                raise ValueError(
10✔
22
                    f"expected data_format to be 'channels_first' or 'channels_last', got {data_format}"
23
                )
24
        self._data_format = data_format
10✔
25

26
    @property
10✔
27
    def bounds(self) -> Bounds:
10✔
28
        return self._bounds
10✔
29

30
    def __call__(self, inputs: T) -> T:
10✔
31
        x, restore_type = ep.astensor_(inputs)
2✔
32
        y = self._model(x.numpy())
2✔
33
        z = ep.from_numpy(x, y)
2✔
34
        return restore_type(z)
2✔
35

36
    @property
10✔
37
    def data_format(self) -> str:
10✔
38
        if self._data_format is None:
10✔
39
            raise AttributeError(  # AttributeError -> hasattr returns False
10✔
40
                "please specify data_format when initializing the NumPyModel"
41
            )
42
        return self._data_format
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc