poldracklab / fitlins

Fit Linear Models to BIDS Datasets
https://fitlins.readthedocs.io
Apache License 2.0
76 stars 32 forks source link

FIX: Unreliable constant column name finding #322

Closed adelavega closed 3 years ago

adelavega commented 3 years ago

Fixes #320 by assuming constant name is: constant

adelavega commented 3 years ago

@effigies should be a pretty uncontroversial fix

adelavega commented 3 years ago

@effigies should we also merge this or a similar fix to master?

effigies commented 3 years ago

Yes this would be good. Looking at this now, I might use a better check:


- const_name = mat.columns[(mat != 1).sum(0) == 0].values[0]
+ const_name = mat.columns[np.isclose(mat, 1).all(0)].values[0]