Skip to content

Commit

Permalink
Merge pull request #337 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 authored Nov 15, 2023
2 parents 5ed08db + 992ece7 commit 7f9bcf8
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 206 deletions.
8 changes: 4 additions & 4 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.2.0
rev: v4.5.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/charliermarsh/ruff-pre-commit
rev: v0.0.256
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/tlambert03/napari-plugin-checks
Expand Down
2 changes: 0 additions & 2 deletions src/napari_stress/_measurements/geodesics.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def correlation_on_surface(

# calculate autocorrelation with spatially averaged feature values
for dist_i in range(0, maximal_distance + 1):

sum_mean_curv_corr_d_i, n_points = _avg_around_pt(
dist_i, dists_lbdv_non0, Corr_non0_pts, maximal_distance
)
Expand Down Expand Up @@ -235,7 +234,6 @@ def local_extrema_analysis(
delta_feature_nearest_min_max = np.zeros_like(feature)

for pt in range(quad_fit):

H_pt = feature[pt]

# set to True, change if False:
Expand Down
1 change: 1 addition & 0 deletions src/napari_stress/_measurements/stresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def calculate_anisotropy(
every group in the dataframe
"""

# write a function to apply to every group in the dataframe
def anisotropy(
df: pd.DataFrame, alpha: float = 0.05, column: str = "anisotropic_stress"
Expand Down
1 change: 0 additions & 1 deletion src/napari_stress/_reconstruction/reconstruct_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def reconstruct_surface_from_quadrature_points(points: PointsData) -> SurfaceDat
vertex = tetras[tri_i, tetra_vert]

if vertex != n_quadrature_points and vert_ind < 3:

delauney_triangles[tri_i, vert_ind] = vertex
vert_ind = vert_ind + 1

Expand Down
2 changes: 0 additions & 2 deletions src/napari_stress/_reconstruction/refine_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def trace_refinement_of_surface(

# Iterate over all provided target points
for idx in range(n_points):

array = np.array(intensity_along_vector.loc[idx].to_numpy())
# Simple or fancy fit?
if selected_fit_type == fit_types.quick_edge_fit:
Expand Down Expand Up @@ -329,7 +328,6 @@ def _fancy_edge_fit(
array = [x for x in array if not np.isnan(x)] # filter out nans
try:
if selected_edge_func == _sigmoid:

# trim begin of trace to get rid of rising intensity slope
ind_max = np.argmax(array)
array = array[ind_max:]
Expand Down
3 changes: 0 additions & 3 deletions src/napari_stress/_spherical_harmonics/spherical_harmonics.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def shtools_spherical_harmonics_expansion(
longitude = np.rad2deg(spherical_coordinates[2])

if expansion_type == "radial":

# Find spherical harmonics expansion coefficients until specified degree
opt_fit_params = pyshtools._SHTOOLS.SHExpandLSQ(
radius, latitude, longitude, lmax=max_degree
Expand All @@ -74,7 +73,6 @@ def shtools_spherical_harmonics_expansion(
return points, coefficients

elif expansion_type == "cartesian":

optimal_fit_params = []
fitted_coordinates = np.zeros_like(points)
for i in range(3):
Expand Down Expand Up @@ -267,7 +265,6 @@ def lebedev_quadrature(
def create_manifold(
points: PointsData, lebedev_fit: lebedev_info.lbdv_info, max_degree: int
) -> mnfd.manifold:

# add information to manifold on what type of expansion was used
Manny_Dict = {}
Manny_Name_Dict = {} # sph point cloud at lbdv
Expand Down
8 changes: 0 additions & 8 deletions src/napari_stress/_stress/charts_SPB.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

def Domain(Theta, Phi): # Which coordinates to use
if Chart_Min_Polar <= Phi and Phi <= Chart_Max_Polar: # Use Coordinates A

Bar_Coors = Coor_A_To_B(Theta, Phi)
Phi_Bar = Bar_Coors[1]

Expand All @@ -32,7 +31,6 @@ def Domain(Theta, Phi): # Which coordinates to use

def Domain_Unaffected(Theta, Phi): # Where fns in each chart arent affected by eta fns
if eta_Min_Polar <= Phi and Phi <= eta_Max_Polar: # Use Coordinates A

Bar_Coors = Coor_A_To_B(Theta, Phi)
Phi_Bar = Bar_Coors[1]

Expand Down Expand Up @@ -97,7 +95,6 @@ def eta_A_const(
def eta_B(
func, Theta_Bar, Phi_Bar
): # Cutoff fn for Phi_Bar in [eta_Min_Polar, eta_Max_Polar]

# func needs to be COUNTER rotated back to phi, theta, to be consistent
def func_counter_rot(theta_bar, phi_bar):
Orig_Coors = Coor_B_To_A(theta_bar, phi_bar)
Expand All @@ -111,7 +108,6 @@ def func_counter_rot(theta_bar, phi_bar):
# NOTE: (Theta, Phi) ->
# (Theta_Bar, Phi_Bar) by rotating the north pole (0,0) to the east pole (0,pi/2)
def Coor_A_To_B(Theta, Phi): # Converts from A to B

X1 = np.cos(Theta) * np.sin(Phi)
Y1 = np.sin(Theta) * np.sin(Phi)
Z1 = np.cos(Phi)
Expand Down Expand Up @@ -141,7 +137,6 @@ def Coor_A_To_B(Theta, Phi): # Converts from A to B


def Coor_B_To_A(Theta_Bar, Phi_Bar): # Converts from B back to A

# X2 = cos(Theta_Bar)*sin(Phi_Bar)
# Y2 = sin(Theta_Bar)*sin(Phi_Bar)
# Z2 = cos(Phi_Bar)
Expand Down Expand Up @@ -173,14 +168,12 @@ def Coor_B_To_A(Theta_Bar, Phi_Bar): # Converts from B back to A

# Uses F(theta, phi) to find F_{Rot}(theta_bar, phi_bar)
def Rotate_Fn(func, Theta_Bar, Phi_Bar):

Theta, Phi = Coor_B_To_A(Theta_Bar, Phi_Bar)
return func(Theta, Phi)


# (x,y,z) -> (theta, phi)
def Cart_To_Coor_A(x, y, z):

r = np.sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))

##Calculate Theta
Expand All @@ -200,7 +193,6 @@ def Cart_To_Coor_A(x, y, z):

# (x,y,z) -> (theta_bar, phi_bar)
def Cart_To_Coor_B(x, y, z):

r = np.sqrt(pow(x, 2) + pow(y, 2) + pow(z, 2))

##Calculate Theta_Bar
Expand Down
Loading

0 comments on commit 7f9bcf8

Please sign in to comment.