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

`domain_range` as a 2D NumPy array? #563

Closed ego-thales closed 10 months ago

ego-thales commented 10 months ago

Hello,

Is there any reason why the domain_range is expressed as a tuple of tuples? Wouldn't it be more convenient for implementation expressed as a 2D numpy array?

Not that it's of big importance, but I might make implementation a bit smoother in some places?

Thanks for your feedback! Élie

vnmabus commented 10 months ago

I just feel it was more consistent with the attribute grid_points (which cannot be an array, as the number of grid points per dimension may differ). I also did not found any case in which using a 2D array for this attribute would allow for faster or more legible code.

ego-thales commented 10 months ago

Ok, fair enough!

An example I can think of right now would be if you want to perform a simple domain_shift: domain += shift as a vectorized operation. I don't have a strong case for it though, it was merely to share a point of view.

If you don't see any utility to this, I let you close the issue!

vnmabus commented 10 months ago

I think that that case is a bit niche. Moreover, the number of dimensions is usually low, so there is almost no performance penalty for doing it in the current way. I will close the issue until we find a compelling reason to change that decision.