GAA-UAM / scikit-fda

Functional Data Analysis Python package
https://fda.readthedocs.io
BSD 3-Clause "New" or "Revised" License
307 stars 58 forks source link

Evaluation of `FDataIrregular` objects with multidimensional domain not working #617

Open pcuestas opened 5 months ago

pcuestas commented 5 months ago

Bug description summary

When evaluating an FDataIrregular observation with multidimensional domain, the returned value is incorrect.

Code to reproduce the bug

from skfda import FDataIrregular
irregular=FDataIrregular(
    start_indices=[0],
    points=[[1, 2], [3, 4]],
    values=[[-1], [-2]],
)
print(irregular(irregular.points))

Expected result

[[[-1]
  [-2]]]

Actual result

[[[nan]
  [nan]]]

Software versions

scikit-fda version: '0.9.2.dev0' OS: Ubuntu 22

Additional context

(Related to #616)

This problem is not present for multidimensional codomain (if dim_domain==1):


>>> irregular=FDataIrregular(
...     start_indices=[0],
...     points=[[1], [2]],
...     values=[[-1, -2], [-3, -4]],
... )
>>> irregular(irregular.points)
array([[[-1., -2.],
        [-3., -4.]]])