Skip to content

FIX: Return figure handle in plot_drop_log - #1398

Merged
agramfort merged 6 commits into
mne-tools:masterfrom
mainakjas:fix_drop_log
Jul 2, 2014
Merged

agramfort merged 6 commits into
mne-tools:masterfrom
mainakjas:fix_drop_log

Conversation

@mainakjas

Copy link
Copy Markdown
Contributor

I removed the return parameter perc since it wasn't being used anywhere.

Comment thread mne/viz.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outch... this breaks backward compat

@Eric89GXL any opinion?

maybe we can return both perc + fig ? @mainakjas would that help?

shall we create a drop_stats method to get this perc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perc + fig is fine with me.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) when pulling b0a93fd on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) when pulling c8b67bd on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

@larsoner

larsoner commented Jul 1, 2014

Copy link
Copy Markdown
Member

I can live with this change since it could be considered a bugfix :)

Comment thread mne/viz.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't do this. It will break my code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the solution then? should we have a return_fig parameter as input which defaults to False and returns both perc and fig if True, otherwise returns only perc?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

I would agree with @Eric89GXL that returning fig would be more consistent...

would it break just your code or code you gave to someone?

to get the perc about a drop_log_stats() method?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for drop_log_stats()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not the only one using it, then +1 for proper deprecation: 1) have return_fig=True mean return only the figure, 2) have False (default) give a deprecation warning, 3) add drop_log_stats() method (which I think would only really be a list comprension, but that's fine). WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for deprecation. @mainakjas be brave :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for deprecation too. Just realize that the function did not return fig on master ... so no code broken for me. So only return fig and perc goes in another method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for deprecation too. Just realize that the function did not return fig on master ... so no code broken for me. So only return fig and perc goes in another method

you mean no deprecation then? I don't follow

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well this function should not return perc but a figure. we need to change that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so no deprecation but bug fix?

@mainakjas

Copy link
Copy Markdown
Contributor Author

I added deprecation warning + drop_log_stats. The only issue is that _drop_log_stats couldn't go in epochs.py since I was facing a circular import problem if I tried to import it in viz. So, I have put it inside viz.py.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) when pulling fd9fafc on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) when pulling fd9fafc on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

Comment thread mne/viz.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block is overindented

@mainakjas

Copy link
Copy Markdown
Contributor Author

ok, comments addressed.

Comment thread mne/epochs.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should mention that it will default to true in 0.9 and then be removed.

@agramfort

Copy link
Copy Markdown
Member

that's it. Then +1 for merge

@mainakjas

Copy link
Copy Markdown
Contributor Author

ok done !

Comment thread mne/tests/test_epochs.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did I miss this pep8 error :)

float(2) -> 2.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-2.13%) when pulling 27ce573 on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

agramfort added a commit that referenced this pull request Jul 2, 2014
FIX: Return figure handle in plot_drop_log
@agramfort
agramfort merged commit 4fff517 into mne-tools:master Jul 2, 2014
@agramfort

Copy link
Copy Markdown
Member

thanks @mainakjas !

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.01%) when pulling 1de03dd on mainakjas:fix_drop_log into 49b04a8 on mne-tools:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants