Skip to content

Commit

Permalink
black versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
talonchandler committed Feb 18, 2025
1 parent ead6a83 commit c5296f4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
pip install black==25.1.0
- name: Check code styling with Black
run: |
black --diff -S -t py310 waveorder
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ repos:
# args: [--ignore, "E203,W503", --min-python-version, '3.10']
# additional_dependencies: [flake8-typing-imports==1.12.0]
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 25.1.0
hooks:
- id: black
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies = [
dynamic = ["version"]

[project.optional-dependencies]
dev = ["pytest", "pytest-cov", "black", "flake8"]
dev = ["pytest", "pytest-cov", "black==25.1.0"]
examples = ["napari[all]", "jupyter"]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion waveorder/models/inplane_oriented_thick_pol3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def generate_test_phantom(
yx_shape: Tuple[int, int]
yx_shape: Tuple[int, int],
) -> Tuple[Tensor, Tensor, Tensor, Tensor]:
star, theta, _ = util.generate_star_target(yx_shape, blur_px=0.1)
retardance = 0.25 * star
Expand Down
16 changes: 8 additions & 8 deletions waveorder/models/isotropic_thin_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def calculate_transfer_function(
)

for z in range(len(z_position_list)):
absorption_2d_to_3d_transfer_function_out[
z
] = sampling.nd_fourier_central_cuboid(
absorption_2d_to_3d_transfer_function[z], yx_shape
absorption_2d_to_3d_transfer_function_out[z] = (
sampling.nd_fourier_central_cuboid(
absorption_2d_to_3d_transfer_function[z], yx_shape
)
)
phase_2d_to_3d_transfer_function_out[
z
] = sampling.nd_fourier_central_cuboid(
phase_2d_to_3d_transfer_function[z], yx_shape
phase_2d_to_3d_transfer_function_out[z] = (
sampling.nd_fourier_central_cuboid(
phase_2d_to_3d_transfer_function[z], yx_shape
)
)

return (
Expand Down
4 changes: 1 addition & 3 deletions waveorder/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,7 @@ def generate_vector_source_defocus_pupil(

y_broadcast = torch.broadcast_to(y_frequencies[None, :, :], freq_shape)
x_broadcast = torch.broadcast_to(x_frequencies[None, :, :], freq_shape)
z_broadcast = np.sqrt(
wavelength ** (-2) - x_broadcast**2 - y_broadcast**2
)
z_broadcast = np.sqrt(wavelength ** (-2) - x_broadcast**2 - y_broadcast**2)

# Calculate rotation matrix
rotations = rotation_matrix(
Expand Down
1 change: 1 addition & 0 deletions waveorder/stokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
>>> stokes_after_adr(*adr_params) # * expands along the first axis
"""

import numpy as np
import torch

Expand Down
8 changes: 2 additions & 6 deletions waveorder/waveorder_reconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,7 @@ def inclination_recon_setup(self, inc_recon):
wave_vec_norm_x = self.lambda_illu * self.fxx
wave_vec_norm_y = self.lambda_illu * self.fyy
wave_vec_norm_z = (
np.maximum(
0, 1 - wave_vec_norm_x**2 - wave_vec_norm_y**2
)
np.maximum(0, 1 - wave_vec_norm_x**2 - wave_vec_norm_y**2)
) ** (0.5)

incident_theta = np.arctan2(
Expand Down Expand Up @@ -4023,9 +4021,7 @@ def Fluor_anisotropy_recon(self, S1_stack, S2_stack):
S1_stack = cp.array(S1_stack)
S2_stack = cp.array(S2_stack)

anisotropy = cp.asnumpy(
0.5 * cp.sqrt(S1_stack**2 + S2_stack**2)
)
anisotropy = cp.asnumpy(0.5 * cp.sqrt(S1_stack**2 + S2_stack**2))
orientation = cp.asnumpy(
(0.5 * cp.arctan2(S2_stack, S1_stack)) % np.pi
)
Expand Down

0 comments on commit c5296f4

Please sign in to comment.