Skip to content
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

[MRG] Release+brainsprite cleanup #1856

Merged
merged 24 commits into from
Nov 16, 2018

Conversation

kchawla-pi
Copy link
Collaborator

@kchawla-pi kchawla-pi commented Nov 10, 2018

Renames view_stat_map to view_img.
Updates whats new.
@jeromedockes CircleCI has failed twice on this now, because it couldn't read an image. Keep an eye and review this one.

* 'master' of https://github.com/nilearn/nilearn:
  Update nilearn/image/tests/test_resampling.py
  Update nilearn/image/tests/test_resampling.py
  Update nilearn/image/tests/test_resampling.py
  Updated News section of the website nilearn.github.io
  Updated number of commits by contributer
  Changed version from 0.5.0a to 0.5.0b
  Added list of contributors for the alpha release
  Updated whats new & aAdded list of contributors for the beta release
  Simplified the test and fixed an issue previously introduced in the doc.
  Renamed extrapolation parament "fill_value". Added one test.
  Added support for fill value in resampling tools.
* 'master' of https://github.com/nilearn/nilearn: (23 commits)
  ENH: add new test to verify orthogonal filters
  updates changelog to not create circleci error
  update changes with new filter order in clean
  moving change under new release candidate
  standardize confounds after temporal filtering
  updates t_r documentation
  updates changelog
  improve error message in clean function
  prevent overwriting of t_r value
  Adds description text and Lindquist citation
  change order of data manipulation
  Apply temporal filter on confounds if needed
  Move band-pass filter before removing confounds
  Add reasoning to raising error + typo fix
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  add now missing t_r to signal tests
  Adds now missing t_r parameter to tests
  ...
* 'master' of https://github.com/nilearn/nilearn: (26 commits)
  Added a comment explaining the need for an alternate import
  MAINT: address deprecations in numpy
  ENH: add new test to verify orthogonal filters
  updates changelog to not create circleci error
  update changes with new filter order in clean
  moving change under new release candidate
  standardize confounds after temporal filtering
  updates t_r documentation
  updates changelog
  improve error message in clean function
  prevent overwriting of t_r value
  Adds description text and Lindquist citation
  change order of data manipulation
  Apply temporal filter on confounds if needed
  Move band-pass filter before removing confounds
  Add reasoning to raising error + typo fix
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  Improve error message of vol_to_surf when input is wrong
  ...
* 'master' of https://github.com/nilearn/nilearn:
  Allen atlases
  adds doc text to highlight mask and img mismatch
  fixes reference syntax
  change test to almost_equal
  reformats function according to feedback
  Checks that results from clean_img with and without mask is equal
  adds :func: and code-font to text
  remove niimg_3d check for mask_img (will be checked through apply_mask)
  FIX: add optional tag to input parameter
  add mask parameter to clean_img
…Dadi

* 'master' of https://github.com/nilearn/nilearn: (106 commits)
  fix doc line too long.
  Added brief summary of the PR in whats_new.rst
  Removing deprecated argument anat_img at plot_prob_atlas
  Disable `value` when `colorbar=False` in `view_stat_map`.
  Improved error message when improper cut_coords is provided.
  Getting rid of _get_vmin_vmax, which is not used.
  Improving doc and comments, thanks to @KamalakerDadi's feedback.
  Added a `See Also` section to `view_stat_map`.
  Using `_utils.compat._encodebytes` instead of local import for python2/3 compatibility.
  Added `_encodbytes`, mapping to `base64.encodebytes` in python 3 and `base64.encodestring` in python 2.
  Some docs improvement, following up on @KamalakerDadi's suggestions.
  Use _utils.compat to deal with python2/3 compatibility.
  Bug fix in the doc.
  The screenshot for view_stat_map using brainsprite.
  Updated doc / screenshot from the papaya viewer to the brainsprite viewer.
  Updating brainsprite.js to fix a rounding error for `cut_coords` that resulted in broken value being reported in some situations.
  FiX: tests, 3 targets to 2, PEP8 stuff
  FIX: Passing meaningful error when y contains all 1s
  A bunch of improvements, mostly on naming and docstring.
  Added a test that `_get_vmin_vmax` works properly with NaNs in the data.
  ...
… screenshot

 - Renamed test_view_stat_map to test_view_img.
@kchawla-pi
Copy link
Collaborator Author

PR #1766 has already been merged yesterday

@kchawla-pi
Copy link
Collaborator Author

The log for the 3 failed buids, one from the [WIP] I closed, 2 from the new (this one).

