Zabamund / wellpathpy

Well deviation import
GNU Lesser General Public License v3.0
78 stars 28 forks source link

Explicitly use 2-norm in normalize() #44

Closed jokva closed 3 years ago

jokva commented 3 years ago

The normalize() function is designed to work on vectors, or lists-of-vectors. When numpy sees a list-of-vectors it interprets it as a matrix, which changes the default norm from 2-norm to Frobenius norm [1]. Specific the ord parameter fixes this issue, and removes the need for a less-than-eps special case.

[1] https://numpy.org/doc/stable/reference/generated/numpy.linalg.norm.html