Skip to content

Commit

Permalink
Merge pull request #593 from eliegoudout/feature/irregular_operations
Browse files Browse the repository at this point in the history
`FDataIrregular` personal proposed reviews
  • Loading branch information
vnmabus authored Mar 11, 2024
2 parents a875bd7 + cd7e73e commit 21f7bad
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 225 deletions.
2 changes: 1 addition & 1 deletion skfda/misc/covariances.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _transform_to_2d(t: ArrayLike) -> NDArrayFloat:
"""Transform 1d arrays in column vectors."""
t = np.asfarray(t)

dim = len(t.shape)
dim = t.ndim
assert dim <= 2

if dim < 2:
Expand Down
2 changes: 1 addition & 1 deletion skfda/ml/regression/_linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def _check_and_convert(
np.ndarray: numpy 2D array.
"""
new_X = np.asarray(X)
if len(new_X.shape) == 1:
if new_X.ndim == 1:
new_X = new_X[:, np.newaxis]
return new_X

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
def _transform_to_2d(t: ArrayLike) -> NDArrayFloat:
t = np.asfarray(t)

dim = len(t.shape)
dim = t.ndim
assert dim <= 2

if dim < 2:
Expand Down
4 changes: 2 additions & 2 deletions skfda/representation/basis/_fdatabasis.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ def _array_to_R( # noqa: N802
coefficients: NDArrayFloat,
transpose: bool = False,
) -> str:
if len(coefficients.shape) == 1:
coefficients = coefficients.reshape((1, coefficients.shape[0]))
if coefficients.ndim == 1:
coefficients = coefficients[None]

Check warning on line 691 in skfda/representation/basis/_fdatabasis.py

View check run for this annotation

Codecov / codecov/patch

skfda/representation/basis/_fdatabasis.py#L690-L691

Added lines #L690 - L691 were not covered by tests

if transpose is True:
coefficients = np.transpose(coefficients)
Expand Down
Loading

0 comments on commit 21f7bad

Please sign in to comment.