Closed valentineap closed 6 years ago
Reviewed, it's good for a starter.
By the way, do you want to speak of class() at some point?
I agree with @charlesll that classes (and objects in general) should probably appear here... although perhaps this will be covered conceptually in the lectures, rather than part of a prac?
Also, is this the right time to introduce paths? In the module text it talks about using them to store functions that are used by lots of code, so perhaps this might be expanded to explain how these other bits of code can access the function?
Maybe this could be done by them starting to create their own library at the root level of their workspace? They could then develop this through the rest of the pracs, adding sub-libraries and modules as appropriate? As part of this, they would have to add their root directory to their path to access it.
@charlesll I think classes need to be later in the course; one can get a long way without really understanding them, and at this point in the sequence of practicals there are more important things to cover. However, I intend it to appear in a later practical...
@oscarbranson Anyone know how paths manifest themselves in the jupyter.rses.anu.edu.au environment? I don't think there is user-level control on this...
Probably another one ready for @rmcgirr94
@valentineap Not sure... but might be useful to include a snippet like:
import sys
sys.path.append('~/mymodule`)
import mymodule
Which gets across the idea that Python needs to know where to look, if you want to import something.
Tested, no major changes, just fixed a couple of typos. Closing issue.
Modules
https://github.com/valentineap/ComputationalGeoscienceCourse/tree/master/Practicals/Exercise%2010%20-%20Modules