Skip to content
Snippets Groups Projects
Commit 092a1c02 authored by Michele Nottoli's avatar Michele Nottoli
Browse files

Made get_tangent private.

parent 6a9fe5ff
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class Extrapolator:
"""Get a new electronic density to be used as a guess."""
coefficients = fitting.linear()
def get_tangent(self) -> np.ndarray:
def _get_tangent(self) -> np.ndarray:
"""Get the tangent point."""
if self.tangent is not None:
return self.tangent
......@@ -66,15 +66,13 @@ class Extrapolator:
def _grassmann_log(self, coeff: np.ndarray) -> np.ndarray:
"""Map from the manifold to the tangent plane."""
if self.tangent is not None:
return grassmann.log(coeff, self.tangent)
raise ValueError("Tangent point is not set.")
tangent = self._get_tangent()
return grassmann.log(coeff, tangent)
def _grassmann_exp(self, gamma: np.ndarray) -> np.ndarray:
"""Map from the tangent plane to the manifold."""
if self.tangent is not None:
return grassmann.exp(gamma, self.tangent)
raise ValueError("Tangent point is not set.")
tangent = self._get_tangent()
return grassmann.exp(gamma, tangent)
def _sqrt_overlap(self, overlap):
"""Compute the square root of the overlap matrix."""
......
......@@ -29,7 +29,7 @@ def test_grassmann_urea(datafile):
extrapolator.load_data(coords, coeff, overlap)
# check the Grassmann projections
c0 = extrapolator.get_tangent()
c0 = extrapolator._get_tangent()
for (coeff, gamma, overlap) in zip(data["coefficients"],
extrapolator.gammas.get(nframes), extrapolator.overlaps.get(nframes)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment