Skip to content

Commit

Permalink
Use unpacking to skip one line
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianDepriester committed Jan 14, 2025
1 parent 8449653 commit 45df558
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Elasticipy/SphericalFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,7 @@ def fun(psi, theta, phi):
q = integrate.tplquad(fun, *domain)
return q[0] / (2 * np.pi ** 2)
elif method == 'trapezoid':
angles, evals = self.evaluate_on_spherical_grid(n_evals)
phi, theta, psi = angles
(phi, theta, psi), evals = self.evaluate_on_spherical_grid(n_evals)
dom_size = _integrate_over_unit_sphere(phi, theta, psi=psi)
integral = _integrate_over_unit_sphere(phi, theta, psi=psi, values=evals)
return integral / dom_size
Expand Down Expand Up @@ -780,8 +779,7 @@ def fun(psi, theta, phi):
q = integrate.tplquad(fun, *domain)
return q[0] / (2 * np.pi ** 2)
if method == 'trapezoid':
angles, evals = self.evaluate_on_spherical_grid(n_evals)
phi, theta, psi = angles
(phi, theta, psi), evals = self.evaluate_on_spherical_grid(n_evals)
dom_size = _integrate_over_unit_sphere(phi, theta, psi=psi)
if mean is None:
mean = self.mean(method='trapezoid')
Expand Down

0 comments on commit 45df558

Please sign in to comment.