Skip to content

Commit 3a05315

Browse files
authored
[FIX] Remove Syntax Warning from Cache Rebuild (#508)
1 parent 7e0089f commit 3a05315

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

lectures/cass_koopmans_2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ T_arr = [250, 150, 75, 50]
857857
fix, axs = plt.subplots(2, 3, figsize=(13, 6))
858858
titles = ['Arrow-Hicks Prices', 'Labor Rental Rate', 'Capital Rental Rate',
859859
'Consumption', 'Capital', 'Lagrange Multiplier']
860-
ylabels = ['$q_t^0$', '$w_t$', '$\eta_t$', '$c_t$', '$k_t$', '$\mu_t$']
860+
ylabels = ['$q_t^0$', '$w_t$', r'$\eta_t$', '$c_t$', '$k_t$', r'$\mu_t$']
861861
862862
for T in T_arr:
863863
c_path, k_path = bisection(pp, 0.3, k_ss/3, T, verbose=False)
@@ -905,7 +905,7 @@ for γ in γ_arr:
905905
paths = [q_path, w_path, η_path, c_path, k_path, μ_path]
906906
907907
for i, ax in enumerate(axs.flatten()):
908-
ax.plot(paths[i], label=f'$\gamma = {γ}$')
908+
ax.plot(paths[i], label=fr'$\gamma = {γ}$')
909909
ax.set(title=titles[i], ylabel=ylabels[i], xlabel='t')
910910
if titles[i] == 'Capital':
911911
ax.axhline(k_ss, lw=1, ls='--', c='k')

lectures/coleman_policy_iter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ n = 15
347347
σ = grid.copy() # Set initial condition
348348
349349
fig, ax = plt.subplots()
350-
lb = 'initial condition $\sigma(y) = y$'
350+
lb = r'initial condition $\sigma(y) = y$'
351351
ax.plot(grid, σ, color=plt.cm.jet(0), alpha=0.6, label=lb)
352352
353353
for i in range(n):

lectures/exchangeable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def learning_example(F_a=1, F_b=1, G_a=3, G_b=1.2):
481481
ax3.fill_between(π_grid, roots[0], roots[1], color='green', alpha=0.15)
482482
ax3.fill_between(π_grid, roots[1], w_max, color='blue', alpha=0.15)
483483
ax3.hlines(roots, 0., 1., linestyle="--")
484-
ax3.set(xlabel='$\pi$', ylabel='$w$')
484+
ax3.set(xlabel=r'$\pi$', ylabel='$w$')
485485
ax3.grid()
486486
487487
plt.show()
@@ -694,8 +694,8 @@ def expected_ratio(F_a=1, F_b=1, G_a=3, G_b=1.2):
694694
plt.plot(π_grid, expected_rario, label=f"{q} generates")
695695
696696
plt.hlines(1, 0, 1, linestyle="--")
697-
plt.xlabel("$π_t$")
698-
plt.ylabel("$E[\pi_{t+1}/\pi_t]$")
697+
plt.xlabel(r"$\pi_t$")
698+
plt.ylabel(r"$E[\pi_{t+1}/\pi_t]$")
699699
plt.legend()
700700
701701
plt.show()

lectures/jv.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,8 @@ def xbar(ϕ):
532532
533533
ϕ_grid = np.linspace(0, 1, 100)
534534
fig, ax = plt.subplots(figsize=(9, 7))
535-
ax.set(xlabel='$\phi$')
536-
ax.plot(ϕ_grid, [xbar(ϕ) * (1 - ϕ) for ϕ in ϕ_grid], label='$w^*(\phi)$')
535+
ax.set(xlabel=r'$\phi$')
536+
ax.plot(ϕ_grid, [xbar(ϕ) * (1 - ϕ) for ϕ in ϕ_grid], label=r'$w^*(\phi)$')
537537
ax.legend()
538538
539539
plt.show()

lectures/lake_model.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class LakeModel:
257257
258258
259259
def rate_steady_state(self, tol=1e-6):
260-
"""
260+
r"""
261261
Finds the steady state of the system :math:`x_{t+1} = \hat A x_{t}`
262262
263263
Returns
@@ -1005,7 +1005,7 @@ class LakeModelModified:
10051005
10061006
10071007
def rate_steady_state(self, tol=1e-6):
1008-
"""
1008+
r"""
10091009
Finds the steady state of the system :math:`x_{t+1} = \hat A x_{t}`
10101010
10111011
Returns

lectures/lqcontrol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ ax.set(xlabel='Time', xlim=(0, max(time)))
16051605
ax.plot(time, q_bar, 'k-', lw=2, alpha=0.6, label=r'$\bar q_t$')
16061606
ax.plot(time, q, 'b-', lw=2, alpha=0.6, label='$q_t$')
16071607
ax.legend(ncol=2, **legend_args)
1608-
s = f'dynamics with $\gamma = {γ}$'
1608+
s = fr'dynamics with $\gamma = {γ}$'
16091609
ax.text(max(time) * 0.6, 1 * q_bar.max(), s, fontsize=14)
16101610
plt.show()
16111611
```

lectures/multivariate_normal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ plt.fill_between(range(1, n+1), μθ_hat_lower, μθ_hat_higher,
780780
color='b', alpha=0.2, label='95%')
781781
782782
plt.xlabel('number of test scores')
783-
plt.ylabel('$\hat{θ}$')
783+
plt.ylabel(r'$\hat{θ}$')
784784
plt.legend()
785785
786786
plt.show()
@@ -2225,7 +2225,7 @@ Below we’ll plot several things
22252225

22262226
```{code-cell} python3
22272227
plt.scatter(range(N), y, label='y')
2228-
plt.scatter(range(N), ε, label='$\epsilon$')
2228+
plt.scatter(range(N), ε, label=r'$\epsilon$')
22292229
plt.hlines(f[0], 0, N//2-1, ls='--', label='$f_{1}$')
22302230
plt.hlines(f[1], N//2, N-1, ls='-.', label='$f_{2}$')
22312231
plt.legend()

lectures/svd_intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def compare_pca_svd(da):
974974
axs[0].set_title('ε')
975975
axs[0].set_xlabel('n')
976976
axs[1].plot(da.VT[:da.r, :].T * np.sqrt(da.λ))
977-
axs[1].set_title('$V^\top *\sqrt{\lambda}$')
977+
axs[1].set_title(r'$V^\top *\sqrt{\lambda}$')
978978
axs[1].set_xlabel('n')
979979
plt.show()
980980
```

lectures/von_neumann_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ fig.suptitle(r'The function $V(M(\gamma))$', fontsize=16)
921921
for ax, grid, N, i in zip(axes, (value_ex1_grid, value_ex2_grid),
922922
(n1, n2), (1, 2)):
923923
ax.plot(γ_grid, grid)
924-
ax.set(title=f'Example {i}', xlabel='$\gamma$')
924+
ax.set(title=f'Example {i}', xlabel=r'$\gamma$')
925925
ax.axhline(0, c='k', lw=1)
926926
ax.axvline(N.bounds()[0], c='r', ls='--', label='lower bound')
927927
ax.axvline(N.bounds()[1], c='g', ls='--', label='upper bound')

0 commit comments

Comments
 (0)