Closed rsokl closed 5 years ago
I'm up for taking matplotlib and I could do basic file I/O. With mpl are you also wanting to talk about loading and saving images, or should that be covered elsewhere or not covered for this?
I like the idea of having string formatting (including f-strings) in here. They're so genuinely useful and make code way cleaner in my opinion.
Including image loading and saving would be good. There isn't too much to cover towards that end. Here is a decent matplotlib reference (although I dislike the guy's formatting and writing style). I do think we should teach all matplotlib stuff based off the fig & axis objects.
That seals it - string formatting should be included. I guess we should be wary of being too complete, which is what bogs the official docs down, and focus on the most practical aspects. f-strings for sure, specifying number of decimal places, the .format
method.
Would you agree that it should be its own sections? It seems like it should, to me.
The only reason I'd be slightly wary of talking about image saving/loading is that there are a lot of ways to save and load images. I think it's worth talking about matplotlib's imsave
and imread
because they're really useful. I'm not sure whether mentioning PIL or any other projects would be valuable too -- maybe as a comment at the end of talking about matplotlib's functionality for images?
I would agree that string formatting should have its own section. I agree with not talking about too much functionality. A simple primer and a link to the documentation should be great.
Yeah, I'd only point the reader to PIL in passing, at most. I think imread/imsave and fig.save/fig.load is all that really needs mentioning
@rsokl #21 adds matplotlib functionality. It probably needs a bit of reorganization to better fit with the rest of the content, but it should cover everything a new user needs to get running. PIL doesn't really seem natural to fit in there and I'm not sure it's necessary. If you want to get into image processing in Python then of course it might be useful. That seems like a topic for a different source or a different module though.
I decided to add my comments to the already open issues as to not clutter it up more than it needs to be.
Overall I thought these were very very useful sections and I will most likely find myself referencing this section more than the rest.
In the opening section pyplot.subplots is colorized red due to the formatting which I thought looked weird because everything else surrounding it is blue.
In the first code snippet in the third comment it should say "we create both a figure and axis object" not "we figure and axis object"
Under plotting and saving a figure it is mentioned that nrows and ncols are keyword arguments yet they got passed without keywords which I thought was a little bit confusing but this might just be me not remembering that exact details of how arguments need to be specified in python.
"On such occasions you can simply" not "On such occasions you can simple"
Additionally, I am curious as to when pickle would be used over numpy's load and save functions? From what I understand, np.save has an argument allow_pickle= True that will automatically pickle the object if it isn't of a numerical type. But when possible this function will also avoid pickling as pickling has security and portability issues making it seem like np.save / np.load is always the way to go.
In the opening section pyplot.subplots is colorized red due to the formatting which I thought looked weird because everything else surrounding it is blue.
:thinking: :confused: where is this? I'm staring at that section going crazy trying to find red things....
Not a big deal or anything I just thought it looked a little strange
I had been using the stylization so that it would be obvious that the reader is seeing code and not a typo
Is adding a numba primer still in the works? If not, this can be closed.
This is inactive and the format
function is already covered; f-strings could fit in there but they're (relatively) minor so I'm going to close this. An f-string-specific issue could be opened if that's a real need.
Precise content to be included here is up for debate
Matplotlib
File I/O
open
context managerpathlib.Path
String Formatting (??)
Basic of modules (??)
__init__.py
and creating your own Python packagesetup.py
template and demonstration ofpython setup.py install/develop