-
Notifications
You must be signed in to change notification settings - Fork 60
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
PEP8 and black #34
PEP8 and black #34
Conversation
Indeed impressive 😄. You could save even more with non-executed notebooks … which would also make changes tractable; otherwise I’m not sure that it’s reasonable to go through this line-by-line 😆 |
But out of curiosity: would SVG images be more economical to save than png? |
Yah, reviewing these PRs is super hard. I don't think this really needs a review, unless we want to bikeshed about Black's formatting style. I'm posting it here mainly to have a place to discuss anything that might come up, and so there's some record of this happening aside from the commit messages, even if I hit the big green button myself 😄 I executed everything so I know it all works, and so that it would show up in the static view on GitHub itself. The website build runs the Notebooks (I think), so that's fine.
I'm not sure, possibly. But I don't know how to generate those automatically with a magic like |
I believe there’s this magic … not sure though as I just ‘borrowed’ this from some recent notebook from our group
|
FYI, you can comment/review the Notebooks in this PR over here: https://app.reviewnb.com/Cantera/cantera-jupyter/pull/34/ |
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 mainly had a cursory look and as this is mostly formatting this looks good to me. (Fwiw, if we want to update content of individual notebooks, this is probably not the place.)
So I overall have no issues with adopting as is (although it would be great if the issues I pointed out in Cantera/cantera-website#171 could be addressed. Notably, the LaTeX formatting glitch in equations_of_state.ipynb
doesn't show up here, which is odd).
@bryanwweber ... I cannot reproduce the LaTeX artifacts, so from my perspective it's ok to |
👍 I'm planning to add those few fixes plus the fix for |
@bryanwweber - Unless whatever other changes you want to make are as pervasive as these, can we handle them in a separate PR? Otherwise, waiting on this makes any other PRs against this repo impossible without running into merge conflicts. Also, any additional changes made in this repository will be difficult to review for the same reason. |
@speth sure, the other changes can go in a new PR. This is ready for review then, or merging if it's good. |
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.
Having to switch to %matplotlib inline
is a little disappointing -- I think the figures end up looking a lot worse than they do with the notebook or widget backends, but I'm also seeing the issue with restoring plots in a saved notebook. Two things that would improve things are
- setting
plt.rcParams['figure.dpi']
to a higher value than the default of 72 -- maybe 96 or even 120 since the figures are pretty tiny by default. - Using @ischoegl's suggestion of
%config InlineBackend.figure_formats = ['svg']
. On high-DPI displays, this seems to result in much crisper figures than the PNG images that end up looking fuzzy after they get blown up.
For once I'm OK with running black
on the repository -- I think these notebooks have been harder to keep consistent formatting in, and I'd say the result here is clearly an improvement.
Thanks for the review @speth! I'm out of town for the weekend, so if you want to push one of those options to this branch, please feel free. Otherwise, I'll pick it up on Monday. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@speth I updated based on your suggestions! Figures look much better now. |
Too bad that figures don't render on ReviewNB (I checked only one of the files though) ... per discussion elsewhere, I hope that display works as intended once things are uploaded to GH / embedded in the website. |
I just tested this with a local checkout of both the |
%matplotlib inline
because:%matplotlib notebook
and I found the recommended replacement%matplotlib widgets
to be unreliable in terms of showing up after I closed the notebook