Skip to content

Commit

Permalink
Merge pull request #334 from jo-mueller/add-__all__-to-inits
Browse files Browse the repository at this point in the history
Code style cleanup
  • Loading branch information
jo-mueller authored Oct 26, 2023
2 parents 403b7f2 + d858555 commit 63c3c44
Show file tree
Hide file tree
Showing 40 changed files with 573 additions and 1,069 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jupyter-book>=0.7.0b
napari
PyQt5
qtpy
napari-stress
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.ruff]
ignore = ["F821"]

[tool.ruff.per-file-ignores]
"_napari_plugin.py" = ["F401"]
29 changes: 29 additions & 0 deletions src/napari_stress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,32 @@

from . import types
from . import _vectors as vectors

__all__ = [
"__version__",
"measurements",
"approximation",
"reconstruction",
"sample_data",
"plotting",
"utils",
"stress_backend",
"rescale",
"smooth_sinc",
"smoothMLS2D",
"reconstruct_surface",
"decimate",
"extract_vertex_points",
"fit_ellipsoid_to_pointcloud_points",
"fit_ellipsoid_to_pointcloud_vectors",
"TimelapseConverter",
"frame_by_frame",
"fit_spherical_harmonics",
"lebedev_quadrature",
"create_manifold",
"get_droplet_point_cloud",
"get_droplet_point_cloud_4d",
"get_droplet_4d",
"types",
"vectors",
]
6 changes: 6 additions & 0 deletions src/napari_stress/_approximation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
expand_points_on_ellipse,
normals_on_ellipsoid,
)

__all__ = [
"least_squares_ellipsoid",
"expand_points_on_ellipse",
"normals_on_ellipsoid",
]
4 changes: 2 additions & 2 deletions src/napari_stress/_approximation/fit_ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ def normals_on_ellipsoid(points: PointsData) -> VectorsData:
F = coefficients.flatten()[5]
G = coefficients.flatten()[6]
H = coefficients.flatten()[7]
I = coefficients.flatten()[8]
J = coefficients.flatten()[8]

xx = points[:, 0][:, None]
yy = points[:, 1][:, None]
zz = points[:, 2][:, None]

grad_F_x = 2.0 * A * xx + D * yy + E * zz + G
grad_F_y = 2.0 * B * yy + D * xx + F * zz + H
grad_F_z = 2.0 * C * zz + E * xx + F * yy + I
grad_F_z = 2.0 * C * zz + E * xx + F * yy + J

grad_F_X = np.hstack((grad_F_x, grad_F_y, grad_F_z))
Vec_Norms = np.sqrt(np.sum(np.multiply(grad_F_X, grad_F_X), axis=1)).reshape(
Expand Down
Loading

0 comments on commit 63c3c44

Please sign in to comment.