Skip to content

Commit

Permalink
Merge pull request #357 from campaslab/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
jo-mueller committed Apr 16, 2024
2 parents 65e4663 + e00c8d5 commit be622dc
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 45 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-docstring-first
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: ^\.napari-hub/.*
- id: check-yaml # checks for correct yaml syntax for github actions ex.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.3.7
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/tlambert03/napari-plugin-checks
Expand Down
4 changes: 1 addition & 3 deletions src/napari_stress/_approximation/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ def _fit_ellipsoid_to_points(
z = points[:, 2, np.newaxis]

# Construct the design matrix for the ellipsoid equation
design_matrix = np.hstack(
(x**2, y**2, z**2, x * y, x * z, y * z, x, y, z)
)
design_matrix = np.hstack((x**2, y**2, z**2, x * y, x * z, y * z, x, y, z))
column_of_ones = np.ones_like(x) # Column vector of ones

# Perform least squares fitting to solve for the coefficients
Expand Down
4 changes: 1 addition & 3 deletions src/napari_stress/_measurements/curvature.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def curvature_on_ellipsoid(
k_upstairs = a0**2 * a1**2 * a2**2
K_downstairs = (
a0**2 * a1**2 * np.cos(V) ** 2
+ a2**2
* (a1**2 * np.cos(U) ** 2 + a0**2 * np.sin(U) ** 2)
* np.sin(V) ** 2
+ a2**2 * (a1**2 * np.cos(U) ** 2 + a0**2 * np.sin(U) ** 2) * np.sin(V) ** 2
) ** 2
k = k_upstairs / K_downstairs.squeeze()
k1 = H_ellps_pts + np.sqrt(H_ellps_pts**2 - k)
Expand Down
1 change: 1 addition & 0 deletions src/napari_stress/_reconstruction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
resampled by fitting patches to the surface and resampling the surface
according to the fitted patches.
"""

from .refine_surfaces import trace_refinement_of_surface, resample_pointcloud
from .toolbox import reconstruct_droplet
from .reconstruct_surface import reconstruct_surface_from_quadrature_points
Expand Down
6 changes: 3 additions & 3 deletions src/napari_stress/_spherical_harmonics/spherical_harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ def create_manifold(
Manny_Dict["Maniold_lbdv"] = lebedev_fit

Manny_Dict["Manifold_SPH_deg"] = max_degree
Manny_Dict[
"use_manifold_name"
] = False # we are NOT using named shapes in these tests
Manny_Dict["use_manifold_name"] = (
False # we are NOT using named shapes in these tests
)
Manny_Dict["Maniold_Name_Dict"] = Manny_Name_Dict

return mnfd.manifold(
Expand Down
24 changes: 12 additions & 12 deletions src/napari_stress/_stress/euclidian_k_form_SPB.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,12 +1701,12 @@ def Divergence_1_Form(self, lbdv, debug_mode=False):
A_inv_from_G_pt, dPhi_Vec_X_A_pt
) # np.linalg.solve(A_Mat_pt, dPhi_Vec_X_A_pt)

V_local_coors_theta_dtheta_V_A[
quad_pt, 0
] = dTheta_Vec_X_local_coors_A_pt[0]
V_local_coors_phi_dphi_V_A[
quad_pt, 0
] = dPhi_Vec_X_local_coors_A_pt[1]
V_local_coors_theta_dtheta_V_A[quad_pt, 0] = (
dTheta_Vec_X_local_coors_A_pt[0]
)
V_local_coors_phi_dphi_V_A[quad_pt, 0] = (
dPhi_Vec_X_local_coors_A_pt[1]
)

neg_A_inv_A_theta = np.dot(
A_inv_from_G_pt, A_theta_Mat_pt
Expand Down Expand Up @@ -1766,12 +1766,12 @@ def Divergence_1_Form(self, lbdv, debug_mode=False):
B_Mat_pt, dPhi_Vec_X_B_pt
)

V_local_coors_theta_dtheta_V_B[
quad_pt, 0
] = dTheta_Vec_X_local_coors_B_pt[0]
V_local_coors_phi_dphi_V_B[
quad_pt, 0
] = dPhi_Vec_X_local_coors_B_pt[1]
V_local_coors_theta_dtheta_V_B[quad_pt, 0] = (
dTheta_Vec_X_local_coors_B_pt[0]
)
V_local_coors_phi_dphi_V_B[quad_pt, 0] = (
dPhi_Vec_X_local_coors_B_pt[1]
)

neg_B_inv_B_theta = -1.0 * np.linalg.solve(B_Mat_pt, B_theta_Mat_pt)
neg_B_inv_B_phi = -1.0 * np.linalg.solve(B_Mat_pt, B_phi_Mat_pt)
Expand Down
24 changes: 12 additions & 12 deletions src/napari_stress/_stress/lebedev_info_SPB.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,18 +527,18 @@ def __init__(
(Max_SPH_Deg + 1, Max_SPH_Deg + 1, self.lbdv_quad_pts, 4)
)

To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[
:, :, :, 0
] = self.SPH_Basis_Wt_At_Quad_Pts
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[
:, :, :, 1
] = self.SPH_Basis_At_Quad_Pts
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[
:, :, :, 2
] = self.SPH_Phi_Der_At_Quad_Pts
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[
:, :, :, 3
] = self.SPH_Phi_Phi_Der_At_Quad_Pts
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[:, :, :, 0] = (
self.SPH_Basis_Wt_At_Quad_Pts
)
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[:, :, :, 1] = (
self.SPH_Basis_At_Quad_Pts
)
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[:, :, :, 2] = (
self.SPH_Phi_Der_At_Quad_Pts
)
To_Pickle_LBDV_Basis_at_Quad_Pts_Mats[:, :, :, 3] = (
self.SPH_Phi_Phi_Der_At_Quad_Pts
)

with open(LBDV_Basis_at_Quad_Pts_Mats_filepath, "wb") as f_lbdv_basis:
pkl.dump(To_Pickle_LBDV_Basis_at_Quad_Pts_Mats, f_lbdv_basis)
Expand Down
8 changes: 2 additions & 6 deletions src/napari_stress/_stress/manifold_SPB.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,12 +896,8 @@ def __init__(
+ self.Z_theta_B_Pts * self.Z_phi_B_Pts
)

self.G_A_pts = (
self.X_phi_A_Pts**2 + self.Y_phi_A_Pts**2 + self.Z_phi_A_Pts**2
)
self.G_B_pts = (
self.X_phi_B_Pts**2 + self.Y_phi_B_Pts**2 + self.Z_phi_B_Pts**2
)
self.G_A_pts = self.X_phi_A_Pts**2 + self.Y_phi_A_Pts**2 + self.Z_phi_A_Pts**2
self.G_B_pts = self.X_phi_B_Pts**2 + self.Y_phi_B_Pts**2 + self.Z_phi_B_Pts**2

# |g| = (\sqrt|g|)^2
self.Metric_Factor_Squared_A = self.E_A_pts * self.G_A_pts - self.F_A_pts**2
Expand Down
4 changes: 1 addition & 3 deletions src/napari_stress/_utils/coordinate_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ def cartesian_to_elliptical(

U_coors_calc[pt_numb] = U_pt

cylinder_r = np.sqrt(
yt_0**2 + yt_1**2
) # r in cylinderical coors for y_tilde
cylinder_r = np.sqrt(yt_0**2 + yt_1**2) # r in cylinderical coors for y_tilde
cyl_r_exp = np.sqrt(
(lengths[0] * np.cos(U_pt)) ** 2 + (lengths[1] * np.sin(U_pt)) ** 2
)
Expand Down

0 comments on commit be622dc

Please sign in to comment.