Skip to content

Commit 1a87942

Browse files
authored
MAINT: remove %matplotlib inline and contents directives (#313)
1 parent fdb7b7c commit 1a87942

19 files changed

+2
-96
lines changed

lectures/about_py.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323

2424
# About Python
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
```{epigraph}
3127
"Python has gotten sufficiently weapons grade that we don’t descend into R
3228
anymore. Sorry, R people. I used to be one of you but we no longer descend
@@ -255,10 +251,8 @@ Its features include, among many other things:
255251
Here's some example code that generates and plots a random graph, with node color determined by the shortest path length from a central node.
256252

257253
```{code-cell} ipython
258-
%matplotlib inline
259254
import networkx as nx
260255
import matplotlib.pyplot as plt
261-
plt.rcParams['figure.figsize'] = (10,6)
262256
np.random.seed(1234)
263257
264258
# Generate a random graph

lectures/debugging.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Debugging
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
```{epigraph}
3127
"Debugging is twice as hard as writing the code in the first place.
3228
Therefore, if you write the code as cleverly as possible, you are, by definition,
@@ -61,10 +57,8 @@ Here we'll focus on Jupyter Notebook and leave you to explore other settings.
6157
We'll need the following imports
6258

6359
```{code-cell} ipython
64-
%matplotlib inline
6560
import numpy as np
6661
import matplotlib.pyplot as plt
67-
plt.rcParams['figure.figsize'] = (10,6)
6862
```
6963

7064
(debug_magic)=

lectures/functions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; User-defined functions
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
## Overview
3127

3228
Functions are an extremely useful construct provided by almost all programming.

lectures/getting_started.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ kernelspec:
1818
</div>
1919
```
2020

21+
<!-- TODO: Review this styling -->
22+
2123
<style>
2224
.auto {
2325
width: 70%;
@@ -35,10 +37,6 @@ kernelspec:
3537
```{index} single: Python
3638
```
3739

38-
```{contents} Contents
39-
:depth: 2
40-
```
41-
4240
## Overview
4341

4442
In this lecture, you will learn how to
@@ -278,8 +276,6 @@ On that page, you'll see the following code
278276
```{code-cell} ipython
279277
import numpy as np
280278
import matplotlib.pyplot as plt
281-
%matplotlib inline
282-
plt.rcParams['figure.figsize'] = (10,6)
283279
284280
# Fixing random state for reproducibility
285281
np.random.seed(19680801)

lectures/matplotlib.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; Matplotlib
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
## Overview
3127

3228
We've already generated quite a few figures in these lectures using [Matplotlib](http://matplotlib.org/).
@@ -61,9 +57,7 @@ But first, let's discuss the difference.
6157
Here's the kind of easy example you might find in introductory treatments
6258

6359
```{code-cell} ipython
64-
%matplotlib inline
6560
import matplotlib.pyplot as plt
66-
plt.rcParams["figure.figsize"] = (10, 6) #set default figure size
6761
import numpy as np
6862
6963
x = np.linspace(0, 10, 200)

lectures/need_for_speed.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ kernelspec:
2020

2121
# Python for Scientific Computing
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
26-
2723
```{epigraph}
2824
"We should forget about small efficiencies, say about 97% of the time:
2925
premature optimization is the root of all evil." -- Donald Knuth
@@ -379,7 +375,6 @@ Here's a plot of $f$
379375

380376
```{code-cell} ipython
381377
import matplotlib.pyplot as plt
382-
%matplotlib inline
383378
from mpl_toolkits.mplot3d.axes3d import Axes3D
384379
from matplotlib import cm
385380

lectures/numba.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ kernelspec:
2222

2323
# Numba
2424

25-
```{contents} Contents
26-
:depth: 2
27-
```
28-
2925
In addition to what's in Anaconda, this lecture will need the following libraries:
3026

3127
```{code-cell} ipython3
@@ -40,11 +36,9 @@ versions are a {doc}`common source of errors <troubleshooting>`.
4036
Let's start with some imports:
4137

4238
```{code-cell} ipython3
43-
%matplotlib inline
4439
import numpy as np
4540
import quantecon as qe
4641
import matplotlib.pyplot as plt
47-
plt.rcParams['figure.figsize'] = (10,6)
4842
```
4943

5044
## Overview

lectures/numpy.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; NumPy
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
```{epigraph}
3127
"Let's be clear: the work of science has nothing whatever to do with consensus. Consensus is the business of politics. Science, on the contrary, requires only one investigator who happens to be right, which means that he or she has results that are verifiable by reference to the real world. In science consensus is irrelevant. What is relevant is reproducible results." -- Michael Crichton
3228
```

lectures/pandas.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; Pandas
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
In addition to what’s in Anaconda, this lecture will need the following libraries:
3127

3228
```{code-cell} ipython
@@ -69,11 +65,9 @@ Throughout the lecture, we will assume that the following imports have taken
6965
place
7066

7167
```{code-cell} ipython
72-
%matplotlib inline
7368
import pandas as pd
7469
import numpy as np
7570
import matplotlib.pyplot as plt
76-
plt.rcParams["figure.figsize"] = [10,8] # Set default figure size
7771
import requests
7872
```
7973

lectures/parallelization.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ kernelspec:
2020

2121
# Parallelization
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
26-
2723
In addition to what's in Anaconda, this lecture will need the following libraries:
2824

2925
```{code-cell} ipython
@@ -61,11 +57,9 @@ In this lecture we discuss parallelization for scientific computing, with a focu
6157
Let's start with some imports:
6258

6359
```{code-cell} ipython
64-
%matplotlib inline
6560
import numpy as np
6661
import quantecon as qe
6762
import matplotlib.pyplot as plt
68-
plt.rcParams['figure.figsize'] = (10,6)
6963
```
7064

7165
## Types of Parallelization

lectures/python_advanced_features.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ kernelspec:
2020

2121
# More Language Features
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
26-
2723
## Overview
2824

2925
With this last lecture, our advice is to **skip it on first pass**, unless you have a burning desire to read it.

lectures/python_by_example.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; Introductory Example
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
## Overview
3127

3228
We're now ready to start learning the Python language itself.

lectures/python_essentials.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ kernelspec:
2020

2121
# Python Essentials
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
26-
2723
## Overview
2824

2925
We have covered a lot of material quite quickly, with a focus on examples.

lectures/python_oop.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; Object-Oriented Programming
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
## Overview
3127

3228
In an {doc}`earlier lecture <oop_intro>`, we learned some foundations of object-oriented programming.
@@ -61,10 +57,8 @@ It takes a little while to get used to the syntax so we'll provide plenty of exa
6157
We'll use the following imports:
6258

6359
```{code-cell} ipython
64-
%matplotlib inline
6560
import numpy as np
6661
import matplotlib.pyplot as plt
67-
plt.rcParams['figure.figsize'] = (10,6)
6862
```
6963

7064
## OOP Review

lectures/scipy.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Python; SciPy
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
## Overview
3127

3228
[SciPy](http://www.scipy.org) builds on top of NumPy to provide common tools for scientific programming such as
@@ -114,10 +110,8 @@ For this, we can use `scipy.stats`, which provides all of this functionality as
114110
Here's an example of usage
115111

116112
```{code-cell} ipython
117-
%matplotlib inline
118113
from scipy.stats import beta
119114
import matplotlib.pyplot as plt
120-
plt.rcParams['figure.figsize'] = (10,6)
121115
122116
q = beta(5, 5) # Beta(a, b), with a = b = 5
123117
obs = q.rvs(2000) # 2000 observations

lectures/sympy.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ kernelspec:
2525
```{index} single: Python; SymPy
2626
```
2727

28-
```{contents} Contents
29-
:depth: 2
30-
```
31-
3228
## Overview
3329

3430
Unlike numerical libraries that deal with values, [SymPy](https://www.sympy.org/en/index.html) focuses on manipulating mathematical symbols and expressions directly.

lectures/troubleshooting.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ kernelspec:
2020

2121
# Troubleshooting
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
26-
2723
This page is for readers experiencing errors when running the code from the lectures.
2824

2925
## Fixing Your Local Environment

lectures/workspace.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ kernelspec:
2020

2121
# Writing Longer Programs
2222

23-
```{contents} Contents
24-
:depth: 2
25-
```
2623
## Overview
2724

2825
So far, we have explored the use of Jupyter Notebooks in writing and executing Python code.

lectures/writing_good_code.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ kernelspec:
2323
```{index} single: Models; Code style
2424
```
2525

26-
```{contents} Contents
27-
:depth: 2
28-
```
29-
3026
```{epigraph}
3127
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." -- Martin Fowler
3228
```
@@ -75,10 +71,8 @@ The plots will be grouped into three subfigures.
7571
In each subfigure, two parameters are held fixed while another varies
7672

7773
```{code-cell} ipython
78-
%matplotlib inline
7974
import numpy as np
8075
import matplotlib.pyplot as plt
81-
plt.rcParams['figure.figsize'] = (10,6)
8276
8377
# Allocate memory for time series
8478
k = np.empty(50)

0 commit comments

Comments
 (0)