Skip to content

Commit

Permalink
Use Self as return type for ConsolidatedPeakFilter.from_method
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jul 18, 2024
1 parent c08cfab commit de9db30
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libgunshotmatch/consolidate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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`.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit de9db30

Please sign in to comment.