Skip to content

Commit d7833bc

Browse files
zkamvarCarpentries Apprentice
authored and
Carpentries Apprentice
committed
[custom] fix lesson contents
1 parent 88849ad commit d7833bc

File tree

7 files changed

+125
-56
lines changed

7 files changed

+125
-56
lines changed
File renamed without changes.

episodes/files/scripts/check_env.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Author: Hugo Bowne-Anderson
2+
3+
import sys
4+
from pkgutil import iter_modules
5+
6+
7+
# Thanks @ericmjl for function below.
8+
def check_import(packagename):
9+
"""Checks whether a package is installed"""
10+
if packagename in (name for _, name, _ in iter_modules()):
11+
return True
12+
else:
13+
return False
14+
15+
all_checks_passed = True
16+
17+
# Throw error if Anaconda is not default Python
18+
assert 'anaconda' in sys.prefix.lower(), ("Anaconda is NOT installed as your "
19+
"default version of Python. Please "
20+
"make sure that is in accordance "
21+
"with the instructions provided.")
22+
23+
# Throw error if Python 3 is not default Python
24+
assert sys.version_info.major >= 3, 'Please install Python 3!'
25+
26+
# Packages necessary for workshop
27+
packages = ['numpy', 'matplotlib', 'pandas', 'jupyter', 'plotnine']
28+
29+
# Throw error if any of the necessary packages is not installed
30+
for p in packages:
31+
assert check_import(p),\
32+
("{0} not present. You may have installed a subset of the"
33+
"required distribution. Please install the entire Anaconda"
34+
"distribution").format(p)
35+
36+
if all_checks_passed:
37+
print("All checks passed. Your Anaconda installation is up and "
38+
"running and ready for Data Carpentry!")
39+

instructors/instructor-notes.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ encounter setup issues, please file an issue with the tags 'High-priority'.
1111

1212
## Checking installations.
1313

