diff --git a/pyproject.toml b/pyproject.toml index ee31c43b..403063a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ tests = [ # Needed for stubtest and downloads their dependencies to get known import symbols "networkx", "scikit-image", - "scikit-learn", + "scikit-learn <1.7.0", # TODO: Update stubs for sklearn "sympy", "vispy", ] diff --git a/stubs/networkx/algorithms/approximation/dominating_set.pyi b/stubs/networkx/algorithms/approximation/dominating_set.pyi index 76731cc2..014f9d12 100644 --- a/stubs/networkx/algorithms/approximation/dominating_set.pyi +++ b/stubs/networkx/algorithms/approximation/dominating_set.pyi @@ -1,10 +1,6 @@ from ...classes.graph import Graph -from ...utils import not_implemented_for -from ..matching import maximal_matching __all__ = ["min_weighted_dominating_set", "min_edge_dominating_set"] -# TODO Why doesn't this algorithm work for directed graphs? - def min_weighted_dominating_set(G: Graph, weight: str | None = None) -> set: ... def min_edge_dominating_set(G: Graph) -> set: ... diff --git a/stubs/networkx/algorithms/clique.pyi b/stubs/networkx/algorithms/clique.pyi index ccd4465c..473c4109 100644 --- a/stubs/networkx/algorithms/clique.pyi +++ b/stubs/networkx/algorithms/clique.pyi @@ -1,10 +1,6 @@ -from collections import defaultdict, deque -from itertools import chain, combinations, islice - from numpy.typing import ArrayLike from ..classes.graph import Graph -from ..utils import not_implemented_for __all__ = [ "find_cliques", @@ -22,8 +18,6 @@ __all__ = [ def enumerate_all_cliques(G: Graph): ... def find_cliques(G: Graph, nodes=None): ... - -# TODO Should this also be not implemented for directed graphs? def find_cliques_recursive(G: Graph, nodes=None): ... def make_max_clique_graph(G: Graph, create_using=None): ... def make_clique_bipartite(G: Graph, fpos: bool | None = None, create_using=None, name=None): ... diff --git a/stubs/networkx/algorithms/cuts.pyi b/stubs/networkx/algorithms/cuts.pyi index 35eca7f1..7e4951a4 100644 --- a/stubs/networkx/algorithms/cuts.pyi +++ b/stubs/networkx/algorithms/cuts.pyi @@ -1,4 +1,3 @@ -from itertools import chain from typing import Any from ..classes.graph import Graph @@ -14,19 +13,11 @@ __all__ = [ "volume", ] -# TODO STILL NEED TO UPDATE ALL THE DOCUMENTATION! - def cut_size(G: Graph, S, T=None, weight: Any = None): ... def volume(G: Graph, S, weight: Any = None): ... def normalized_cut_size(G: Graph, S, T=None, weight: Any = None): ... def conductance(G: Graph, S, T=None, weight: Any = None): ... def edge_expansion(G: Graph, S, T=None, weight: Any = None): ... def mixing_expansion(G: Graph, S, T=None, weight: Any = None): ... - -# TODO What is the generalization to two arguments, S and T? Does the -# denominator become `min(len(S), len(T))`? def node_expansion(G: Graph, S): ... - -# TODO What is the generalization to two arguments, S and T? Does the -# denominator become `min(len(S), len(T))`? def boundary_expansion(G: Graph, S): ... diff --git a/stubs/networkx/algorithms/distance_regular.pyi b/stubs/networkx/algorithms/distance_regular.pyi index 20399098..6e0d25c0 100644 --- a/stubs/networkx/algorithms/distance_regular.pyi +++ b/stubs/networkx/algorithms/distance_regular.pyi @@ -3,8 +3,6 @@ from collections.abc import Iterable from numpy.typing import ArrayLike from ..classes.graph import Graph -from ..utils import not_implemented_for -from .distance_measures import diameter __all__ = [ "is_distance_regular", @@ -16,7 +14,4 @@ __all__ = [ def is_distance_regular(G: Graph) -> bool: ... def global_parameters(b: ArrayLike, c: ArrayLike) -> Iterable: ... def intersection_array(G: Graph): ... - -# TODO There is a definition for directed strongly regular graphs. - def is_strongly_regular(G: Graph) -> bool: ... diff --git a/stubs/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/algorithms/tree/branchings.pyi index a6b6470e..b11a5712 100644 --- a/stubs/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/algorithms/tree/branchings.pyi @@ -1,27 +1,3 @@ -# TODO: Implement method from Gabow, Galil, Spence and Tarjan: -# -# @article{ -# year={1986}, -# issn={0209-9683}, -# journal={Combinatorica}, -# volume={6}, -# number={2}, -# doi={10.1007/BF02579168}, -# title={Efficient algorithms for finding minimum spanning trees in -# undirected and directed graphs}, -# url={https://doi.org/10.1007/BF02579168}, -# publisher={Springer-Verlag}, -# keywords={68 B 15; 68 C 05}, -# author={Gabow, Harold N. and Galil, Zvi and Spencer, Thomas and Tarjan, -# Robert E.}, -# pages={109-122}, -# language={English} -# } -import string -from dataclasses import dataclass, field -from enum import Enum -from operator import itemgetter -from queue import PriorityQueue from typing import Literal from ...classes.digraph import DiGraph diff --git a/stubs/networkx/classes/coreviews.pyi b/stubs/networkx/classes/coreviews.pyi index f66e9e4e..9bc00ce1 100644 --- a/stubs/networkx/classes/coreviews.pyi +++ b/stubs/networkx/classes/coreviews.pyi @@ -82,9 +82,6 @@ class FilterAtlas(Mapping): # nodedict, nbrdict, keydict def __len__(self): ... def __iter__(self): ... def __getitem__(self, key): ... - - # FIXME should this just be removed? we don't use it, but someone might - def copy(self): ... def __str__(self): ... def __repr__(self): ... @@ -93,9 +90,6 @@ class FilterAdjacency(Mapping): # edgedict def __len__(self): ... def __iter__(self): ... def __getitem__(self, node): ... - - # FIXME should this just be removed? we don't use it, but someone might - def copy(self): ... def __str__(self): ... def __repr__(self): ... @@ -103,11 +97,5 @@ class FilterMultiInner(FilterAdjacency): # muliedge_seconddict def __iter__(self): ... def __getitem__(self, nbr): ... - # FIXME should this just be removed? we don't use it, but someone might - def copy(self): ... - class FilterMultiAdjacency(FilterAdjacency): # multiedgedict def __getitem__(self, node): ... - - # FIXME should this just be removed? we don't use it, but someone might - def copy(self): ... diff --git a/stubs/networkx/conftest.pyi b/stubs/networkx/conftest.pyi index 64a39a66..2f6b8d35 100644 --- a/stubs/networkx/conftest.pyi +++ b/stubs/networkx/conftest.pyi @@ -1,14 +1,8 @@ -import sys -import warnings - -import networkx import pytest def pytest_addoption(parser): ... def pytest_configure(config): ... def pytest_collection_modifyitems(config, items): ... - -# TODO: The warnings below need to be dealt with, but for now we silence them. @pytest.fixture(autouse=True) def set_warnings(): ... @pytest.fixture(autouse=True) diff --git a/stubs/sklearn/cluster/_agglomerative.pyi b/stubs/sklearn/cluster/_agglomerative.pyi index c74bb260..36840109 100644 --- a/stubs/sklearn/cluster/_agglomerative.pyi +++ b/stubs/sklearn/cluster/_agglomerative.pyi @@ -49,8 +49,7 @@ class AgglomerativeClustering(ClusterMixin, BaseEstimator): self, n_clusters: None | int = 2, *, - affinity: str | Callable = "deprecated", # TODO(1.4): Remove - metric: None | str | Callable = None, # TODO(1.4): Set to "euclidean" + metric: str | Callable = "euclidean", memory: None | Memory | str = None, connectivity: None | ArrayLike | Callable = None, compute_full_tree: Literal["auto"] | bool = "auto", @@ -77,8 +76,7 @@ class FeatureAgglomeration(ClassNamePrefixFeaturesOutMixin, AgglomerativeCluster self, n_clusters: None | int = 2, *, - affinity: str | Callable = "deprecated", # TODO(1.4): Remove - metric: None | str | Callable = None, # TODO(1.4): Set to "euclidean" + metric: str | Callable = "euclidean", memory: None | Memory | str = None, connectivity: None | ArrayLike | Callable = None, compute_full_tree: Literal["auto"] | bool = "auto", diff --git a/stubs/sklearn/covariance/_robust_covariance.pyi b/stubs/sklearn/covariance/_robust_covariance.pyi index 98974510..53d5289d 100644 --- a/stubs/sklearn/covariance/_robust_covariance.pyi +++ b/stubs/sklearn/covariance/_robust_covariance.pyi @@ -7,17 +7,6 @@ from numpy.random import RandomState from .._typing import Float, Int, MatrixLike from . import EmpiricalCovariance -# Author: Virgile Fritsch -# -# License: BSD 3 clause - -# Minimum Covariance Determinant -# Implementing of an algorithm by Rousseeuw & Van Driessen described in -# (A Fast Algorithm for the Minimum Covariance Determinant Estimator, -# 1999, American Statistical Association and the American Society -# for Quality, TECHNOMETRICS) -# XXX Is this really a public function? It's not listed in the docs or -# exported by sklearn.covariance. Deprecate? def c_step( X: MatrixLike, n_support: Int, diff --git a/stubs/sklearn/datasets/_samples_generator.pyi b/stubs/sklearn/datasets/_samples_generator.pyi index 35b4df9a..6b06b92d 100644 --- a/stubs/sklearn/datasets/_samples_generator.pyi +++ b/stubs/sklearn/datasets/_samples_generator.pyi @@ -110,9 +110,6 @@ def make_low_rank_matrix( tail_strength: Float = 0.5, random_state: RandomState | None | Int = None, ) -> ndarray: ... - -# TODO(1.3): Change argument `data_transposed` default from True to False. -# TODO(1.3): Deprecate data_transposed, always return data not transposed. def make_sparse_coded_signal( n_samples: Int, *, diff --git a/stubs/sklearn/ensemble/_gb.pyi b/stubs/sklearn/ensemble/_gb.pyi index 7cc9b113..cbb55c2a 100644 --- a/stubs/sklearn/ensemble/_gb.pyi +++ b/stubs/sklearn/ensemble/_gb.pyi @@ -70,7 +70,6 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting): feature_importances_: ndarray = ... n_estimators_: int = ... - # TODO(1.3): remove "deviance" _parameter_constraints: ClassVar[dict] = ... def __init__( diff --git a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi index 29e4736d..0b45cdcc 100644 --- a/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi +++ b/stubs/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.pyi @@ -96,7 +96,6 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting): do_early_stopping_: bool = ... classes_: ndarray = ... - # TODO(1.3): Remove "binary_crossentropy", "categorical_crossentropy", "auto" _parameter_constraints: ClassVar[dict] = ... def __init__( diff --git a/stubs/sklearn/feature_selection/_univariate_selection.pyi b/stubs/sklearn/feature_selection/_univariate_selection.pyi index fec2ff79..9fe322c8 100644 --- a/stubs/sklearn/feature_selection/_univariate_selection.pyi +++ b/stubs/sklearn/feature_selection/_univariate_selection.pyi @@ -92,8 +92,6 @@ class SelectFwe(_BaseFilter): # Generic filter ###################################################################### -# TODO this class should fit on either p-values or scores, -# depending on the mode. class GenericUnivariateSelect(_BaseFilter): feature_names_in_: ndarray = ... n_features_in_: int = ... diff --git a/stubs/sklearn/linear_model/_stochastic_gradient.pyi b/stubs/sklearn/linear_model/_stochastic_gradient.pyi index a9344812..57658a9d 100644 --- a/stubs/sklearn/linear_model/_stochastic_gradient.pyi +++ b/stubs/sklearn/linear_model/_stochastic_gradient.pyi @@ -86,7 +86,6 @@ def fit_binary( ) -> tuple[ndarray, float, int]: ... class BaseSGDClassifier(LinearClassifierMixin, BaseSGD, metaclass=ABCMeta): - # TODO(1.3): Remove "log"" loss_functions: ClassVar[dict] = ... _parameter_constraints: ClassVar[dict] = ... diff --git a/stubs/sklearn/metrics/_scorer.pyi b/stubs/sklearn/metrics/_scorer.pyi index 0f2aa127..e10fe400 100644 --- a/stubs/sklearn/metrics/_scorer.pyi +++ b/stubs/sklearn/metrics/_scorer.pyi @@ -90,10 +90,6 @@ adjusted_mutual_info_scorer = ... normalized_mutual_info_scorer = ... fowlkes_mallows_scorer = ... -# TODO(1.3) Remove -class _DeprecatedScorers(dict): - def __getitem__(self, item): ... - _SCORERS = ... def get_scorer_names() -> list[str] | ndarray: ... diff --git a/stubs/sklearn/neighbors/__init__.pyi b/stubs/sklearn/neighbors/__init__.pyi index 9165de40..2aedbc85 100644 --- a/stubs/sklearn/neighbors/__init__.pyi +++ b/stubs/sklearn/neighbors/__init__.pyi @@ -5,7 +5,6 @@ from ._base import ( sort_graph_by_row_values as sort_graph_by_row_values, ) from ._classification import KNeighborsClassifier as KNeighborsClassifier, RadiusNeighborsClassifier as RadiusNeighborsClassifier -from ._distance_metric import DistanceMetric as DistanceMetric from ._graph import ( KNeighborsTransformer as KNeighborsTransformer, RadiusNeighborsTransformer as RadiusNeighborsTransformer, @@ -22,7 +21,6 @@ from ._unsupervised import NearestNeighbors as NearestNeighbors __all__ = [ "BallTree", - "DistanceMetric", "KDTree", "KNeighborsClassifier", "KNeighborsRegressor", diff --git a/stubs/sklearn/neighbors/_distance_metric.pyi b/stubs/sklearn/neighbors/_distance_metric.pyi deleted file mode 100644 index de510092..00000000 --- a/stubs/sklearn/neighbors/_distance_metric.pyi +++ /dev/null @@ -1,7 +0,0 @@ -# TODO: Remove this file in 1.3 - -from ..metrics import DistanceMetric as _DistanceMetric - -class DistanceMetric(_DistanceMetric): - @classmethod - def get_metric(cls, metric, **kwargs): ... diff --git a/stubs/sklearn/neighbors/_kde.pyi b/stubs/sklearn/neighbors/_kde.pyi index cced5acd..5c4485a9 100644 --- a/stubs/sklearn/neighbors/_kde.pyi +++ b/stubs/sklearn/neighbors/_kde.pyi @@ -8,14 +8,10 @@ from .._typing import ArrayLike, Float, Int, MatrixLike from ..base import BaseEstimator from ._binary_tree import BinaryTree -# Author: Jake Vanderplas - VALID_KERNELS: list = ... TREE_DICT: dict = ... -# TODO: implement a brute force version for testing purposes -# TODO: create a density estimation base class? class KernelDensity(BaseEstimator): bandwidth_: float = ... feature_names_in_: ndarray = ... diff --git a/stubs/sklearn/preprocessing/_polynomial.pyi b/stubs/sklearn/preprocessing/_polynomial.pyi index af95a0f4..7a91a5c3 100644 --- a/stubs/sklearn/preprocessing/_polynomial.pyi +++ b/stubs/sklearn/preprocessing/_polynomial.pyi @@ -34,8 +34,6 @@ class PolynomialFeatures(TransformerMixin, BaseEstimator): def fit(self, X: MatrixLike | ArrayLike, y: Any = None) -> Self: ... def transform(self, X: MatrixLike | ArrayLike) -> ndarray | spmatrix: ... -# TODO: -# - sparse support (either scipy or own cython solution)? class SplineTransformer(TransformerMixin, BaseEstimator): n_features_out_: int = ... feature_names_in_: ndarray = ... diff --git a/stubs/sklearn/stubtest_allowlist.txt b/stubs/sklearn/stubtest_allowlist.txt index ddd11c35..9fa8cab8 100644 --- a/stubs/sklearn/stubtest_allowlist.txt +++ b/stubs/sklearn/stubtest_allowlist.txt @@ -1017,7 +1017,6 @@ sklearn.neighbors.NeighborhoodComponentsAnalysis.__sklearn_tags__ sklearn.neighbors.RadiusNeighborsClassifier.__sklearn_tags__ sklearn.neighbors.RadiusNeighborsClassifier.set_score_request sklearn.neighbors.RadiusNeighborsRegressor.set_score_request -sklearn.neighbors.__all__ sklearn.neighbors._ball_tree.BallTree32 sklearn.neighbors._ball_tree.BallTree64 sklearn.neighbors._ball_tree.__all__ @@ -1387,7 +1386,6 @@ sklearn.utils.estimator_checks.check_valid_tag_types sklearn.utils.estimator_checks.estimator_checks_generator sklearn.utils.extmath.safe_sqr sklearn.utils.get_tags -sklearn.utils.metaestimators.__all__ sklearn.utils.murmurhash.__pyx_capi__ sklearn.utils.murmurhash.__test__ sklearn.utils.murmurhash.murmurhash3_bytes_s32 @@ -1508,16 +1506,12 @@ sklearn.calibration.fmin_bfgs sklearn.calibration.is_classifier sklearn.calibration.partial sklearn.calibration.xlogy -sklearn.cluster.AgglomerativeClustering.__init__ sklearn.cluster.Birch.__init__ -sklearn.cluster.FeatureAgglomeration.__init__ sklearn.cluster.FeatureAgglomeration.fit_predict sklearn.cluster.KMeans.__init__ sklearn.cluster.MiniBatchKMeans.__init__ sklearn.cluster.SpectralBiclustering.biclusters_ sklearn.cluster.SpectralCoclustering.biclusters_ -sklearn.cluster._agglomerative.AgglomerativeClustering.__init__ -sklearn.cluster._agglomerative.FeatureAgglomeration.__init__ sklearn.cluster._agglomerative.FeatureAgglomeration.fit_predict sklearn.cluster._agglomerative._TREE_BUILDERS sklearn.cluster._bicluster.SpectralBiclustering.biclusters_ @@ -2105,14 +2099,12 @@ sklearn.naive_bayes.Hidden sklearn.naive_bayes.MultinomialNB.__init__ sklearn.naive_bayes.StrOptions sklearn.naive_bayes._BaseDiscreteNB.__init__ -sklearn.neighbors.DistanceMetric sklearn.neighbors.NearestCentroid.__init__ sklearn.neighbors.VALID_METRICS sklearn.neighbors.VALID_METRICS_SPARSE sklearn.neighbors._base.VALID_METRICS sklearn.neighbors._base.VALID_METRICS_SPARSE sklearn.neighbors._binary_tree -sklearn.neighbors._distance_metric sklearn.neighbors._nearest_centroid.NearestCentroid.__init__ sklearn.pipeline.FeatureUnion.__init__ sklearn.pipeline.Pipeline.__init__ @@ -2316,7 +2308,6 @@ sklearn.utils.is_scalar_nan sklearn.utils.islice sklearn.utils.issparse sklearn.utils.metaestimators.attrgetter -sklearn.utils.metaestimators.if_delegate_has_method sklearn.utils.multiclass.Sequence.index sklearn.utils.multiclass.check_array sklearn.utils.multiclass.dok_matrix diff --git a/stubs/sklearn/svm/_base.pyi b/stubs/sklearn/svm/_base.pyi index 25da99ce..b08eb04f 100644 --- a/stubs/sklearn/svm/_base.pyi +++ b/stubs/sklearn/svm/_base.pyi @@ -13,9 +13,6 @@ LIBSVM_IMPL: list = ... class BaseLibSVM(BaseEstimator, metaclass=ABCMeta): _parameter_constraints: ClassVar[dict] = ... - # The order of these must match the integer values in LibSVM. - # XXX These are actually the same in the dense case. Need to factor - # this out. _sparse_kernels: ClassVar[list] = ... @abstractmethod diff --git a/stubs/sklearn/utils/metaestimators.pyi b/stubs/sklearn/utils/metaestimators.pyi index c00dd5e1..bce36093 100644 --- a/stubs/sklearn/utils/metaestimators.pyi +++ b/stubs/sklearn/utils/metaestimators.pyi @@ -1,26 +1,15 @@ -import warnings from abc import ABCMeta, abstractmethod -from collections.abc import Sequence from contextlib import suppress as suppress from operator import attrgetter as attrgetter -from typing import Any, Callable, ClassVar - -import numpy as np +from typing import Any, ClassVar from ..base import BaseEstimator -from ._available_if import _AvailableIfDescriptor, available_if +from ._available_if import available_if -__all__ = ["available_if", "if_delegate_has_method"] +__all__ = ["available_if"] class _BaseComposition(BaseEstimator, metaclass=ABCMeta): steps: ClassVar[list[Any]] = ... @abstractmethod def __init__(self) -> None: ... - -# TODO(1.3) remove -class _IffHasAttrDescriptor(_AvailableIfDescriptor): - def __init__(self, fn, delegate_names, attribute_name) -> None: ... - -# TODO(1.3) remove -def if_delegate_has_method(delegate: tuple[str, ...] | str | Sequence[str]) -> Callable: ... diff --git a/stubs/vispy/app/canvas.pyi b/stubs/vispy/app/canvas.pyi index 2c352c6b..8b5fee6a 100644 --- a/stubs/vispy/app/canvas.pyi +++ b/stubs/vispy/app/canvas.pyi @@ -1,26 +1,13 @@ -# Copyright (c) Vispy Development Team. All Rights Reserved. -# Distributed under the (new) BSD License. See LICENSE.txt for more info. - -import sys from collections.abc import Mapping -from time import sleep from typing import Callable -import numpy as np from numpy.typing import ArrayLike -from ..gloo import FrameBuffer, RenderBuffer -from ..gloo.context import GLContext, forget_canvas, set_current_canvas +from ..gloo.context import GLContext from ..scene.widgets.widget import Widget -from ..util import config as util_config, logger -from ..util.dpi import get_dpi -from ..util.event import EmitterGroup, Event, WarningEmitter +from ..util.event import Event from ..util.keys import Key -from . import Application, use_app - -# todo: add functions for asking about current mouse/keyboard state -# todo: add hover enter/exit events -# todo: add focus events +from . import Application class Canvas: def __init__( diff --git a/stubs/vispy/ext/cocoapy.pyi b/stubs/vispy/ext/cocoapy.pyi index 0379eb90..27e12b7d 100644 --- a/stubs/vispy/ext/cocoapy.pyi +++ b/stubs/vispy/ext/cocoapy.pyi @@ -1,45 +1,4 @@ -import platform -import struct -import sys -from ctypes import ( - CFUNCTYPE, - POINTER, - ArgumentError, - Structure, - alignment, - byref, - c_bool, - c_buffer, - c_byte, - c_char, - c_char_p, - c_double, - c_float, - c_int, - c_int8, - c_int16, - c_int32, - c_int64, - c_long, - c_longdouble, - c_longlong, - c_short, - c_size_t, - c_ubyte, - c_uint, - c_uint8, - c_uint32, - c_ulong, - c_ulonglong, - c_ushort, - c_void_p, - c_wchar, - cast, - cdll, - py_object, - sizeof, - util, -) +from ctypes import Structure from typing import ClassVar # Based on Pyglet code @@ -176,36 +135,6 @@ class ObjCSubclass: def method(self, encoding): ... def classmethod(self, encoding): ... -# XXX This causes segfaults in all backends (yikes!), and makes it so that -# pyglet can't even be loaded. We'll just have to live with leaks for now, -# which is probably alright since we only use the -# NSFontManager.sharedFontManager class currently. - -# class DeallocationObserver_Implementation(object): -# DeallocationObserver = ObjCSubclass('NSObject', 'DeallocationObserver', -# register=False) -# DeallocationObserver.add_ivar('observed_object', c_void_p) -# DeallocationObserver.register() -# -# @DeallocationObserver.rawmethod('@@') -# def initWithObject_(self, cmd, anObject): -# self = send_super(self, 'init') -# self = self.value -# set_instance_variable(self, 'observed_object', anObject, c_void_p) -# return self -# -# @DeallocationObserver.rawmethod('v') -# def dealloc(self, cmd): -# anObject = get_instance_variable(self, 'observed_object', c_void_p) -# ObjCInstance._cached_objects.pop(anObject, None) -# send_super(self, 'dealloc') -# -# @DeallocationObserver.rawmethod('v') -# def finalize(self, cmd): -# anObject = get_instance_variable(self, 'observed_object', c_void_p) -# ObjCInstance._cached_objects.pop(anObject, None) -# send_super(self, 'finalize') - ############################################################################## # cocoalibs.py diff --git a/stubs/vispy/gloo/glir.pyi b/stubs/vispy/gloo/glir.pyi index 59ac9343..1c949c2d 100644 --- a/stubs/vispy/gloo/glir.pyi +++ b/stubs/vispy/gloo/glir.pyi @@ -142,12 +142,6 @@ class GlirTexture(GlirObject): def set_wrapping(self, wrapping): ... def set_interpolation(self, min, mag): ... -# these should be auto generated in _constants.py. But that doesn't seem -# to be happening. TODO - figure out why the C parser in (createglapi.py) -# is not extracting these constanst out. -# found the constant value at: -# http://docs.factorcode.org/content/word-GL_TEXTURE_1D,opengl.gl.html -# http://docs.factorcode.org/content/word-GL_SAMPLER_1D%2Copengl.gl.html GL_SAMPLER_1D = ... GL_TEXTURE_1D = ... @@ -195,7 +189,6 @@ class GlirRenderBuffer(GlirObject): def set_size(self, shape, format): ... class GlirFrameBuffer(GlirObject): - # todo: on ES 2.0 -> gl.gl_RGBA4 _formats: dict = ... def create(self): ... diff --git a/stubs/vispy/gloo/texture.pyi b/stubs/vispy/gloo/texture.pyi index cae161eb..0b49c045 100644 --- a/stubs/vispy/gloo/texture.pyi +++ b/stubs/vispy/gloo/texture.pyi @@ -1,17 +1,8 @@ -import math -import warnings - import numpy as np from numpy import ndarray from numpy.typing import NDArray from .globject import GLObject -from .util import check_enum - -# ----------------------------------------------------------------------------- -# Copyright (c) Vispy Development Team. All Rights Reserved. -# Distributed under the (new) BSD License. See LICENSE.txt for more info. -# ----------------------------------------------------------------------------- F64_PRECISION_WARNING: str = ... @@ -182,12 +173,11 @@ class TextureCube(BaseTexture): # ------------------------------------------------- TextureEmulated3D class --- class TextureEmulated3D(Texture2D): - # TODO: does GL's nearest use floor or round? _glsl_sample_nearest: str = ... _glsl_sample_linear: str = ... - _gl_max_texture_size: int = ... # For now, we just set this manually + _gl_max_texture_size: int = ... def __init__( self, diff --git a/stubs/vispy/visuals/axis.pyi b/stubs/vispy/visuals/axis.pyi index 649e2f5e..48059b83 100644 --- a/stubs/vispy/visuals/axis.pyi +++ b/stubs/vispy/visuals/axis.pyi @@ -1,27 +1,10 @@ -import math from collections.abc import Iterable -import numpy as np from numpy.typing import ArrayLike from ..util.svg.color import Color -from .line import LineVisual -from .text import TextVisual from .visual import CompoundVisual, updating_property -# ----------------------------------------------------------------------------- -# Copyright (c) Vispy Development Team. All Rights Reserved. -# Distributed under the (new) BSD License. See LICENSE.txt for more info. -# ----------------------------------------------------------------------------- - -# XXX TODO list (see code, plus): -# 1. Automated tick direction? -# 2. Expand to 3D (only 2D supported currently) -# 3. Input validation -# 4. Property support -# 5. Reactivity to resizing (current tick lengths grow/shrink w/zoom) -# 6. Improve tick label naming (str(x) is not good) and tick selection - class AxisVisual(CompoundVisual): def __init__( self, diff --git a/stubs/vispy/visuals/glsl/color.pyi b/stubs/vispy/visuals/glsl/color.pyi index 6342eb98..414f8785 100644 --- a/stubs/vispy/visuals/glsl/color.pyi +++ b/stubs/vispy/visuals/glsl/color.pyi @@ -1,11 +1,5 @@ COLORMAP_TEXTURE: str = ... -# ----------------------------------------------------------------------------- -# Color space transformations -# ----------------------------------------------------------------------------- - -# From http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl -# TODO: unit tests HSV_TO_RGB: str = ... RGB_TO_HSV: str = ... diff --git a/stubs/vispy/visuals/text/text.pyi b/stubs/vispy/visuals/text/text.pyi index e66cfb7c..0335aa49 100644 --- a/stubs/vispy/visuals/text/text.pyi +++ b/stubs/vispy/visuals/text/text.pyi @@ -1,17 +1,9 @@ -import sys from collections.abc import Mapping -from copy import deepcopy from typing import Any -import numpy as np from numpy.typing import ArrayLike -from ...color import ColorArray -from ...gloo import IndexBuffer, TextureAtlas, VertexBuffer, context -from ...gloo.wrappers import _check_valid -from ...io import load_spatial_filters from ...util.svg.color import Color -from ..transforms import STTransform from ..visual import Visual from ._sdf_gpu import SDFRendererGPU @@ -33,8 +25,6 @@ class TextureFont: def _load_char(self, char): ... class FontManager: - # XXX: should store a font-manager on each context, - # or let TextureFont use a TextureAtlas for each context def __init__(self, method="cpu"): ... def get_font(self, face, bold=False, italic=False): ... diff --git a/stubs/vispy/visuals/transforms/linear.pyi b/stubs/vispy/visuals/transforms/linear.pyi index 5f43a475..efdf1c31 100644 --- a/stubs/vispy/visuals/transforms/linear.pyi +++ b/stubs/vispy/visuals/transforms/linear.pyi @@ -92,15 +92,3 @@ class MatrixTransform(BaseTransform): def __repr__(self): ... def set_perspective(self, fov: float, aspect: float, near: float, far: float): ... def set_frustum(self, l: float, r: float, b: float, t: float, n: float, f: float): ... - -# class SRTTransform(BaseTransform): -# """ Transform performing scale, rotate, and translate, in that order. -# -# This transformation allows objects to be placed arbitrarily in a scene -# much the same way MatrixTransform does. However, an incorrect order of -# operations in MatrixTransform may result in shearing the object (if scale -# is applied after rotate) or in unpredictable translation (if scale/rotate -# is applied after translation). SRTTransform avoids these problems by -# enforcing the correct order of operations. -# """ -# # TODO diff --git a/stubs/vispy/visuals/transforms/nonlinear.pyi b/stubs/vispy/visuals/transforms/nonlinear.pyi index 5cbbb240..1ffa2f24 100644 --- a/stubs/vispy/visuals/transforms/nonlinear.pyi +++ b/stubs/vispy/visuals/transforms/nonlinear.pyi @@ -43,15 +43,6 @@ class PolarTransform(BaseTransform): @arg_to_array def imap(self, coords): ... -# class BilinearTransform(BaseTransform): -# # TODO -# pass - -# class WarpTransform(BaseTransform): -# """ Multiple bilinear transforms in a grid arrangement. -# """ -# # TODO - class MagnifyTransform(BaseTransform): glsl_map: ClassVar[str] diff --git a/tests/sklearn/preprocessing_tests.py b/tests/sklearn/preprocessing_tests.py index 0a4af468..d26ca246 100644 --- a/tests/sklearn/preprocessing_tests.py +++ b/tests/sklearn/preprocessing_tests.py @@ -1,4 +1,3 @@ -from typing import Any from typing_extensions import assert_type from numpy import ndarray @@ -15,15 +14,15 @@ assert_type(result, csr_matrix) result = normalize(matrix, return_norm=True) -assert_type(result, tuple[csr_matrix, ndarray[Any, Any]]) +assert_type(result, tuple[csr_matrix, ndarray]) # normalize with array array_like = [1] result = normalize(array_like) -assert_type(result, ndarray[Any, Any]) +assert_type(result, ndarray) result = normalize(array_like, return_norm=False) -assert_type(result, ndarray[Any, Any]) +assert_type(result, ndarray) result = normalize(array_like, return_norm=True) -assert_type(result, tuple[ndarray[Any, Any], ndarray[Any, Any]]) +assert_type(result, tuple[ndarray, ndarray])