-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DW initial revisions #3
DW initial revisions #3
Conversation
@@ -1209,7 +1212,7 @@ def _compute_aggregate(self, picks, mode="mean"): | |||
n_events += 1 | |||
|
|||
if n_events > 0: | |||
data = np.nanmean(data) | |||
data /= n_events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still a bit confused about this part of the function, to be honest, maybe a comment would be good at that point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this whole stuff only happens in the case of not-preloaded data, and thats why i guess it has to be somehow hacky and hard to follow ;)
in this case there is no numpy array of data in memory that we can simply access and change (probably only a view or so..)
so they create this mock data
object, fill it up by some loop through the epochs object and then average that.
but that's also why it's not really relevant for us - i doubt that we could even set not-preloaded data to nan
easily without larger changes (i assume this info would have to be stored in some meta data and then applied when finally loading at some later point?), so it doenst make sense to implement an averaging function for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not super sure about the second part of my reply, maybe it is easier than i think. still, if we ask data to be preloaded, it doesnt apply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okey, thank you for the explanation, now I finally understand what is going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would add a comment to the compute_aggregate function, it's rather confusing what is actually happening there. The test looks good, but again a few comments would be nice and help the reviewer :)
caac9f4
into
CarinaFo:channel_specific_epoch_rejection
it's a private function, so this is why there isnt any. but i agree that a few hints would help ppl like us :) |
hi @CarinaFo
here my initial revisions that make it work (i think).
main changes:
nanmean
function had to be swapped somewhere else,it's just quick and dirty fixes.. e.g., the test could be much better.
also not sure if we should really change
mean
tonanmean
in the global util function, or whether it makes more sense to allownanmean
as an additional separate option and call it based on a (to be implemented) flag, that epochs were rejected (_check_combine
is only used inepochs.py
andtfr.py
, probably for a similar case, but who knows..).