Skip to content

Commit

Permalink
Merge #1030 from pc494/deperecating_utils
Browse files Browse the repository at this point in the history
Deprecation of {pyfai,segment,virtual_images} utils
  • Loading branch information
pc494 committed Mar 14, 2024
2 parents 664d6c0 + d316761 commit 493ec43
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -33,6 +33,7 @@ Deprecated
- Deprecated `CalibrationGenerator` in favour of `pyxem.utils.calibration_utils.Calibration` class (#1000)
- Deprecated `pyxem.generators.virtual_image_generator.VirtualImageGenerator` in
favor of `pyxem.signals.CommonDiffraction.get_virtual_image` (#1014)
- Several utility modules have been deprecated: utils.{pyfai,segement,virtual_images,background_utils,cluster_tools} (#1060 & #1030).

Deleted
-------
Expand Down
6 changes: 6 additions & 0 deletions pyxem/utils/pyfai_utils.py
Expand Up @@ -3,7 +3,10 @@
from pyFAI.detectors import Detector
from pyFAI.units import register_radial_unit, eq_q

from pyxem.utils._deprecated import deprecated


@deprecated(since="0.18.0", removal="1.0.0")
def get_azimuthal_integrator(
detector,
detector_distance,
Expand Down Expand Up @@ -60,6 +63,7 @@ def get_azimuthal_integrator(
return ai


@deprecated(since="0.18.0", removal="1.0.0")
def _get_radial_extent(ai, shape=None, unit=None):
"""Takes an Azimuthal Integrator and calculates the domain of the output.
Expand All @@ -78,6 +82,7 @@ def _get_radial_extent(ai, shape=None, unit=None):
return [np.min(postions), np.max(postions)]


@deprecated(since="0.18.0", removal="1.0.0")
def _get_displacements(center, shape, affine):
"""Gets the displacements for a set of points based on some affine transformation
about some center point.
Expand Down Expand Up @@ -114,6 +119,7 @@ def _get_displacements(center, shape, affine):
return dx, dy


@deprecated(since="0.18.0", removal="1.0.0")
def _get_setup(wavelength, pyxem_unit, pixel_scale, radial_range=None):
"""Returns a generic set up for a flat detector with accounting for Ewald sphere effects."""
units_table = {
Expand Down
5 changes: 5 additions & 0 deletions pyxem/utils/segment_utils.py
Expand Up @@ -28,7 +28,10 @@
from skimage.segmentation import watershed
from sklearn.cluster import DBSCAN

from pyxem.utils._deprecated import deprecated


@deprecated(since="0.18.0", removal="1.0.0")
def norm_cross_corr(image, template):
"""Calculates the normalised cross-correlation between an image
and a template at zero displacement.
Expand Down Expand Up @@ -59,6 +62,7 @@ def norm_cross_corr(image, template):
return corr


@deprecated(since="0.18.0", removal="1.0.0")
def separate_watershed(
vdf_temp,
min_distance=1,
Expand Down Expand Up @@ -286,6 +290,7 @@ def separate_watershed(
return vdf_sep


@deprecated(since="0.18.0", removal="1.0.0")
def get_gaussian2d(a, xo, yo, x, y, sigma):
"""Obtain a 2D Gaussian of amplitude a and standard deviation
sigma, centred at (xo, yo), on a grid given by x and y.
Expand Down
3 changes: 3 additions & 0 deletions pyxem/utils/virtual_images_utils.py
Expand Up @@ -17,8 +17,10 @@
# along with pyXem. If not, see <http://www.gnu.org/licenses/>.

import numpy as np
from pyxem.utils._deprecated import deprecated


@deprecated(since="0.18.0", removal="1.0.0")
def normalize_virtual_images(im):
"""Normalizes image intensity by dividing by maximum value.
Expand All @@ -37,6 +39,7 @@ def normalize_virtual_images(im):
return imn


@deprecated(since="0.18.0", removal="1.0.0")
def get_vectors_mesh(g1_norm, g2_norm, g_norm_max, angle=0.0, shear=0.0):
"""
Calculate vectors coordinates of a mesh defined by a norm, a rotation and
Expand Down

0 comments on commit 493ec43

Please sign in to comment.