[additive_functionals] Style guide review #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📋 Style Guide Review: additive_functionals
This PR addresses style guide compliance issues found in the
additive_functionals
lecture.📊 Summary
🎯 Issues by Priority
📝 Detailed Changes
Code (9 issues)
qe-code-004 - Unicode Greek Letters
ϕ_1, ϕ_2, ϕ_3, ϕ_4 = 0.5, -0.2, 0, 0.5 σ = 0.01 ν = 0.01 # Growth rate...
ϕ_1, ϕ_2, ϕ_3, ϕ_4 = 0.5, -0.2, 0, 0.5 σ = 0.01 ν = 0.01 # Growth rate...
qe-code-005 - Package Installation
:tags: [hide-output]
!pip install --upgrade quantecon...`
:tags: [hide-output]
!pip install --upgrade quantecon --quiet...`
qe-code-003 - Operator Spacing
y_{t+1} - y_{t} = \nu + D x_{t} + F z_{t+1}...
y_{t+1} - y_t = \nu + D x_t + F z_{t+1}...
_{t}
with braces is unnecessary when the subscript is a single character. This improves consistency with code style.qe-code-003 - Operator Spacing
# Order of states is: [1, t, xt, yt, mt]...
# Order of states is: [1, t, x_t, y_t, m_t]...
qe-code-001 - PEP8 Compliance
A1 = np.hstack([1, 0, nx0r, ny0r, ny0r]) # Transition for 1 A2 = np.hstack([1, 1, nx...
A1 = np.hstack([1, 0, nx0r, ny0r, ny0r]) # Transition for 1 A2 = np.hstack([1, 1, nx0r, ny0...
qe-code-001 - PEP8 Compliance
Selector for x_{t}
G1 = np.hstack(...`# Order of observation is: [x_t, y_t, m_t, s_t, t_t] G1 = np.hstack([nx0c, nx0c, np.eye(nx),...
qe-code-001 - PEP8 Compliance
G4 = np.hstack([ny0c, ny0c, -g, ny0m, ny0m]) # Selector for stationary G5 = np.hstack([ny0c...
G4 = np.hstack([ny0c, ny0c, -g, ny0m, ny0m]) # Selector for stationary G5 = np.hstack([ny0c...
qe-code-001 - PEP8 Compliance
Mdist = lognorm(np.sqrt(yvar[nx+nm+ii, nx+nm+ii]).item(), scale=np.exp(y...
scale_val = np.exp( ymeans[nx+nm+ii] - t * 0.5 * np.expand_dims( ...
qe-code-003 - Operator Spacing
(.5)
instead of0.5
for numeric literals.ν_tilde = ν + (.5)*np.expand_dims(np.diag(H @ H.T), 1)...
ν_tilde = ν + 0.5 * np.expand_dims(np.diag(H @ H.T), 1)...
0.5
instead of(.5)
for clarity and consistency with Python style conventions. Also add spaces around the multiplication operator.Format (1 issues)
We construct our additive functional from two pieces, the first of which is a **first-order vector ...
We construct our additive functional from two pieces, the first of which is a **first-order vector ...
Jax (5 issues)