Skip to content

cuts.py masked elements as NaN #866

@sbailey

Description

@sbailey

As reported by Ben in PR #864:

I'm seeing these warnings on Python 3.12 and 3.13:

...
py/desitarget/test/test_cmx.py::TestCMX::test_astropy_table
py/desitarget/test/test_cuts.py::TestCuts::test_astropy_table
  /home/runner/work/desitarget/desitarget/py/desitarget/cuts.py:2195: UserWarning: Warning: converting a masked element to nan.
    refcat = np.array([refcat, ])

This might be harmless due to interplay between astropy Table with masked elements vs. numpy ndarrays. At the same time, it would be useful to work around this so that we don't get in the habit of ignoring warnings, and it might reveal a surprise gotcha about why the elements were masked in the first place (earlier versions of astropy certainly had some surprise behaviors there).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions