From 8935b265a0ace853f9f03891315e043951415a35 Mon Sep 17 00:00:00 2001 From: Zach Bjornson Date: Thu, 18 Jul 2024 18:20:00 -0700 Subject: [PATCH] deps(flowio): v1.1 Moves from our fork to v1.1. Our fork ignored nan reagent values when writing files, but we should instead filter them out before calling flowio. --- cellengine/resources/fcs_file.py | 4 +++- setup.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cellengine/resources/fcs_file.py b/cellengine/resources/fcs_file.py index 517db5e3..dd43d345 100644 --- a/cellengine/resources/fcs_file.py +++ b/cellengine/resources/fcs_file.py @@ -262,7 +262,7 @@ def create_from_dataframe( experiment_id: str, filename: str, df: DataFrame, - reagents: Optional[List[str]] = None, + reagents: Optional[List[Union[str, None]]] = None, headers: Dict[str, str] = {}, ) -> FcsFile: """Creates an FCS file from a DataFrame and uploads it CellEngine. @@ -361,6 +361,8 @@ def create_from_dataframe( channels = df.columns.get_level_values(0).tolist() if reagents is None: reagents = df.columns.get_level_values(1).tolist() + # Filter out nan values. An Index will cast None to float (nan). + reagents = [r if r == r else None for r in reagents] else: channels = df.columns diff --git a/setup.py b/setup.py index 90acf7a8..d6519cb9 100644 --- a/setup.py +++ b/setup.py @@ -40,8 +40,7 @@ ], platforms="Posix; MacOS X; Windows", install_requires=[ - "flowio~=1.0", - "flowio @ git+https://github.com/cellengine/FlowIO.git@next", + "flowio~=1.1", "numpy~=1.17", "pandas~=1.1", "requests~=2.22",