MDAnalysis / membrane-curvature

MDAnalysis tool to calculate membrane curvature.
https://membrane-curvature.readthedocs.io/
GNU General Public License v3.0
29 stars 6 forks source link

Added ipynb tutorial #64

Closed ojeda-e closed 3 years ago

ojeda-e commented 3 years ago

This PR fixes #63

I would appreciate some feedback for this tutorial while I finish the other two notebooks. @lilyminium @orbeckst @richardjgowers @IAlibay

Thanks!
Edit: I forgot to mention I couldn't manage to make the NGLwidget render, so I ended up adding the png files of the widgets. Hope that works as an alternative.

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

codecov[bot] commented 3 years ago

Codecov Report

Merging #64 (694ca43) into main (0cafcc3) will not change coverage. The diff coverage is n/a.

ojeda-e commented 3 years ago

Hmm. I don't see the review comments I left on the notebook, either here or ReviewNB, so... hope they got through. I was mostly asking for clarification on things like why you chose wrap=True and the number of bins -- imagine a new PhD student has been emailed your notebook from someone else, and has not been following along this project or been doing membrane research a long time :-)

Oh no. I didn't get any of the reviews. As you said, neither on ReviewNB nor here on git. Arf. Thanks for those points. I'll add them with the nbextension added to the requirements. I completely missed adding that file in the push, silly me.

Regarding the NGLView visualization. Do you mean it doesn't even render for you in your browser, or that it doesn't render on ReviewNB? I don't believe ReviewNB will ever render it, as it doesn't support JavaScript; however, if you can get ReadTheDocs to build, you could view the widgets there.

I mean, I can see it on my notebook, but not on the rendered docs. Maybe this is what I missed:

After you have rendered the NGL widgets and see it in your notebook, you then need to click Widgets > Save Notebook Widget State for the widget to get saved into the notebook. That way Sphinx and ReadTheDocs will be able to make the interactive viewer for you.

Thanks @lilyminium !

pep8speaks commented 3 years ago

Hello @ojeda-e! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2021-08-19 16:45:13 UTC
orbeckst commented 3 years ago

I added comments at https://app.reviewnb.com/MDAnalysis/membrane-curvature/blob/issue63/docs/source/pages/Curvature_membrane-only_systems.ipynb/

EDIT: It's a bit weird that the comments in https://app.reviewnb.com/MDAnalysis/membrane-curvature/blob/issue63/docs%2Fsource%2Fpages%2FCurvature_membrane-only_systems.ipynb%2F/discussion are in reverse order so comments on the last part of the notebook are first.

orbeckst commented 3 years ago

@lilyminium please write a blog post with the "embedding nglview howto" https://github.com/MDAnalysis/membrane-curvature/pull/64#pullrequestreview-726642879 so that I can search it when I need it...

lilyminium commented 3 years ago

Having looked into that rotation state not persisting when the notebook is turned into HTML, I think it's just not being saved in the metadata. I've asked Hai about it here: https://github.com/nglviewer/nglview/issues/948#issuecomment-898121063

It's also not showing up in the ReadTheDocs check, though. You might need to either save your widget states again, or maybe add nglview into the docs/requirements.yaml?

lilyminium commented 3 years ago

Hai suggested using your mouse to drag it a little (or drag it out and back again). This triggers the widget into updating the rotation state. When I did that on the notebook, saved the widget state and ran make html, the rotated view of the box rendered properly.

ojeda-e commented 3 years ago

Thanks @orbeckst and @lilyminium for all your suggestions, comments and help with the widgets. It works locally as suggested in this comment, so thanks @lilyminium for keeping an eye on this!

I think the changes in the new version of the tutorial are substantial. Some of the changes include:

I just want to add a couple of comments here:

lilyminium commented 3 years ago

@ojeda-e does adding ipywidgets and nglview to requirements.yaml solve the issue?

ojeda-e commented 3 years ago

@ojeda-e does adding ipywidgets and nglview to requirements.yaml solve the issue?

Yes!, thanks!

ojeda-e commented 3 years ago

Thanks @lilyminium for your help to make my widgets work in the tutorial! The first tutorial was updated and it's ready for review. Maybe @orbeckst can take a look as well :)

Thanks

review-notebook-app[bot] commented 3 years ago

View / edit / reply to this conversation on ReviewNB

lilyminium commented on 2021-08-19T03:33:55Z ----------------------------------------------------------------

Do these dimensions change over the trajectory? Even if they don't, maybe you should explicitly address this as it's important in setting the grid bounds of the analysis.


ojeda-e commented on 2021-08-19T16:29:06Z ----------------------------------------------------------------

Thanks, that's a good point. Added now :)