Skip to content

Commit

Permalink
Update syntax for builtin type hints.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmymathews committed Jul 28, 2023
1 parent d7f73ee commit bb47e46
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions spatialprofilingtoolbox/cggnn/scripts/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"Run through the entire SPT CG-GNN pipeline using a local db config."
from argparse import ArgumentParser
from typing import Dict, Tuple
from os.path import join

from pandas import DataFrame
Expand Down Expand Up @@ -121,7 +120,7 @@ def parse_arguments():
return parser.parse_args()


def _create_cell_df(cell_dfs: Dict[str, DataFrame], feature_names: Dict[str, str]) -> DataFrame:
def _create_cell_df(cell_dfs: dict[str, DataFrame], feature_names: dict[str, str]) -> DataFrame:
"Find chemical species, phenotypes, and locations and merge into a DataFrame."

for specimen, df_specimen in cell_dfs.items():
Expand All @@ -140,7 +139,7 @@ def _create_cell_df(cell_dfs: Dict[str, DataFrame], feature_names: Dict[str, str


def _create_label_df(df_assignments: DataFrame,
df_strata: DataFrame) -> Tuple[DataFrame, Dict[int, str]]:
df_strata: DataFrame) -> tuple[DataFrame, dict[int, str]]:
"""Get slide-level results."""
df = merge(df_assignments, df_strata, on='stratum identifier', how='left')[
['specimen', 'subject diagnosed result']].rename(
Expand All @@ -165,7 +164,7 @@ def save_importances(_args):
if __name__ == "__main__":
args = parse_arguments()
extractor = FeatureMatrixExtractor(database_config_file=args.spt_db_config_location)
study_data: Dict[str, Dict] = extractor.extract(study=args.study)
study_data: dict[str, dict] = extractor.extract(study=args.study)

df_cell = _create_cell_df(
{slide: data['dataframe']
Expand Down

0 comments on commit bb47e46

Please sign in to comment.