Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ ignore = [
"F401",

# TODO: Investigate and fix or configure
"PYI024",
"PYI048",
"PYI051", # Request for autofix: https://github.com/astral-sh/ruff/issues/14185
]
Expand Down
9 changes: 8 additions & 1 deletion stubs/matplotlib/dviread.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
from _typeshed import Incomplete
from collections import namedtuple
from functools import lru_cache
from typing import NamedTuple

from ._typing import *
from .path import Path

Page = ...
Box = ...

class Text(namedtuple("Text", "x y font glyph width")):
class Text(NamedTuple):
x: float
y: float
font: Incomplete
glyph: Incomplete
width: int
@property
def font_path(self) -> Path: ...
@property
Expand Down
15 changes: 7 additions & 8 deletions stubs/sklearn/gaussian_process/kernels.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import math
import warnings
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from collections.abc import Sequence
from inspect import signature as signature
from typing import Callable, Literal
from typing import Callable, Literal, NamedTuple
from typing_extensions import Self

import numpy as np
Expand All @@ -17,12 +16,12 @@ from ..base import clone as clone
from ..exceptions import ConvergenceWarning as ConvergenceWarning
from ..metrics.pairwise import pairwise_kernels as pairwise_kernels

class Hyperparameter(namedtuple("Hyperparameter", ("name", "value_type", "bounds", "n_elements", "fixed"))):
fixed: bool = ...
n_elements: int = ...
bounds: tuple[float, float] | str = ...
value_type: str = ...
name: str = ...
class Hyperparameter(NamedTuple):
fixed: bool
n_elements: int
bounds: tuple[float, float] | str
value_type: str
name: str

# A raw namedtuple is very memory efficient as it packs the attributes
# in a struct to get rid of the __dict__ of attributes in particular it
Expand Down
6 changes: 4 additions & 2 deletions stubs/sympy-stubs/testing/runtests.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from collections import namedtuple
from collections.abc import Generator
from contextlib import contextmanager
from doctest import DocTestFinder, DocTestRunner
from typing import Any, Literal
from typing import Any, Literal, NamedTuple

IS_WINDOWS = ...
ON_CI = ...
Expand Down Expand Up @@ -32,7 +32,9 @@ sp = ...

def split_list(l, split, density=...): ...

SymPyTestResults = namedtuple("SymPyTestResults", "failed attempted")
class SymPyTestResults(NamedTuple):
failed: int
attempted: int

def sympytestfile(
filename,
Expand Down