GAA-UAM / scikit-fda

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

Evaluation of FDataIrregular observation with only one point not working #616

Open pcuestas opened 3 weeks ago

pcuestas commented 3 weeks ago

Bug description summary

When evaluating an FDataIrregular observation with only one point, the returned value is incorrect.

Code to reproduce the bug

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

Expected result

[[[-1]]]

Actual result

[[[nan]]]

Software versions

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

Additional context

However, the evaluation of FDataIrregular observations which have more than one measurement is correct:

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