Skip to content

Commit

Permalink
Lazy import of estimate_transform and matrix_transform
Browse files Browse the repository at this point in the history
  • Loading branch information
martinberoiz committed Feb 20, 2023
1 parent c721827 commit e9427ee
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions astroalign.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,27 @@
HAS_BOTTLENECK = True

import numpy as _np
from skimage.transform import estimate_transform
from skimage.transform import matrix_transform


def estimate_transform(*args, **kwargs):
"""Lazy-loader function for skimage.transform.estimate_transform.
Full documentation:
https://scikit-image.org/docs/stable/api/skimage.transform.html#skimage.transform.estimate_transform
"""
from skimage.transform import estimate_transform
return estimate_transform(*args, **kwargs)


def matrix_transform(*args, **kwargs):
"""Lazy-loader function for skimage.transform.matrix_transform.
Full documentation:
https://scikit-image.org/docs/stable/api/skimage.transform.html#skimage.transform.matrix_transform
"""
from skimage.transform import matrix_transform
return matrix_transform(*args, **kwargs)


PIXEL_TOL = 2
"""The pixel distance tolerance to assume two invariant points are the same.
Expand Down

0 comments on commit e9427ee

Please sign in to comment.