Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlowKit should be able to automatically find FCS files based on uris in .wsp files #166

Closed
hbhargava7 opened this issue Aug 31, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@hbhargava7
Copy link
Contributor

tl;dr: It would be great if the FlowKit Workspace constructor would find the FCS files automatically based on the uris written in the WSP files. Not only would this be hugely convenient, the current implementation is incompatible with custom Sample Display Naming in FlowJo, as well as FCS filenames that don't match the FlowJo sample names.

My (not so esoteric, I'd guess) use case prevents FlowKit getting the FCS files no matter what: I have "Sample Display Naming" [1] in FlowJo set to a custom combination of properties, since I conduct timecourse experiments where each timepoint is its own experiment in BD FACSDiva, the software that controls our cytometer. This means FlowJo names the specimens with a name that is not the FCS filename.

My FCS files are stored like this

fcs_files \
    timepoint_0 \
        plate A \
            specimen_A1.fcs
            ...
        ...
    ...

As a result, there are multiple FCS files with the same name (specimen_A1.fcs for multiple plates/timepoints/etc.), so that is not a suitable UID.

Happily, there is a uri field in the FlowJo WSP files that contains the absolute path to the FCS file for each specimen. It should be possible to read the FCS files from there,

[1]: Here is the setting in FlowJo that's relevant
Screenshot 2023-08-30 at 9 51 50 PM

@whitews
Copy link
Owner

whitews commented Sep 1, 2023

Hi Hersh,

Thanks for the PR, it's much appreciated. Our use cases generally do not have the referenced FCS files in the same locations as the original analyst so this functionality was never considered.

One request is to make these changes off the develop branch, there are already downstream changes there for an upcoming 1.1 release. Also, please do try to get the test suites working, we'll have to make sure they all pass or get addressed. Finally, I was going to ask how you dealt with the Sample IDs but it looks like you might have discovered that issue in the last commit.

I can do a proper review once you have these changes on the dev branch.

Again, thanks for taking the time to do this!

-Scott

@whitews whitews added the enhancement New feature or request label Sep 1, 2023
@hbhargava7
Copy link
Contributor Author

hbhargava7 commented Sep 1, 2023

Thanks @whitews, I was guessing that some use cases must not have the paths written to the wsp files.

My mistake, will fix the branch issue ASAP.

Could you confirm how you run the tests? I get the following error when I run python3 run_tests.py, even from a fresh clone of the current master (truncated output, Python3.11):

F.....F......................F.................F.....F.........................F................................................F......................F...................................................................................F.......................................................................
======================================================================
FAIL: test_all_gates (flowkit.tests.export_gml_tests.ExportGMLTestCase.test_all_gates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/export_gml_tests.py", line 954, in test_all_gates
    np.testing.assert_array_equal(
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 985, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 862, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

@whitews
Copy link
Owner

whitews commented Sep 1, 2023

Looks like you are running the tests the correct way, some are just failing for some reason. At first I thought it might be due to you using Python 3.11 (not officially supported), but I set up a 3.11 venv and all the tests pass for me. Can you provide more details of your environment (OS, dep versions, etc.)?

BTW, the tests passed for your new branch as well.

@hbhargava7
Copy link
Contributor Author

MacOS 13.5, Python3.11.4. Apple Silicon.

pip list output below

anytree            2.9.0
appnope            0.1.3
asttokens          2.2.1
backcall           0.2.0
bokeh              2.4.3
comm               0.1.4
contourpy          1.1.0
cycler             0.11.0
debugpy            1.6.7.post1
decorator          5.1.1
dill               0.3.7
emcee              3.1.4
executing          1.2.0
FlowIO             1.1.1
FlowKit            1.0.1
FlowUtils          1.0.0
fonttools          4.42.0
h5py               3.9.0
ipykernel          6.25.1
ipython            8.14.0
ipywidgets         8.1.0
jedi               0.19.0
Jinja2             3.1.2
joblib             1.3.2
jupyter_client     8.3.0
jupyter_core       5.3.1
jupyterlab-widgets 3.0.8
kiwisolver         1.4.4
llvmlite           0.40.1
lxml               4.9.3
MarkupSafe         2.1.3
matplotlib         3.7.2
matplotlib-inline  0.1.6
mpmath             1.3.0
multiprocess       0.70.15
nest-asyncio       1.5.7
networkx           3.1
numba              0.57.1
numpy              1.24.4
packaging          23.1
pandas             1.5.3
parso              0.8.3
pathos             0.3.1
pexpect            4.8.0
pickleshare        0.7.5
Pillow             10.0.0
pip                23.2.1
platformdirs       3.10.0
plotly             5.16.0
pox                0.3.3
ppft               1.7.6.7
prompt-toolkit     3.0.39
psutil             5.9.5
ptyprocess         0.7.0
pure-eval          0.2.2
pyDOE2             1.3.0
Pygments           2.16.1
pygraphviz         1.9
pyparsing          3.0.9
python-dateutil    2.8.2
pytz               2023.3
PyYAML             6.0.1
pyzmq              25.1.1
scikit-learn       1.3.0
scipy              1.11.1
seaborn            0.11.2
setuptools         68.0.0
six                1.16.0
smt                2.0
stack-data         0.6.2
sympy              1.12
tenacity           8.2.3
threadpoolctl      3.2.0
tornado            6.3.3
tqdm               4.66.1
traitlets          5.9.0
typing_extensions  4.7.1
tzdata             2023.3
wcwidth            0.2.6
wheel              0.38.4
widgetsnbextension 4.0.8
xyzservices        2023.7.0

@whitews
Copy link
Owner

whitews commented Sep 2, 2023

Hi Hersh,

My dev environment is Ubuntu 22.04, but I have an M2 Mac available. I updated that machine to Ventura, then installed Python 3.11.2 via pyenv. I created a venv for FlowKit testing from Python 3.11.2, and installed the dependencies using pip install -r requirements.txt.

With this setup, the tests run without errors for me so I'm not sure what is happening on your side. I suspected numba since it always forces its NumPy version, but the tests passed after installing that too. Is the setup I described roughly what you did as well? Would you mind trying to replicate it again with a fresh venv?

Sorry to sideline the PR, but I would like to know what is going on with those tests. From the output you provided, it wasn't a raised error that caused the failed test but a mismatch in a single element in a gate membership Boolean array (i.e. one event is supposed to be either included or excluded in the gate). Can you post the entire output of run_tests.py?

Thanks,
Scott

@hbhargava7
Copy link
Contributor Author

here is the output of the run in a new venv. pip list below.

cd FlowKit
python3.11 -m venv env
source env/bin/activate
python3.11 -m pip install .
python3.11 run_tests.py
F.....F......................F.................F.....F.........................F..................../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
...........................F......................F............................./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
....../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
.../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
............/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
....../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
.../Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
..F..../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
................./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
......................./Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
.../Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
.../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
...../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
./Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
.../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
../Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
./Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/pandas/core/dtypes/cast.py:1641: DeprecationWarning: np.find_common_type is deprecated.  Please use `np.result_type` or `np.promote_types`.
See https://numpy.org/devdocs/release/1.25.0-notes.html and the docs for more information.  (Deprecated NumPy 1.25)
  return np.find_common_type(types, [])
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:43: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.min = float(range_min)
/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/_models/dimension.py:47: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
  self.max = float(range_max)
.
======================================================================
FAIL: test_all_gates (flowkit.tests.export_gml_tests.ExportGMLTestCase.test_all_gates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/export_gml_tests.py", line 954, in test_all_gates
    np.testing.assert_array_equal(
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_boolean_or1_gate (flowkit.tests.export_gml_tests.ExportGMLTestCase.test_boolean_or1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/export_gml_tests.py", line 383, in test_boolean_or1_gate
    np.testing.assert_array_equal(truth, result)
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_poly1_gate (flowkit.tests.export_gml_tests.ExportGMLTestCase.test_poly1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/export_gml_tests.py", line 100, in test_poly1_gate
    np.testing.assert_array_equal(truth, result)
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 3 / 13367 (0.0224%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_all_gates (flowkit.tests.gatingml_tests.GatingMLTestCase.test_all_gates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/gatingml_tests.py", line 722, in test_all_gates
    np.testing.assert_array_equal(
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_boolean_or1_gate (flowkit.tests.gatingml_tests.GatingMLTestCase.test_boolean_or1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/gatingml_tests.py", line 308, in test_boolean_or1_gate
    np.testing.assert_array_equal(truth, result)
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_poly1_gate (flowkit.tests.gatingml_tests.GatingMLTestCase.test_poly1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/gatingml_tests.py", line 83, in test_poly1_gate
    np.testing.assert_array_equal(truth, result)
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 3 / 13367 (0.0224%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_add_boolean_or1_gate (flowkit.tests.gating_strategy_prog_gate_tests.GatingTestCase.test_add_boolean_or1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/gating_strategy_prog_gate_tests.py", line 592, in test_add_boolean_or1_gate
    np.testing.assert_array_equal(truth, result.get_gate_membership('Or1'))
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 1 / 13367 (0.00748%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_add_poly1_gate (flowkit.tests.gating_strategy_prog_gate_tests.GatingTestCase.test_add_poly1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/gating_strategy_prog_gate_tests.py", line 191, in test_add_poly1_gate
    np.testing.assert_array_equal(truth, result.get_gate_membership('Polygon1'))
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 3 / 13367 (0.0224%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

======================================================================
FAIL: test_add_poly1_gate (flowkit.tests.session_tests.SessionTestCase.test_add_poly1_gate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/flowkit/tests/session_tests.py", line 70, in test_add_poly1_gate
    np.testing.assert_array_equal(truth, result.get_gate_membership('Polygon1'))
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 920, in assert_array_equal
    assert_array_compare(operator.__eq__, x, y, err_msg=err_msg,
  File "/Users/hbhargava/.pyenv/versions/3.11.2/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/hbhargava/Drive/Projects/Code/FlowKit/env/lib/python3.11/site-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare
    raise AssertionError(msg)
AssertionError:
Arrays are not equal

Mismatched elements: 3 / 13367 (0.0224%)
 x: array([ True, False, False, ..., False, False, False])
 y: array([ True, False, False, ..., False, False, False])

----------------------------------------------------------------------
Ran 307 tests in 6.306s

FAILED (failures=9)

Also here is python3.11 -m pip list

Package           Version
----------------- -------
anytree           2.9.0
bokeh             2.4.3
contourpy         1.1.0
cycler            0.11.0
FlowIO            1.1.1
FlowKit           1.0.1
FlowUtils         1.0.0
fonttools         4.42.1
Jinja2            3.1.2
kiwisolver        1.4.5
lxml              4.9.3
MarkupSafe        2.1.3
matplotlib        3.7.2
networkx          3.1
numpy             1.25.2
packaging         23.1
pandas            1.5.3
Pillow            10.0.0
pip               22.3.1
psutil            5.9.5
pyparsing         3.0.9
python-dateutil   2.8.2
pytz              2023.3
PyYAML            6.0.1
scipy             1.11.2
seaborn           0.11.2
setuptools        65.5.0
six               1.16.0
tornado           6.3.3
typing_extensions 4.7.1

@whitews
Copy link
Owner

whitews commented Sep 2, 2023

Thanks Hersh. After some experimenting I was able to replicate the same 9 failures on my M2 Mac. I updated XCode (and I guess the command line tools / compiler) and disabled caching for pip, which forced the venv to build the packages. I am quite sure this is due to differences in floating point precision across different architectures / compilers. Not sure what I'm going to do about that, but it has nothing to do with this PR.

Back on topic, I'd like to add at least one test for the new functionality. However, the dynamic nature of the test environment makes hardcoding file paths in the .wsp file problematic. Using relative paths would solve this, do you know if relative paths work in FlowJo?

@hbhargava7
Copy link
Contributor Author

Makes sense re the precision error. I've dealt with a similar issue before, and the solution was to enforce float precision rather than allow defaults. Not sure how feasible that's going to be in this case though.

I edited a FlowJo WSP file and replaced the URIs of the FCS files with a relative path (./<dir>). FlowJo still seems to find the data, and doesn't seem to overwrite the changed URIs, so I think relative paths are okay.

@hbhargava7
Copy link
Contributor Author

@whitews I made some changes in the PR that handle local paths. I was able to set up a test with static data for my own project here: https://github.com/hbhargava7/flowtx/tree/main/tests. You can try it with pytest from the main dir

@whitews whitews added this to the Release version 1.1.0 milestone Apr 2, 2024
@whitews whitews closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants