SIRF icon indicating copy to clipboard operation
SIRF copied to clipboard

update `as_array` usage

Open casperdcl opened this issue 5 months ago • 4 comments

Now that #1314 is merged, we should ^discussion:

  • change as_array -> asarray as far as possible
  • possibly add a default argument as_array(..., warn=True)
    • manually invoke as_array(..., warn=False) to suppress warnings where intended
    • alternatively use warnings.catch_warnings() @contextmanager to temporarily suppress

casperdcl avatar Jul 07 '25 15:07 casperdcl

In CIL we started using as_array because only then we could have access to a numpy array for a number of tasks, such as regularisation. The consequences of the warning message will go beyond SIRF. I suggest we talk about this with CIL devs and agree on a path.

paskino avatar Aug 19 '25 12:08 paskino

Are you sure you meant as_array? I wouldn't understand why you go to the "old" version.

KrisThielemans avatar Aug 19 '25 13:08 KrisThielemans

It's been years we've been using as_array.

paskino avatar Nov 10 '25 14:11 paskino

The Array API says to use asarray(). For SIRF, it will be vastly more efficient. So, at some point, CIL should move to asarray().

KrisThielemans avatar Nov 13 '25 02:11 KrisThielemans