-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Convert plots in Spline example to matplotlib #238
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@tjburch Thank you for doing this! The plots look great and I’m sure the maintainers will be pleased that someone took care of this. |
thanks for the PR! I don't have time to review now but wanted to leave two quick comments. Can you also add a link in the description to the relevant tracking issue? #234 And add a post directive to the notebook so it can be found via tags? https://github.com/pymc-devs/pymc/wiki/PyMC-Jupyter-Notebook-Style-Guide#post-directive |
@OriolAbril - added the link, will get to the post directive ASAP. Traveling the next couple of days so might be Tuesday before I get to it, sorry for the delay. |
Added in latest commit |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:55Z All pymc classes used should be added as tags. If you install pre-commit, it will automatically update the tags with all classes used (in a similar way, it checks that all classes are present as tags, now that I have approved and run the CI checks you can see it's failing because of that). I would also use
tjburch commented on 2021-10-13T23:47:03Z Done. Just did classes, not methods (e.g. not |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:56Z I would make this use tjburch commented on 2021-10-13T23:47:19Z Done. |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:56Z what do you think about hiding this output so that it can be toggled if desired but hidden by default? I'm not sure seeing all this text will mean anything to users, especially if targetting the notebook to beginners.
reference: https://myst-nb.readthedocs.io/en/latest/use/hiding.html#hiding-code-cells, https://jupyterbook.org/content/metadata.html and https://discourse.jupyter.org/t/how-to-edit-cell-tags-in-jupyter-lab/4419 tjburch commented on 2021-10-13T23:49:18Z I think I did this correctly, let me know if not. Output still showing in the github rendering and reviewnb. OriolAbril commented on 2021-10-14T00:59:43Z it is supposed to still appear in both github and reviewnb, it is when rendered into the html docs with sphinx that the toggle thing is taken into account.
As you can see from the preview: https://pymc-examples--238.org.readthedocs.build/en/238/splines/spline.html (also accessible via the checks in the PR, click on details and search for splines for example to find the notebook) the toggle thing is working.
What is not working are the tags, you'll see that splines or patsy don't appear. Please make sure that the directive is on the first cell and that each colon fence and metadata field are on their own line just like in the example: https://github.com/pymc-devs/pymc/wiki/PyMC-Jupyter-Notebook-Style-Guide#post-directive |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:57Z Line #7. color = plt.cm.rainbow(np.linspace(0, 1, len(spline_df.spline_i.unique()))) can you try a different colormap? I have a bit of trouble seeing colors 7-10 tjburch commented on 2021-10-13T23:51:25Z Tough to find a colormap that doesn't include yellow to some effect. Went with one that covered a few colors, and then iterated over the space of the colormap that didn't include yellow (so |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:58Z can you use named coords and dims to define the shapes? tjburch commented on 2021-10-13T23:52:03Z Done. Haven't done a ton of models this way yet, but I think it's correct, let me know if otherwise. |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:58Z can you add a cell with watermark as title instead? this way it will appear in the toctree on the right sidebar in case users want to check it out before reading/running the notebook. |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-13T04:07:59Z patsy doesn't appear even though it's imported, can you add it manually like with xarray and theano? |
Thanks! I have commented a few nits, nothing too significant It is also great that you have added yourself to the notebook, like @jhrcook did. As not everybody does, we were thinking about adding that the the style guide and setting a common style for it, both of you for example have not linked to your github profile now website like other authors do. If you can it would be great to have your opinions and preferences at #198 which is where we are discussing this. |
Done. Just did classes, not methods (e.g. not View entire conversation on ReviewNB |
Done. View entire conversation on ReviewNB |
I think I did this correctly, let me know if not. Output still showing in the github rendering and reviewnb. View entire conversation on ReviewNB |
Tough to find a colormap that doesn't include yellow to some effect. Went with one that covered a few colors, and then iterated over the space of the colormap that didn't include yellow (so View entire conversation on ReviewNB |
Done. Haven't done a ton of models this way yet, but I think it's correct, let me know if otherwise. View entire conversation on ReviewNB |
Made a comment over on #198 that you've already seen. I went ahead and adapted the authorship comments here to reflect the 3rd option mentioned on that issue. |
View / edit / reply to this conversation on ReviewNB tjburch commented on 2021-10-14T00:16:27Z It's unclear to me why this isn't rendering in reviewnb as a title, despite being a md cell with OriolAbril commented on 2021-10-14T01:06:07Z reviewnb can sometimes be a bit buggy. It is working on the preview: https://pymc-examples--238.org.readthedocs.build/en/238/splines/spline.html?highlight=spline#watermark |
it is supposed to still appear in both github and reviewnb, it is when rendered into the html docs with sphinx that the toggle thing is taken into account.
As you can see from the preview: https://pymc-examples--238.org.readthedocs.build/en/238/splines/spline.html (also accessible via the checks in the PR, click on details and search for splines for example to find the notebook) the toggle thing is working.
What is not working are the tags, you'll see that splines or patsy don't appear. Please make sure that the directive is on the first cell and that each colon fence and metadata field are on their own line just like in the example: https://github.com/pymc-devs/pymc/wiki/PyMC-Jupyter-Notebook-Style-Guide#post-directive View entire conversation on ReviewNB |
reviewnb can sometimes be a bit buggy. It is working on the preview: https://pymc-examples--238.org.readthedocs.build/en/238/splines/spline.html?highlight=spline#watermark View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-10-14T01:07:54Z cool! I would also add a title of level 2 like in references or watermark so at least from the top there is the |
Thanks for the info on that, sorry for the post-directive error - fixed that and added the Authors title. |
Thanks for the PR @tjburch ! |
I noticed in the (very well done!) spline example from @jhrcook added in #232 that plots were not in Matplotlib, but following the PR it seemed the preference was for matplotlib for ease of maintenance over time. I went ahead and converted the figures to matplotlib.
Aside from the matplotlib changes, the lowess and knot-based lm portions had to be implemented in
statsmodels
before plotting, since those aren't available directly in mpl.Tracking issue: #234