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

Modify to replace initial section regarding Python variable assignmen… #417

Open
wants to merge 2 commits into
base: gh-pages
from

Conversation

Projects
None yet
4 participants
@markcmiller86

markcmiller86 commented Oct 11, 2017

  • Replace initial section regarding Python variable assignment with review of some shell commands to browse contents of inflammation data files and orient learners with that data.
  • Introduce concept of Python variable and assignment as part of the numpy.loadtxt() command.
  • Explain that Python is powerful both as a language and as a set of community developed libraries.
  • Explain that lesson begins with libraries and not language.

Longer rationale...the lesson begins with somewhat arbitrary step of defining and assigning a python variable for weight_kg and weight_lb. There is significant space used elaborating on Python variables and assignment here but without any connection to the dataset to be analyzed. I felt the concept of varaible assignment is easily handled at the time numpy.loadtxt() is being introduced. I include a couple of lines elaborating that concept there.

Beginning the lesson with a review of shell commands makes the lesson dovetail nicely with shell lesson (which is often taught ahead of this python less in the shell, python git trio). More importantly, it allows learners to underestand and orient themselves with the data in the files they are loading into Python so that once there, they cann connect the dots back to what they see through head shell commands, etc.

Finally, previous revision offered little in the way of explanation that this lesson really starts in the deep end of python in the sense that learners are first being exposed to library functionality before they learn much of the basic language. I felt it was important to explain this and motivate it slightly.

markcmiller86 added some commits Oct 11, 2017

Modify to peplace initial section regarding Python variable assignmen…
…t with

review of some shell commands to browse contents of inflammation data files.
Introduce concept of Python variable and assignment as part of the
numpy.loadtxt() command. Explain that Python lesson begins with *libraries*
and not *language*.

@markcmiller86 markcmiller86 changed the title from Modify to peplace initial section regarding Python variable assignmen… to Modify to replace initial section regarding Python variable assignmen… Oct 11, 2017

@valentina-s

This comment has been minimized.

Contributor

valentina-s commented Oct 21, 2017

Thanks a lot for the proposed modifications.

The shell commands provide a good review but I feel like they will take a lot of time, and this lesson is already extremely long. I think a quicker approach to this is to ask the students to look at the file (with cat, nano or their favorite editor) so that they have an idea of what is inside. This could be done when the .csv files are introduced. Thus we will keep the prerequisites of the lesson to minimum (in case it is taught without a shell lesson).

I am reluctant about completely removing the simple variable discussion, although I agree it is disconnected from the dataset. It may really hurt the people who have never programmed before. I have personally seen beginners struggling with the later exercises because they do not fully understand what is stored where. I think the example with the relationship between the units aims to explain the difference with variables in Excel (which get linked by the assignment operator). It will be great if we have an example of converting some units related to the inflammation dataset: but what are the units there??? Would you be interested in coming up with such an example? Maybe a biologist can help out here.

I am ok with adding explanation of the approach to teach Python. Agree that the word analogy might not be that clear, but I would leave some short explanation of what a library is geared toward complete beginners (a toolbox of specialized tools?). Some of the motivation can be added to the intro section: http://swcarpentry.github.io/python-novice-inflammation/. I think the existence of powerful Python tools can be a bullet point by itself. What do you think?

I will mark the PR for discussion for now to get suggestions from others. It is best to submit individual changes in separate PRs.

@tbekolay

This comment has been minimized.

Contributor

tbekolay commented Oct 24, 2017

One thing that I worry about in regards to this change is that Software Carpentry (as far as I remember) does not require that you teach the shell lesson before this lesson; and, even if it did, we do not list the shell lesson in our prerequisites:

Learners need to understand the concepts of files and directories (including the working directory) and how to start a Python interpreter before tackling this lesson. This lesson references the Jupyter (IPython) Notebook although it can be taught through any Python interpreter. The commands in this lesson pertain to Python 3.

or on our setup page.

Further, I see this lesson as also being a useful resource for people learning online; it should be able to stand on its own as a useful introduction to Python without necessarily needing to know a lot about the shell.

I do agree that we do not introduce the inflammation data well, so more explanation of it is warranted, but perhaps not at the expense of variable assignment, though I agree that it is a slightly awkward thing to discuss in this topic.

It would be great to have all these changes in separate PRs so that we can discuss them separately 👍

@markcmiller86

This comment has been minimized.

markcmiller86 commented Oct 24, 2017

Regarding shell as a prerequisite for python, I agree thats an issue with this PR as it winds up making shell a prerequisite where before it may not have been. That said, in almost all of the contexts in which I have participated in SC teleconferences so far, I always see the trio, Shell, Git and Python packaged together. I know that isn't always the case but it seems pretty common, at least to the casual observer. In that context, it seems like a really good fit. On a related point, while I don't have a feel for this myself, I wonder how many python learners are likely to be shell-savvy?

Is there any way to support optional, parallel scenes in an episode? If this or the original content were available as separate, selectable intro scenes, then instructors would have the option of choosing which might be the best for their training.

Regarding putting all these changes in sparate PRs...I think the challenge there is understanding what everyone might regard as a separable change. I mean, is a saparate change an individual line, a paragraph, a whole sub-section or what? Another related issue is whether the merged result can still make sense if only some of those PRs are actually accepted? In general, I think it would be hard to craft this change into multiple PRs such that any combination of those accepted still winds up making sense and good flow. Finally, that represents a non-trivial amount of additional work for someone like me who is trying to contribute and submit such changes.

If we forgoe the shell-based intro, I almost think it makes the most sense to still start the lesson talking about python as a language and python as a set of libraries and then begin the concept of variable assignment with numpy.loadtext() storing the result of an operation performed by a library and maybe after that, saying a few more details about variables with some examples.

@tbekolay

This comment has been minimized.

Contributor

tbekolay commented Oct 25, 2017

I agree that the Python lesson almost always comes after the shell lesson in SWC workshops, but that doesn't help those that are looking at the lesson online outside of an SWC workshop context. While it might be hard to believe, I would guess that far less than half of Python users are shell-savvy. Most people use Windows, which requires some special effort to install a Bash shell, and even more effort to use that Bash shell effectively since most Linux programs can't be easily installed. I would guess that most people use Python through an IDE or only in the notebook environment through Anaconda.

I don't believe there's any precedent for alternative parallel paths through an episode... it sounds like a cool idea if it were implemented well, but I do wonder if it's just as effective to fork this lesson as another way to provide an alternative.

@markcmiller86

This comment has been minimized.

markcmiller86 commented Oct 25, 2017

@tbekolay ...but I do wonder if it's just as effective to fork this lesson as another way to provide an alternative.

Can you point me to examples of where providing alternatives is handled? I mean, is there precedent for this already and if so, how is it handled? And, are such alternatives affiliated with SWC or something else? Finally, can you suggest any alternative lighter weight approach than maintaining a separate fork of the entire lesson?

@valentina-s

This comment has been minimized.

Contributor

valentina-s commented Nov 6, 2017

Unfortunately, we do not have an existing infrastructure for handling alternative versions. We have discussed allowing for adding extra examples or discussions within the extras section:
https://github.com/swcarpentry/python-novice-inflammation/tree/gh-pages/_extras.

One possibility is to create a supplementary.md file and put the shell-to-python transition section in it. We can link to it from the instructors note as additional resources. Clearly, it will be hard to ensure that this will stay synchronized with the lesson, but it can be aimed at instructors who might decide that this approach is more appropriate for their audience.

@maxim-belkin maxim-belkin force-pushed the swcarpentry:gh-pages branch from 4753644 to 90848ea Oct 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment