Skip to content

Commit 74dbde9

Browse files
Merge pull request #75 from MatthewSZhang/all-minus-one
MNT add error that some rows of feat_ids only have -1
2 parents 7ed5825 + 4172a64 commit 74dbde9

File tree

3 files changed

+343
-225
lines changed

3 files changed

+343
-225
lines changed

fastcan/narx.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ def _validate_feat_delay_ids(
351351
"The element x of feat_ids should "
352352
f"satisfy -1 <= x <= {n_features + n_outputs - 1}."
353353
)
354+
# Check if any row of feat_ids only contains -1
355+
if np.all(feat_ids_ == -1, axis=1).any():
356+
raise ValueError(
357+
"`feat_ids` should not contain rows that only have -1."
358+
)
354359
# Validate delay_ids
355360
delay_ids_ = check_array(
356361
delay_ids,

0 commit comments

Comments
 (0)