Skip to content

Commit 43f5ca8

Browse files
authored
setup.md: rework, reorganize, improve (#475)
1 parent 0e418ee commit 43f5ca8

2 files changed

Lines changed: 113 additions & 78 deletions

File tree

assets/css/lesson.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@ ul.nav.nav-tabs {
9696
// 7.07 on E1E1E1: https://webaim.org/resources/contrastchecker/?fcolor=204A6F&bcolor=E1E1E1&api (tab panels)
9797
a { color: #204A6F; }
9898

99+
// .yt-wrapper2 can be used for limiting maximum width of YouTube iframes only
100+
.yt-wrapper2 { max-width: 100%; margin: 0 auto; }
101+
102+
// Use full width on small displays
103+
@media only screen and (max-width: 600px) { .yt-wrapper2 { max-width: 100%; } }
104+
105+
.yt-wrapper {
106+
height: 0;
107+
margin-top: 10px;
108+
padding-bottom: 56.25%;
109+
position: relative;
110+
width: 100%;
111+
}
112+
113+
.yt-frame {
114+
height: 100%;
115+
left: 0;
116+
position: absolute;
117+
top: 0;
118+
width: 100%;
119+
}
120+
99121
//----------------------------------------
100122
// Specialized blockquote environments for learning objectives, callouts, etc.
101123
//----------------------------------------

setup.md

Lines changed: 91 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -23,105 +23,123 @@ title: Setup
2323
{: .prereq}
2424

2525

26-
2726
> ## Installing Python using Anaconda
27+
>
2828
> [Python][python] is a popular language for scientific computing, and great for
2929
> general-purpose programming as well. Installing all of the scientific packages we use in the lesson
3030
> individually can be a bit cumbersome, and therefore recommend the all-in-one
3131
> installer [Anaconda][anaconda].
3232
>
3333
> Regardless of how you choose to install it, please make sure you install Python
34-
> version 3.x (e.g., 3.6 is fine).
34+
> version 3.x (e.g., 3.6 is fine).
3535
{: .prereq}
3636

37-
### Windows - [Video tutorial][video-windows]
38-
39-
1. Open <https://www.anaconda.com/products/individual> in your web browser.
4037

41-
2. Download the Python 3 installer for Windows.
38+
## Installing Anaconda
4239

43-
3. Double-click the executable and install Python 3 using the recommended settings. Make sure that **Register Anaconda as my default Python 3.x** option is checked - it should be in the latest version of Anaconda
40+
{::options parse_block_html="true" /}
41+
<div>
42+
<ul class="nav nav-tabs" role="tablist">
43+
<li role="presentation" class="active"><a data-os="windows" href="#anaconda-windows" aria-controls="Windows" role="tab" data-toggle="tab">Windows</a></li>
44+
<li role="presentation"><a data-os="macos" href="#anaconda-macos" aria-controls="MacOS" role="tab" data-toggle="tab">MacOS</a></li>
45+
<li role="presentation"><a data-os="linux" href="#anaconda-linux" aria-controls="Linux" role="tab" data-toggle="tab">Linux</a></li>
46+
</ul>
4447

48+
<div class="tab-content">
49+
<article role="tabpanel" class="tab-pane active" id="anaconda-windows">
4550

46-
### Mac OS X - [Video tutorial][video-mac]
51+
1. Open <https://www.anaconda.com/products/individual> in your web browser.
52+
2. Download the Anaconda Python 3 installer for Windows.
53+
3. Double-click the executable and install Python 3 using the recommended settings.
54+
Make sure that **Register Anaconda as my default Python 3.x** option is checked --
55+
it should be in the latest version of Anaconda.
56+
4. Verify the installation:
57+
click Start, search and select `Anaconda Prompt` from the menu.
58+
A window should pop up where you can now type commands
59+
such as checking your Conda installation with:
4760

48-
1. Visit <https://www.anaconda.com/products/individual> in your web browser.
61+
~~~
62+
conda --help
63+
~~~
64+
{: .language-bash}
4965
50-
2. Download the Python 3 installer for OS X. These instructions assume that you use the graphical installer `.pkg` file.
66+
#### Video Tutorial
67+
68+
<div class="yt-wrapper2">
69+
<div class="yt-wrapper">
70+
<iframe type="text/html" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" src="https://www.youtube-nocookie.com/embed/xxQ0mzZ8UvA?modestbranding=1&playsinline=1&iv_load_policy=3&rel=0" class="yt-frame" allowfullscreen></iframe>
71+
</div>
72+
</div>
73+
</article>
74+
75+
<article role="tabpanel" class="tab-pane" id="anaconda-macos">
76+
77+
1. Visit <https://www.anaconda.com/products/individual> in your web browser.
78+
2. Download the Anaconda Python 3 installer for macOS.
79+
These instructions assume that you use the graphical installer `.pkg` file.
80+
3. Follow the Anaconda Python 3 installation instructions.
81+
Make sure that the install location is set to "Install only for me"
82+
so Anaconda will install its files locally, relative to your home directory.
83+
Installing the software for all users tends to create problems in the long run
84+
and should be avoided.
85+
4. Verify the installation:
86+
click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.
87+
A window should pop up where you can now type commands
88+
such as checking your conda installation with:
5189
52-
3. Follow the Python 3 installation instructions. Make sure that the install location is set to "Install only for me" so Anaconda will install its files locally, relative to your home directory. Installing the software for all users tends to create problems in the long run and should be avoided.
90+
~~~
91+
conda --help
92+
~~~
93+
{: .language-bash}
5394
95+
#### Video Tutorial
5496
55-
### Linux
97+
<div class="yt-wrapper2">
98+
<div class="yt-wrapper">
99+
<iframe type="text/html" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" src="https://www.youtube-nocookie.com/embed/TcSAln46u9U?modestbranding=1&playsinline=1&iv_load_policy=3&rel=0" class="yt-frame" allowfullscreen></iframe>
100+
</div>
101+
</div>
102+
</article>
56103
57-
Note that the following installation steps require you to work from the terminal (shell).
104+
<article role="tabpanel" class="tab-pane" id="anaconda-linux">
105+
Note that the following installation steps require you to work from the terminal (shell).
58106
If you run into any difficulties, please request help before the workshop begins.
59107
60108
1. Open <https://www.anaconda.com/products/individual> in your web browser.
61-
62-
2. Download the Python 3 installer for Linux.
63-
64-
3. Install Python 3 using all of the defaults for installation.
65-
66-
a. Open a terminal window.
67-
68-
b. Navigate to the folder where you downloaded the installer
69-
70-
c. Type
109+
2. Download the Anaconda Python 3 installer for Linux.
110+
3. Install Anaconda using all of the defaults for installation.
111+
* Open a terminal window.
112+
* Navigate to the folder where you downloaded the installer.
113+
* Type `bash Anaconda3-` and press <kbd>Tab</kbd>.
114+
The name of the file you just downloaded should appear.
115+
* Press <kbd>Return</kbd>
116+
* Follow the text-only prompts. When the license agreement appears (a colon
117+
will be present at the bottom of the screen) press <kbd>Spacebar</kbd> until you see the
118+
bottom of the text. Type `yes` and press <kbd>Return</kbd> to approve the license. Press
119+
<kbd>Return</kbd> again to approve the default location for the files. Type `yes` and
120+
press <kbd>Return</kbd> to prepend Anaconda to your `PATH` (this makes the Anaconda
121+
distribution your user's default Python).
122+
4. Verify the installation:
123+
this depends a bit on your Linux distribution, but often you will have an Applications listing
124+
in which you can select a Terminal icon you can click. A window should pop up where you can now
125+
type commands such as checking your conda installation with:
71126
72127
~~~
73-
bash Anaconda3-
128+
conda --help
74129
~~~
75130
{: .language-bash}
76131
77-
and press <kbd>Tab</kbd>. The name of the file you just downloaded should appear.
78-
79-
d. Press <kbd>Return</kbd>.
80-
81-
e. Follow the text-only prompts. When the license agreement appears (a colon
82-
will be present at the bottom of the screen) press <kbd>Spacebar</kbd> until you see the
83-
bottom of the text. Type `yes` and press <kbd>Return</kbd> to approve the license. Press
84-
<kbd>Return</kbd> again to approve the default location for the files. Type `yes` and
85-
press <kbd>Return</kbd> to prepend Anaconda to your `PATH` (this makes the Anaconda
86-
distribution your user's default Python).
87-
132+
</article>
133+
</div>
134+
</div>
88135
89136
[anaconda]: https://www.anaconda.com/
90137
[jupyter]: https://jupyter.org/
91138
[python]: https://www.python.org/
92-
[video-mac]: https://www.youtube.com/watch?v=TcSAln46u9U
93-
[video-windows]: https://www.youtube.com/watch?v=xxQ0mzZ8UvA
94139
95-
## Opening a Conda-enabled Terminal and Verifying the Installation:
96140
97-
### Windows
98-
Click Start, search, or select Anaconda Prompt from the menu. A window should pop up where you can now type commands such as checking your Conda installation with:
141+
## Required Python Packages
99142
100-
~~~
101-
conda --help
102-
~~~
103-
{: .language-bash}
104-
105-
### Mac OSX
106-
107-
Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal.
108-
A window should pop up where you can now type commands such as checking your conda installation with:
109-
110-
~~~
111-
conda --help
112-
~~~
113-
{: .language-bash}
114-
115-
### Linux
116-
This depends a bit on your Linux distribution, but often you will have an Applications listing in which you can select a Terminal icon you can click. A window should pop up where you can now type commands such as checking your conda installation with:
117-
118-
~~~
119-
conda --help
120-
~~~
121-
{: .language-bash}
122-
123-
124-
## Required Python Packages for this Workshop
125143
The following are packages needed for this workshop:
126144
127145
* [Pandas](https://pandas.pydata.org/)
@@ -130,27 +148,22 @@ The following are packages needed for this workshop:
130148
* [Matplotlib](https://matplotlib.org/)
131149
* [Plotnine](https://plotnine.readthedocs.io/en/stable/)
132150
133-
All packages apart from plotnine will have automatically been installed with Anaconda and we can use anaconda as a package manager to install the missing `plotnine` package:
134-
You need to open up a *Terminal*, if you are using Mac OSX, or Linux (see instructions above), or launch an *anaconda-promt*, if you are using Windows. In your terminal window type the following:
151+
All packages apart from `plotnine` will have automatically been installed with Anaconda
152+
and we can use Anaconda as a package manager to install the missing `plotnine` package:
153+
You need to open up a *Terminal*, if you are using Mac OSX, or Linux (see instructions above),
154+
or launch an *anaconda-promt*, if you are using Windows. In your terminal window type the following:
135155
136156
~~~
137157
conda install -y -c conda-forge plotnine
138158
~~~
139159
{: .language-bash}
140160
141-
This will then install the latest version of plotnine into your conda environment.
161+
This will then install the latest version of plotnine into your conda environment.
142162
143-
## Installing other Packages (Not required)
144-
If you want to install any additional packages, you can do so by opening a terminal window and type:
145-
~~~
146-
conda install -y package_name
147-
~~~
148-
{: .language-bash}
163+
## Required packages: Miniconda
149164
150-
You may need to install the required packages in this way,
151-
if you opted for installing Miniconda, instead of Anaconda.
152-
Miniconda is a lightweight version of Anaconda. If you install and use Miniconda
153-
you will also need to install the workshop packages manually in the following way:
165+
Miniconda is a lightweight version of Anaconda. If you install Miniconda instead of Anaconda,
166+
you need to install required packages manually in the following way:
154167
~~~
155168
conda install -y numpy pandas matplotlib jupyter
156169
conda install -c conda-forge plotnine

0 commit comments

Comments
 (0)