GAA-UAM / scikit-fda

Functional Data Analysis Python package

Home Page:https://fda.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`domain_range` as a 2D NumPy array?

ego-thales opened this issue · comments

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

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.

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!

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.