@@ -714,7 +714,7 @@ def merge_single_cells(
714
714
"""
715
715
716
716
# Load the single cell dataframe by merging on the specific linking columns
717
- sc_df = ""
717
+ left_compartment_loaded = False
718
718
linking_check_cols = []
719
719
merge_suffix_rename = []
720
720
for left_compartment in self .compartment_linking_cols :
@@ -737,7 +737,7 @@ def merge_single_cells(
737
737
left_compartment
738
738
]
739
739
740
- if isinstance ( sc_df , str ) :
740
+ if not left_compartment_loaded :
741
741
sc_df = self .load_compartment (compartment = left_compartment )
742
742
743
743
if compute_subsample :
@@ -752,6 +752,8 @@ def merge_single_cells(
752
752
sc_df , how = "left" , on = subset_logic_df .columns .tolist ()
753
753
).reindex (sc_df .columns , axis = "columns" )
754
754
755
+ left_compartment_loaded = True
756
+
755
757
sc_df = sc_df .merge (
756
758
self .load_compartment (compartment = right_compartment ),
757
759
left_on = [* self .merge_cols , left_link_col ],
@@ -804,11 +806,13 @@ def merge_single_cells(
804
806
805
807
normalize_args ["features" ] = features
806
808
807
- sc_df = normalize (profiles = sc_df , ** normalize_args )
809
+ # ignore mypy warnings below as these reference root package imports
810
+ sc_df = normalize (profiles = sc_df , ** normalize_args ) # type: ignore[operator]
808
811
809
812
# In case platemap metadata is provided, use pycytominer.annotate for metadata
810
813
if platemap is not None :
811
- sc_df = annotate (
814
+ # ignore mypy warnings below as these reference root package imports
815
+ sc_df = annotate ( # type: ignore[operator]
812
816
profiles = sc_df , platemap = platemap , output_file = None , ** kwargs
813
817
)
814
818
0 commit comments