Should line numbers be right-justified? #1689
Unanswered
tobydriscoll
asked this question in
Q&A
Replies: 2 comments
-
Agree completely! When developing this the first time, I did try to do this for about an hour. Will try again soon. :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
It's weirder than I thought. Two separate includes from the same file produce different results: it doesn't seem to matter which order I do them in. There are no tabs in the source file: from scipy.linalg import cholesky
from numpy.linalg import qr
from .FNC02 import forwardsub, backsub
def lsnormal(A,b):
"""
lsnormal(A,b)
Solve a linear least squares problem by the normal equations. Returns the
minimizer of ||b-Ax||.
"""
N = A.T @ A
z = A.T @ b
R = cholesky(N)
w = forwardsub(R.T, z) # solve R'z=c
x = backsub(R, w) # solve Rx=z
return x
def lsqrfact(A,b):
"""
lsqrfact(A,b)
Solve a linear least squares problem by QR factorization. Returns the
minimizer of ||b-Ax||.
"""
Q, R = qr(A)
c = Q.T @ b
x = backsub(R, c)
return x |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Maybe this is really a feature request, but when the display of python code shows the wrong indentation, it feels more like a bug.
This is from a
literalinclude
in v1.3.18 withlinenos
set to true.Beta Was this translation helpful? Give feedback.
All reactions