Skip to content

Commit

Permalink
fix: typing for python 3.9
Browse files Browse the repository at this point in the history
fix typing references for python 3.9
  • Loading branch information
jcharkow committed Oct 9, 2024
1 parent 9756ae9 commit 844a4d1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion massdash/loaders/GenericChromatogramLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)

@abstractmethod
def loadTransitionGroups(self, pep_id: str, charge: int, runNames: None | str | List[str] ) -> Dict[str, TransitionGroup]:
def loadTransitionGroups(self, pep_id: str, charge: int, runNames: Union[None, str, List[str]] ) -> Dict[str, TransitionGroup]:
'''
Loads the transition group for a given peptide ID and charge across all files
Args:
Expand Down
4 changes: 2 additions & 2 deletions massdash/loaders/MzMLDataLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, **kwargs):
if self.libraryAccess is None:
raise ValueError("If .osw file is not supplied, library file is required for MzMLDataLoader to perform targeted extraction")

def loadTransitionGroups(self, pep_id: str, charge: int, config: TargetedDIAConfig, runNames: None | str |List[str]=None) -> Dict[str, TransitionGroup]:
def loadTransitionGroups(self, pep_id: str, charge: int, config: TargetedDIAConfig, runNames: Union[None, str, List[str]]=None) -> Dict[str, TransitionGroup]:
'''
Loads the transition group for a given peptide ID and charge across all files
Expand Down Expand Up @@ -73,7 +73,7 @@ def loadTransitionGroupsDf(self, pep_id: str, charge: int, config: TargetedDIACo
out_df = out_df.loc[:,~out_df.columns.duplicated()]
return out_df

def loadFeatureMaps(self, pep_id: str, charge: int, config=TargetedDIAConfig, runNames: None | str | List[str] = None) -> FeatureMapCollection:
def loadFeatureMaps(self, pep_id: str, charge: int, config=TargetedDIAConfig, runNames: Union[None, str, List[str]] = None) -> FeatureMapCollection:
'''
Loads a dictionary of FeatureMaps (where the keys are the filenames) from the results file
Expand Down
2 changes: 1 addition & 1 deletion massdash/loaders/ResultsLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def loadTransitionGroupFeaturesDf(self, pep_id: str, charge: int) -> pd.DataFram

return pd.concat(out).reset_index().drop(columns='level_1').rename(columns=dict(level_0='runname'))

def loadTransitionGroupFeatures(self, pep_id: str, charge: int, runNames: str | List[str] | None = None) -> TransitionGroupFeatureCollection:
def loadTransitionGroupFeatures(self, pep_id: str, charge: int, runNames: Union[str, List[str], None] = None) -> TransitionGroupFeatureCollection:
"""
Load TransitionGroupFeature objects from the results file for the given peptide precursor
Expand Down
2 changes: 1 addition & 1 deletion massdash/loaders/SqMassLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def loadTransitionGroupsDf(self, pep_id: str, charge: int) -> pd.DataFrame:

return pd.concat(out).reset_index().drop('level_1', axis=1).rename(columns=dict(level_0='run'))

def loadTransitionGroups(self, pep_id: str, charge: int, runNames: None | str | List[str] =None) -> Dict[str, TransitionGroupCollection]:
def loadTransitionGroups(self, pep_id: str, charge: int, runNames: Union[None, str, List[str]] =None) -> Dict[str, TransitionGroupCollection]:
'''
Loads the transition group for a given peptide ID and charge across all files
Args:
Expand Down

0 comments on commit 844a4d1

Please sign in to comment.