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

Ouranosinc / figanos / 18353693760

08 Oct 2025 06:01PM UTC coverage: 8.075% (-0.05%) from 8.122%
18353693760

push

github

web-flow
Update cookiecutter template, add CITATION.cff (#362)

### What kind of change does this PR introduce?

* Updates the cookiecutter to the latest version
* Removed `black`, `blackdoc`, and `isort`
* Added a `CITATION.cff` file
* `pyproject.toml` is now PEP-639 compliant 
* Contributor Covenant agreement updated to v3.0
* Some dependency updates

### Does this PR introduce a breaking change?

Yes. `black`, `blackdoc`, and `isort` have been dropped for `ruff`.

### Other information:

There may be some small adjustments to the code base. `ruff` is
configured to be very similar to `black`, but it is not 1-1 compliant
with it.

0 of 56 new or added lines in 4 files covered. (0.0%)

2 existing lines in 1 file now uncovered.

156 of 1932 relevant lines covered (8.07%)

0.4 hits per line

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

22.73
/src/figanos/_testing.py
1
from collections.abc import Callable
5✔
2
from functools import wraps
5✔
3
from typing import IO
5✔
4

5

6
__all__ = ["pitou"]
5✔
7

8

9
def pitou():
5✔
10
    """Return a Pooch instance for the figanos testing data."""
11
    from figanos import __version__ as __figanos_version__
×
12

13
    try:
×
14
        import pooch
×
NEW
15
    except ImportError as err:
×
16
        raise ImportError(
×
17
            "The 'pooch' package is required to fetch the figanos testing data. "
18
            "You can install it using 'pip install pooch' or 'pip install \"figanos[docs]\"'."
19
        ) from err
20

21
    _pitou = pooch.Pooch(
×
22
        path=pooch.os_cache("figanos"),
23
        base_url="https://raw.githubusercontent.com/Ouranosinc/figanos/main/src/figanos/data/test_data/",
24
        registry={
25
            "hatchmap-ens_stats.nc": "fc52d0551747fa0a7153f1ecfebf3e697993590c6c7c4c6a6f9f32700df9d32d",
26
            "hatchmap-inf_5.nc": "8f22522dc153d8d347bdf97bf85e49d08a5ecbc61c64372e713a0d25638e48ac",
27
            "hatchmap-sup_8.nc": "a409ebbd6ce3c0ca319f676cc21677ba500983b80ff65a64ef3d467008db824a",
28
        },
29
    )
30

31
    # Add a custom fetch method to the Pooch instance
32
    # Needed to address: https://github.com/readthedocs/readthedocs.org/issues/11763
33
    _pitou.fetch_diversion = _pitou.fetch
×
34

35
    # Overload the fetch method to add user-agent headers
36
    @wraps(_pitou.fetch_diversion)
×
37
    def _fetch(*args: str, **kwargs: bool | Callable) -> str:
×
38
        def _downloader(
×
39
            url: str,
40
            output_file: str | IO,
41
            poocher: pooch.Pooch,
42
            check_only: bool | None = False,
43
        ) -> None:
44
            """Download the file from the URL and save it to the save_path."""
45
            headers = {"User-Agent": f"figanos ({__figanos_version__})"}
×
46
            downloader = pooch.HTTPDownloader(headers=headers)
×
47
            return downloader(url, output_file, poocher, check_only=check_only)
×
48

49
        # default to our http/s downloader with user-agent headers
50
        kwargs.setdefault("downloader", _downloader)
×
51
        return _pitou.fetch_diversion(*args, **kwargs)
×
52

53
    # Replace the fetch method with the custom fetch method
54
    _pitou.fetch = _fetch
×
55

56
    return _pitou
×
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