fmi-basel / gliberal-scMultipleX

Feature extraction and linking of multiplexing data.
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

Test measurements for tiny objects #101

Open jluethi opened 7 months ago

jluethi commented 7 months ago

@al-mcintyre reported an issue with the 0.5.0 version of the measurement task:

When there are tiny objects, the following error can occur:

File "/data/homes/fractal/20230627_joel_fractal/fractal-demos/examples/server/FRACTAL_TASKS_DIR/.fractal/scmultiplex0.5.0/venv/lib/python3.10/site-packages/scmultiplex/features/feature_wrapper.py", line 198, in get_morphology_measurements
    morphology_measurements["minmajAxisRatio"] = minor_major_axis_ratio(
  File "/data/homes/fractal/20230627_joel_fractal/fractal-demos/examples/server/FRACTAL_TASKS_DIR/.fractal/scmultiplex0.5.0/venv/lib/python3.10/site-packages/scmultiplex/features/FeatureFunctions.py", line 123, in minor_major_axis_ratio
    return np.float('NaN')
  File "/data/homes/fractal/20230627_joel_fractal/fractal-demos/examples/server/FRACTAL_TASKS_DIR/.fractal/scmultiplex0.5.0/venv/lib/python3.10/site-packages/numpy/__init__.py", line 324, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'cfloat'?

We should: 1) Test the measurements for tiny objects => can we reproduce the issue? 2) Update the numpy casting to a non-deprecated version 3) Check if there are other issues with tiny objects and whether we are getting correct measurements for them

jluethi commented 3 months ago

Likely a duplicate of #104 for the float deprecation. Testing tiny objects in test would still be useful though