datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists

Home Page:https://datacarpentry.org/python-ecology-lesson

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with check_env.py

MathewBiddle opened this issue · comments

In preparing for my teaching demo next week 😳 I've been reviewing the instructor notes for this lesson and came across two problems with check_env.py.

  1. When I run python check_env.py it fails with the message AssertionError: Anaconda is NOT installed as your default version of Python. Please make sure that is in accordance with the instructions provided.
    1. I think this can be resolved through a PR by adjusting
      assert 'anaconda' in sys.prefix, ("Anaconda is NOT installed as your "
      to indicate Anaconda (note the capital A). As that is now how the structure is created with the Anaconda distribution. There is probably a cleaner way to do this, however I think that will fix for now.
  2. Why is ggplot required for this workshop? Shouldn't that be plotnine?
    packages = ['numpy', 'matplotlib', 'pandas', 'jupyter', 'ggplot']

I can submit a PR to make these changes, if they are appropriate.

As a side note, it might be helpful to provide an environment.yml file in the setup as well. I looked around and couldn't find anything (although there is a lot of material to cover here, so I might have missed it). If it's of interest, this is what I have so far:

name: python-ecology-lesson
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.8
  - jupyter
  - pandas
  - numpy
  - matplotlib
  - plotnine

Which could be built with $ conda env create -f .\environment.yml

Thanks for the report, Mathew. I think we're dealing with a few issues here:

  1. The "Instructor Notes" page isn't the right place for this kind of information. Perhaps, we should move it to setup.md.
  2. _includes/scripts isn't the right place for this script either (it's hard to find). If we want participants to use this script, it should be provided in the ZIP file that we provide on the setup page.
  3. Technically, we don't care if participants use Anaconda or some other IDE that provides the packages we use. We recommend Anaconda because it reduces the amount of instructions we have to provide prior to the workshop. So, if we decide to keep check_env.py, we can discuss removing the "Anaconda" check.

I like your suggestion to add environment.yml -- please feel free to submit a PR if you're still up to it.

The ggplot/plotnine transition happened a while back (in #248). It might be an indication that no one has actually used that script since 2018... 🤔

Addressed in #493.