14-
In the [`_includes/scripts`](https://github.com/datacarpentry/python-ecology-lesson/tree/gh-pages/_includes/scripts) directory, you will find a script called check\_env.py This checks the
14+
In the [`episodes/files/scripts/check_env.py`](../episodes/files/scripts/check_env.py) directory, you will find a script called check\_env.py This checks the
1515
functionality of the Anaconda install.
1616

1717
By default, Data Carpentry does not have people pull the whole repository with all the scripts and
@@ -74,7 +74,6 @@ rev[2] = "apple-sauce"
7474
In Pandas prior to 0.18.1 there is a bug causing `surveys_df['weight'].describe()` to return
7575
a runtime error.
7676

77-
7877
::::::::::::::::::::::::::::::::::::::::::::::::::
7978

8079
### Dataframe Challenges
@@ -340,7 +339,7 @@ weight 3266
340339
### Writing Out Data to CSV
341340

342341
If the students have trouble generating the output, or anything happens with that, the folder
343-
[`sample_output`](https://github.com/datacarpentry/python-ecology-lesson/tree/gh-pages/sample_output)
342+
[`sample_output`](https://github.com/datacarpentry/python-ecology-lesson/tree/main/sample_output)
344343
in this repository contains the file `surveys_complete.csv` with the data they should generate.
345344

346345
## 05-merging-data
@@ -750,8 +749,6 @@ plt.show()
750749

751750
[This page][matplotlib-mathtext] contains more information.
752751

753-
754-
755752
## 09-working-with-sql
756753

757754
### Challenge - SQL
File renamed without changes.

learners/reference.md

+25-26
Original file line numberDiff line numberDiff line change
@@ -4,104 +4,103 @@ title: 'Glossary'
44

55
## Glossary
66

7-
{:auto\_ids}
8-
0-based indexing
7+
[0-based indexing]{#based-indexing}
98
: is a way of assigning indices to elements in a sequential, ordered data structure
109
starting from 0, i.e. where the first element of the sequence has index 0.
1110

12-
CSV (file)
11+
[CSV (file)]{#csv-file}
1312
: is an acronym which stands for Comma-Separated Values file. CSV files store
1413
tabular data, either numbers, strings, or a combination of the two, in plain
1514
text with columns separated by a comma and rows by the carriage return character.
1615

17-
database
16+
[database]{#database}
1817
: is an organized collection of data.
1918

20-
dataframe
19+
[dataframe]{#dataframe}
2120
: is a two-dimensional labeled data structure with columns of (potentially)
2221
different type.
2322

24-
data structure
23+
[data structure]{#data-structure}
2524
: is a particular way of organizing data in memory.
2625

27-
data type
26+
[data type]{#data-type}
2827
: is a particular kind of item that can be assigned to a variable, defined by
2928
the values it can take, the programming language in use and the operations
3029
that can be performed on it.
3130

32-
dictionary
31+
[dictionary]{#dictionary}
3332
: is an unordered Python data structure designed to contain key-value pairs, where both
3433
the key and the value can be integers, floats or strings. Elements of a dictionary
3534
can be accessed by their key and can be modified.
3635

37-
docstring
36+
[docstring]{#docstring}
3837
: is an optional documentation string to describe what a Python function does.
3938

40-
faceting
39+
[faceting]{#faceting}
4140
: is the act of plotting relationships between set variables in multiple subsets
4241
of the data with the results appearing as different panels in the same figure.
4342

44-
float
43+
[float]{#float}
4544
: is a Python data type designed to store positive and negative decimal numbers
4645
by means of a floating point representation.
4746

48-
function
47+
[function]{#function}
4948
: is a group of related statements that perform a specific task.
5049

51-
integer
50+
[integer]{#integer}
5251
: is a Python data type designed to store positive and negative integer numbers.
5352

54-
interactive mode
53+
[interactive mode]{#interactive-mode}
5554
: is an online mode of operation in which the user writes the commands directly
5655
on the command line one-by-one and execute them immediately by pressing a button
5756
on the keyword, usually <kbd>Return</kbd>.
5857

59-
join key
58+
[join key]{#join-key}
6059
: is a variable or an array representing the column names over which pandas.DataFrame.join()
6160
merge together columns of different data sets.
6261

63-
library
62+
[library]{#library}
6463
: is a set of functions and methods grouped together to perform some specific
6564
sort of tasks.
6665

67-
list
66+
[list]{#list}
6867
: is a Python data structure designed to contain sequences of integers, floats,
6968
strings and any combination of the previous. The sequence is ordered and indexed
7069
by integers, starting from 0. Elements of a list can be accessed by their index
7170
and can be modified.
7271

73-
loop
72+
[loop]{#loop}
7473
: is a sequence of instructions that is continually repeated until a condition
7574
is satisfied.
7675

77-
NaN
76+
[NaN]{#nan}
7877
: is an acronym for Not-a-Number and represents that either a value is missing or
7978
the calculation cannot output any meaningful result.
8079

81-
None
80+
[None]{#none}
8281
: is an object that represents no value.
8382

84-
scripting mode
83+
[scripting mode]{#scripting-mode}
8584
: is an offline mode of operation in which the user writes the commands to be
8685
executed in a text file (with .py extension for Python) which is then compiled
8786
or interpreted to run the program. Notes that Python interprets script on
8887
run-time and compiles a binary version of the program to speed up the execution time.
8988

90-
Sequential (data structure)
89+
[Sequential (data structure)]{#sequential-data-structure}
9190
: is an ordered group of objects stored in memory which can be accessed specifying
9291
their index, i.e. their position, in the structure.
9392

94-
SQL
93+
[SQL]{#sql}
9594
: or Structured Query Language, is a domain-specific language for managing data
9695
stored in a relational database management system (RDBMS).
9796

98-
SQLite
97+
[SQLite]{#sqlite}
9998
: is a self-contained, public domain SQL database engine.
10099

101-
string
100+
[string]{#string}
102101
: is a Python data type designed to store sequences of characters.
103102

104-
tuple
103+
[tuple]{#tuple}
105104
: is a Python data structure designed to contain sequences of integers, floats,
106105
strings and any combination of the previous. The sequence is ordered and indexed
107106
by integers, starting from 0. Elements of a tuple can be accessed by their index

learners/setup.md

+18-25
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,17 @@ version 3.x (e.g., 3.6 is fine).
4242

4343
::::::::::::::::::::::::::::::::::::::::::::::::::
4444

45-
## Installing Anaconda
46-
47-
{::options parse\_block\_html="true" /}
48-
49-
<div>
50-
51-
<ul class="nav nav-tabs" role="tablist">
45+
:::::::::::::::::::: discussion
5246

53-
<li role="presentation" class="active"><a data-os="windows" href="#anaconda-windows" aria-controls="Windows" role="tab" data-toggle="tab">Windows</a></li>
54-
55-
<li role="presentation"><a data-os="macos" href="#anaconda-macos" aria-controls="MacOS" role="tab" data-toggle="tab">MacOS</a></li>
47+
## Installing Anaconda
5648

57-
<li role="presentation"><a data-os="linux" href="#anaconda-linux" aria-controls="Linux" role="tab" data-toggle="tab">Linux</a></li>
49+
Select your operating system from the options below.
5850

59-
</ul>
51+
:::::::::::::::::::::::::::::::::
6052

61-
<div class="tab-content">
53+
:::::::::::: solution
6254

63-
<article role="tabpanel" class="tab-pane active" id="anaconda-windows">
55+
### Windows {#anaconda-windows}
6456

6557
1. Open [https://www.anaconda.com/products/individual](https://www.anaconda.com/products/individual) in your web browser.
6658

@@ -91,9 +83,11 @@ version 3.x (e.g., 3.6 is fine).
9183

9284
</div>
9385

94-
</article>
86+
::::::::::::
87+
88+
:::::::::::: solution
9589

96-
<article role="tabpanel" class="tab-pane" id="anaconda-macos">
90+
### MacOS {#anaconda-macos}
9791

9892
1. Visit [https://www.anaconda.com/products/individual](https://www.anaconda.com/products/individual) in your web browser.
9993

@@ -127,9 +121,12 @@ version 3.x (e.g., 3.6 is fine).
127121

128122
</div>
129123

130-
</article>
124+
::::::::::::
125+
126+
:::::::::::: solution
127+
128+
### Linux {#anaconda-linux}
131129

132-
<article role="tabpanel" class="tab-pane" id="anaconda-linux">
133130
Note that the following installation steps require you to work from the terminal (shell).
134131
If you run into any difficulties, please request help before the workshop begins.
135132

@@ -160,11 +157,7 @@ If you run into any difficulties, please request help before the workshop begins
160157
conda --help
161158
```
162159

163-
</article>
164-
165-
</div>
166-
167-
</div>
160+
::::::::::::
168161

169162
## Required Python Packages
170163

@@ -200,7 +193,7 @@ conda install -c conda-forge plotnine
200193
### *(Alternative)* Installing required packages with environment file
201194

202195
Download the
203-
[environment.yml](https://raw.githubusercontent.com/datacarpentry/python-ecology-lesson/gh-pages/environment.yml)
196+
[environment.yml](https://episodes/files/environment.yml/environment.yml)
204197
file by right-clicking the link and selecting save as.
205198
In the directory where you downloaded the environment.yml file run:
206199

@@ -233,7 +226,7 @@ The notebook should open automatically in your browser. If it does not or you
233226
wish to use a different browser, open this link: [http://localhost:8888](https://localhost:8888).
234227

235228
For a brief introduction to Jupyter Notebooks, please consult our
236-
[Introduction to Jupyter Notebooks](.{% link \_extras/jupyter\_notebooks.md %}) page.
229+
[Introduction to Jupyter Notebooks](jupyter_notebooks.md) page.
237230

238231
[python]: https://www.python.org/
239232
[anaconda]: https://www.anaconda.com/

links.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
2+
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
3+
[ci]: https://communityin.org/
4+
[coc-reporting]: https://docs.carpentries.org/topic_folders/policies/incident-reporting.html
5+
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
6+
[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
7+
[contrib-covenant]: https://contributor-covenant.org/
8+
[cran-checkpoint]: https://cran.r-project.org/package=checkpoint
9+
[cran-knitr]: https://cran.r-project.org/package=knitr
10+
[cran-stringr]: https://cran.r-project.org/package=stringr
11+
[dc-lessons]: https://www.datacarpentry.org/lessons/
12+
[email]: mailto:[email protected]
13+
[github-importer]: https://import2.github.com/
14+
[importer]: https://github.com/new/import
15+
[jekyll-collection]: https://jekyllrb.com/docs/collections/
16+
[jekyll-install]: https://jekyllrb.com/docs/installation/
17+
[jekyll-windows]: https://jekyll-windows.juthilo.com/
18+
[jekyll]: https://jekyllrb.com/
19+
[jupyter]: https://jupyter.org/
20+
[kramdown]: https://kramdown.gettalong.org/
21+
[lc-lessons]: https://librarycarpentry.org/lessons/
22+
[lesson-example]: https://carpentries.github.io/lesson-example/
23+
[mit-license]: https://opensource.org/licenses/mit-license.html
24+
[morea]: https://morea-framework.github.io/
25+
[numfocus]: https://numfocus.org/
26+
[osi]: https://opensource.org
27+
[pandoc]: https://pandoc.org/
28+
[paper-now]: https://github.com/PeerJ/paper-now
29+
[python-gapminder]: https://swcarpentry.github.io/python-novice-gapminder/
30+
[pyyaml]: https://pypi.org/project/PyYAML/
31+
[r-markdown]: https://rmarkdown.rstudio.com/
32+
[rstudio]: https://www.rstudio.com/
33+
[ruby-install-guide]: https://www.ruby-lang.org/en/downloads/
34+
[ruby-installer]: https://rubyinstaller.org/
35+
[rubygems]: https://rubygems.org/pages/download/
36+
[styles]: https://github.com/carpentries/styles/
37+
[swc-lessons]: https://software-carpentry.org/lessons/
38+
[swc-releases]: https://github.com/swcarpentry/swc-releases
39+
[training]: https://carpentries.github.io/instructor-training/
40+
[yaml]: https://yaml.org/
41+
[lesson-setup]: ../learners/setup.md

0 commit comments

Comments
 (0)