Skip to content

Commit

Permalink
Refactor single_cell.py: update load_single_cells_json method signatu…
Browse files Browse the repository at this point in the history
…re to accept Union[Path, str] for path parameter
  • Loading branch information
dummyindex committed Jun 4, 2024
1 parent 8cf5919 commit b525107
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions livecellx/core/single_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def load_from_json_dict(self, json_dict, img_dataset=None, mask_dataset=None):

@staticmethod
# TODO: check forward declaration change: https://peps.python.org/pep-0484/#forward-references
def load_single_cells_json(path: str, verbose=False) -> List["SingleCellStatic"]:
def load_single_cells_json(path: Union[Path, str], verbose=False) -> List["SingleCellStatic"]:
"""load a json file containing a list of single cells
Parameters
Expand Down Expand Up @@ -1703,7 +1703,7 @@ def show_sct_on_grid(
return fig, axes


def combine_scs_label_masks(scs: SingleCellStatic, scs_labels: list = None, original_meta_label_key=None):
def combine_scs_label_masks(scs: List[SingleCellStatic], scs_labels: list = None, original_meta_label_key=None):
"""Generate a label mask from a list of single cell objects."""
label_mask = np.zeros(scs[0].get_mask().shape, dtype=np.int32)
if scs_labels is None and original_meta_label_key is None:
Expand Down

0 comments on commit b525107

Please sign in to comment.