I dunno why circleCI has disappeared.
circleci-3builds-log-release+brainsprite-cleanup.zip

@KamalakerDadi
Copy link
Contributor

I dunno why circleCI has disappeared.

What did you made to reappear in #1855

@codecov
Copy link

codecov bot commented Nov 10, 2018

Codecov Report

Merging #1856 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1856      +/-   ##
==========================================
+ Coverage   95.23%   95.24%   +0.01%     
==========================================
  Files         135      135              
  Lines       17320    17320              
==========================================
+ Hits        16495    16497       +2     
+ Misses        825      823       -2
Impacted Files Coverage Δ
nilearn/plotting/tests/test_html_stat_map.py 100% <100%> (ø) ⬆️
nilearn/plotting/__init__.py 82.6% <100%> (ø) ⬆️
nilearn/plotting/html_stat_map.py 98.65% <100%> (ø) ⬆️
nilearn/datasets/tests/test_neurovault.py 97.79% <0%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b5fc46...86dfd01. Read the comment docs.

@kchawla-pi
Copy link
Collaborator Author

Didn't do anything to make it reappear or disappear It just happened on its own.

@kchawla-pi
Copy link
Collaborator Author

kchawla-pi commented Nov 10, 2018

This same PR is running on my CircleCI (albeit failing)

@@ -428,7 +428,7 @@ use :func:`view_markers`.
:func:`view_img_on_surf`: Surface plot using a 3D statistical map::

>>> from nilearn import plotting, datasets # doctest: +SKIP
>>> img = datasets.fetch_localizer_button_task()['tmaps'][0] # doctest: +SKIP
>>> img = datasets.fetch_localizer_button_task()['tmaps'] # doctest: +SKIP
Copy link
Contributor

Choose a reason for hiding this comment

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

Its not longer 'tmaps' but 'tmap'. Push a commit with this change. Perhaps it may reappear.

@KamalakerDadi
Copy link
Contributor

For me I think you should raise a deprecation warning for two release cycles and remove view_stat_map completely.

@kchawla-pi
Copy link
Collaborator Author

Wait, I don't understand. Didn't I replace all references to view_stat_map with 'view_img' in this PR?
Also, view_stat_map was introduced in 0.5.0 alpha. Do we issue deprecation warnings for things introduced in alphas of the current build?

@kchawla-pi
Copy link
Collaborator Author

Phew CircleCI is back. now when it fails we can diagnose it.

@KamalakerDadi
Copy link
Contributor

Didn't I replace all references to view_stat_map with 'view_img' in this PR?

what do you mean ?

Do we issue deprecation warnings for things introduced in alphas of the current build?

Check in the merged PR. It is discussed there

@GaelVaroquaux
Copy link
Member

We never released something that was not a beta or alpha with view_stats_map. So we don't need to go through a depreciation cycle. We should just mention things clearly in the release notes.

Copy link
Member

@GaelVaroquaux GaelVaroquaux left a comment

Choose a reason for hiding this comment

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

Has view_img been added or modified in doc/module/reference.rst?

@kchawla-pi
Copy link
Collaborator Author

kchawla-pi commented Nov 11, 2018 via email

@kchawla-pi
Copy link
Collaborator Author

@GaelVaroquaux Updated whats_new.rst . Review it. If I don't see any problems, I will merge this to master Tuesday evening, and then release.

@kchawla-pi
Copy link
Collaborator Author

kchawla-pi commented Nov 12, 2018

@GaelVaroquaux shouldn't we remove the warning from view_stat_map, now view_img, that it can change without warning and not to use it in production environments?

@pbellec
Copy link
Contributor

pbellec commented Nov 13, 2018

