diff --git a/libgunshotmatch/consolidate/__init__.py b/libgunshotmatch/consolidate/__init__.py index 6cf0aa8..a683281 100644 --- a/libgunshotmatch/consolidate/__init__.py +++ b/libgunshotmatch/consolidate/__init__.py @@ -41,6 +41,7 @@ from pyms.DPA.Alignment import Alignment from pyms.Spectrum import MassSpectrum from pyms_nist_search import ReferenceData, SearchResult +from typing_extensions import Self # this package from libgunshotmatch.consolidate._fields import ( @@ -715,7 +716,7 @@ class ConsolidatedPeakFilter: verbose: bool = False @classmethod - def from_method(cls: Type["ConsolidatedPeakFilter"], method: ConsolidateMethod) -> "ConsolidatedPeakFilter": + def from_method(cls: Type[Self], method: ConsolidateMethod) -> Self: """ Construct a :class:`~.ConsolidatedPeakFilter` from a :class:`~.ConsolidateMethod`. diff --git a/requirements.txt b/requirements.txt index 409a3c6..2597607 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ scipy>=1.9.0 sdjson>=0.4.0 tomli>=1.2.3; python_version < "3.11" tomli-w>=1.0.0 +typing-extensions>=4.12.2