FIX: FEMA input index should filter on rows, not columns. #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately, I didn't test this thoroughly enough, and the update on the
FEMA
input file indexing was incorrect. I reverted to a more clear/optimized version of my original logic.Consider the following:
and the design matrix looks like:
For the first contrast
[1, 0, 0]
, you want the files indicated by 1s in thermse
column.The current logic of
ix = weights[0].astype(bool)
yields:which is not what we want, because it's not the correct shape for filtering
filtered_effects
.I think this slipped past me because in my test analysis it just so happened that
filtered_effects
was of length 3, and it did not crash (although it probably filtered the wrong things).Instead, we want to use that
ix
to filtermat
.Now the reason that I added the
any(axis=1)
, is because of second contrast with weights[1, 0, 1]
.In this case we want to filter
mat
to select those two columns, and then selectany
rows that have a non-zero value in either columns:Now, this might be a weird
FEMA
to specify, but it's theoretically valid.