@kchawla-pi just seeing this. I posted a PR to finish the work we discussed on view_stat_map (#1858). I don't think it will conflict with this one. I am busy all of Tuesday, but I will try to merge this PR into the other one on Wednesday.

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented Nov 13, 2018 via email

@kchawla-pi
Copy link
Collaborator Author

kchawla-pi commented Nov 13, 2018

@GaelVaroquaux There are more commits here from the previous release than there should be. I am not sure how they got here, I created this branch from master after merging pbellec's PR.
How do I fix that? Rebase?

@kchawla-pi
Copy link
Collaborator Author

Seems the warning has already been removed by someone else in one of the PRs. Move along nothing to see here.

@kchawla-pi kchawla-pi changed the title Release+brainsprite cleanup [MRG] Release+brainsprite cleanup Nov 15, 2018
@KamalakerDadi
Copy link
Contributor

There is a white spot appears on the screen shot. Could you correct that ?

plotly_surface_plot_notebook_screenshot

@KamalakerDadi
Copy link
Contributor

Also, there is value displaying in the screenshot. Probably, this needs to be corrected as well. A screenshot without value.
view_img_screenshot_notebook

eg for use in a notebook.

- New functions :func:`nilearn.plotting.view_surf` and
:func:`nilearn.plotting.view_surf` and
Copy link
Contributor

Choose a reason for hiding this comment

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

view_surf is repeated for another time.

:func:`nilearn.plotting.view_img_on_surf` for interactive visualization of
maps on the cortical surface in a web browser.

- New functions :func:`nilearn.plotting.view_connectome` and
Copy link
Contributor

Choose a reason for hiding this comment

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

A mention of "Interactive" is missing here in this statement.

- New function :func:`nilearn.plotting.view_img` for interactive
visualization of volumes with 3 orthogonal cuts.

:Note: :func:`nilearn.plotting.view_img` was `nilearn.plotting.view_stat_map` in preview builds.
Copy link
Contributor

Choose a reason for hiding this comment

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

I did understand what you mean by preview here ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alpha and Beta builds

Copy link
Contributor

Choose a reason for hiding this comment

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

Are they builds or releases ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Releases. Will clarify.

----------

:func:`nilearn.plotting.view_img` (formerly `nilearn.plotting.view_stat_map` in
NiLearn 0.5.0 pre-release versions) generates significantly smaller notebooks
Copy link
Contributor

Choose a reason for hiding this comment

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

I used to write L capital in Nilearn. But then I have been taught that I should not write L capital.

---------------

Default value of `t_r` in :func:`nilearn.signal.clean` and
:func:`nilearn.image.clean_img` is now 2.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure it is 2.5. By looking at the documentation it is None.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I repeated what was posted in an earlier What's New (for the alpha or Beta release). Since it had not been brought up again I assumed that it wasn't changed again. My mistake. Will check.

@kchawla-pi
Copy link
Collaborator Author

Also, there is value displaying in the screenshot. Probably, this needs to be corrected as well. A screenshot without value.
view_img_screenshot_notebook

Also it is still showing view_stat_map instead of view_img. Thanks.

@KamalakerDadi
Copy link
Contributor

Also it is still showing view_stat_map instead of view_img. Thanks.

Good catch.


**LOTS of changes and improvements. Detailed change list follows.**

0.5.0 rc
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The enthusiasts who like to install alpha and beta builds would want to know what changed from beta to stable, which is covered under rc. Early testers often hunger for extra details in the change log. Doing these things helps maintain their ongoing engagement, and gives us a steady pool of alpha-beta testers.

The enthusiasts, passionate about Nilearn but not beta testers upgrading from 0.4.2 to 0.5.0 would like to quickly see all the best new things improved and to try out. For that I have an overarching summary, under 0.5.0 .

For many remaining users, they won't care if we don't include a What's New, so this isn't for them at all.

Copy link
Member

Choose a reason for hiding this comment

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

maybe LOTS -> Lots

@@ -329,7 +329,7 @@ def _get_cut_slices(stat_map_img, cut_coords=None, threshold=None):
return cut_slices


def view_stat_map(stat_map_img, bg_img='MNI152', cut_coords=None,
def view_img(stat_map_img, bg_img='MNI152', cut_coords=None,
colorbar=True, title=None, threshold=1e-6, annotate=True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please check this ? Indentation missing.

@jeromedockes
Copy link
Member

LGTM

@KamalakerDadi
Copy link
Contributor

I don't like these kind of import patterns in the screen shots and it is not consistent with demo code. I don't see the necessity of it.

from nilearn import (datasets,
                     plotting,
                    )

@kchawla-pi
Copy link
Collaborator Author

That's the official PEP8 recommendation for multiple imports from a single from source.
I don't think it will confuse the users.
I do think this a good way to showcase small improvements in coding practices.
I am not attached to this, if it should be changed, I'll change it.

 - Changed plotely_surface_plot_screenshot.png to show
 the right side of the right hemisphere with more positive activations
 than the earlier left with more negative activations.
 - Switched to one import per import statement for stylistic consistency.
 - Removed the highlight in a sentence in whats_new.rst. Too much.
@kchawla-pi kchawla-pi merged commit e6e7df0 into nilearn:master Nov 16, 2018
@kchawla-pi kchawla-pi deleted the release+brainsprite-cleanup branch November 28, 2018 08:55
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.

None yet

6 participants