Skip to content

Commit

Permalink
Merge pull request #888 from suddhasourav/master
Browse files Browse the repository at this point in the history
BF: TrialHandlerExt - ensure proper masking of data for uncompleted blocks
  • Loading branch information
peircej committed Apr 30, 2015
2 parents 4ca6468 + a4ae9d0 commit 8772ef0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psychopy/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ def _createOutputArrayData(self, dataOut):
thisDataChunk = self.data[dataType][idx_data==curTrialIndex,:]
padWidth = max(self.trialWeights)*self.nReps - numpy.prod(thisDataChunk.shape)
thisDataChunkRowPadded = numpy.pad(thisDataChunk.transpose().flatten().data, (0, padWidth), mode='constant', constant_values=(0,0))
thisDataChunkRowPaddedMask = numpy.pad(thisDataChunk.flatten().mask, (0, padWidth), mode='constant', constant_values=(0,True))
thisDataChunkRowPaddedMask = numpy.pad(thisDataChunk.transpose().flatten().mask, (0, padWidth), mode='constant', constant_values=(0,True))

thisDataChunkRow = numpy.ma.masked_array(thisDataChunkRowPadded, mask=thisDataChunkRowPaddedMask)
resizedData[curTrialIndex,:] = thisDataChunkRow
Expand Down

0 comments on commit 8772ef0

Please sign in to comment.