Issues encountered teaching classes with Julia for the first time

I’d suggest using a portable Julia with its own depot. That is your reset button.

4 Likes

Yes, I like Pluto, but couldn’t cope with the ‘reactive’ aspect for my Data Science projects. I asked the Pluto devs to consider allowing ‘static’ as an option, but they were very much against this, so I forked a ‘static’ version, called it ‘Neptune’ and (with homage to Pluto) made it available. My students like it. Maybe the Pluto devs. will eventually add a ‘static’ option as well (or already have?).

3 Likes

Hi. Thanks. That sounds promising.

Do you have a link for learning about that?

I’m not sure what the problem is in each case, but a possible solution might be to pin down all versions somehow:

I tend to install a LOT of packages to experiment (like a curious student might do), and maybe that’s my problem (doing something wrong? should use environments?), and if it downgrades (or even upgrades) packages, it can be a problem.

You might want to be aware of the preserve option (that apparently there didn’t work…):

(@v1.6) pkg> add --preserve=all Stipple
   Updating registry at `~/.julia/registries/General`
######################################################################## 100,0%
  Resolving package versions...
  Installed p7zip_jll ─ v16.2.1+1
Downloading artifact: p7zip
No Changes to `~/.julia/environments/v1.6/Project.toml`
Updating `~/.julia/environments/v1.6/Manifest.toml`
  [3f19e933] ↑ p7zip_jll v16.2.1+0 ⇒ v16.2.1+1

Without it (and I often forget) I tend to get upgrades, but also downgrades… often to VERY old versions. Sometimes, such as for Stipple, you need some old version (for demos), and sometimes you need the latest or master. It’s usually not a problem (I think!) except for such WIP packages.

Possibly the GR issue you is the defunct problem I had, see here:

3 Likes

Hi Thanks for that. I think these students are mostly on Windows, and the issues they are having I have not recently experienced myself on Mac or LInux. Where can I learn about ‘chocolatey’?
Thanks!

1 Like

This is what I use:

2 Likes

Chocolatey is a package manager for Windows, similar to apt or yum from the Linux world or Brew from Mac

I think the simplest way would be to have a JupiterHub server where you set up the necessary packages for the students (I use a medium-power server where I load the necessary packages in a script that is executed when I add the user with adduser… with 20 students is ok…).

My biggest problem, by teaching applied problems where Julia is used to run computational example/applications to students on their last year, is that in the previous years the students already had courses in R and Python or in subjects where the teacher was using them, and their approach is “aargh, yet an other programming language to learn, can we not use what we already know ?” :-/

16 Likes

Yes, the same here, and I was just starting to win them over when alot of students started having the issues I described above, and the combination of these two things has made life very difficult for me (you wouldn’t want to be me at the moment!)

3 Likes

A basic issue here is that ensuring smooth software installation for a large class, on a large variety of systems (that might be old or weird in various “creative” ways) is hard. Especially when you are combining lots of different software packages together (e.g. IJulia requires Julia and a working and compatible Python+Jupyter installation with lots of ancillary software). Software-engineering courses combat this by having a small army of computer-savvy TAs (which is not typically available in a non-CS class), plus if you are using something familiar like Python then the students have many peers who are experts and can help.

The best solution in the long run at universities is to have a local jupyterhub/binderhub server or similar, so you can just point students at a URL and then they run everything in the cloud in a “clean” software environment that is the same for everyone.

When I’ve taught large (150–200) classes in the past with Julia, I used juliabox.com, but that is no longer a free service. Currently, I’m encouraging them to install locally if they can, but use mybinder.org as a fallback: GitHub - mitmath/julia-mit: Tutorials and information on the Julia language for MIT numerical-computation courses.

24 Likes

You mentioned Jupyter/IJulia I don’t have any experience with those but your comment about resetting the environment make me think about docker. Granted this is another software package that you could end up having issues with :slight_smile: but it does make it really easy to restart the environment.

https://hub.docker.com/_/julia

$ docker run -it --rm julia

Or running a script on your machine:

$ docker run -it --rm -v "$PWD":/usr/myapp -w /usr/myapp julia julia script.jl arg1 arg2

These would work on a Linux host arguments might be different on a Windows host. The --rm tells docker to destroy the machine after you exit, which means you get a clean environment every time.

You could not pass the --rm and name the docker container so you can save the environment if the pre-compilation is too much, there would be additional commands to destroy/recreate the container if you wanted to clean out the environment. It’s an option you might want to investigate.

1 Like

Adding to what Jordan said, the first thing to do after installing chocolatey is to install the GUI:

choco install chocolateygui

I assume most of his users are Windows users and Docker on Windows is…painful to say the least. Virtually everyone who uses Docker on Windows does so with WSL which is then yet another can of worms to open up. (And at that point you can install Julia in the WSL subsystem to avoid some of the Windows issues anyways).

2 Likes

For remote use of Julia for a lab class, we offer a binder image. As our package usages are not open-ended, we can make a fairly tidy image which loads quickly. (E.g., we use SimplePlots, not Plots because it loads faster, though that will change once 1.6 is supported.) Binder has the issue of limited resources and a timeout with 10 minutes of inactivity. However, encouraging students to get an account on notebooks.gesis.org allows these limits to be bumped up quite a bit for little extra effort.

We have also provided a Docker image, which I personally use so that my setup matches the students. I don’t know that any students have used it, though it works quite easily on my Mac.

Some students will install everything locally, but in practice, that is often a bit more bumpy than it should be.

1 Like

Can you give some more detail about this? How do you instruct students to install Julia and the packages they need? And what do you ask them to do? And what kinds of things go wrong?

4 Likes

Hi. Thanks, That sounds promsing. I’ll try it out.

The evidence for the latest (most serious) issue is that students installed a couple of packages which broke all of their other installed packages. I’m trying to isolate which package(s) they installed.

1 Like

I received very bad “teaching scores” last year, and the open-questions in the survey made it clear that the main problem was in having used an odd language nobody knew about… but this made me thinking on the real utility of these kind of surveys… after all, what the students know on what they will need in their (hopefully long) professional carrier ? Yes, they are not CS students, but I honestly thought that showing them how to solve their domain specific problems using a modern programming language and exposing them to it was the best thing I could do for them and their professional future, even if the kind of stuff that I taught could have been done in Excel if one wants.

Indeed this year I did the course in Excel (I made a survey before the course asking them, Excel won) and the students have been happy, sic :-///

8 Likes

You can check with st what versions work for you, and make up a command with all the packages and versions (just an example):

(@v1.6) pkg> add --preserve=all Stipple@v0.6.0 ShiftedArrays@v1.0.0

If the install changed some dependency before, by forcing some versions you know should work, you should get an error with the packages. Or at least I think something like this should work, possibly excluding if you need #main or #master for some package.

ultimately led to the bank to declare $6 billion in losses and could lead to another $600 million in fines. As James Kwak explains on Baseline Scenario, the errors stemmed from a combination of copy-paste mistakes and a faulty equation created to crunch the numbers.

while Excel the program is reasonably robust, the spreadsheets that people create with Excel are incredibly fragile.

3 Likes

Wouldn’t the problem be partly solved by providing an environment with pinned packages? This will not solve all problems but the OP was mainly concerned about what happens if the package landscape is moving during the course. I would argue that the course does not need to follow package changes.

9 Likes