Skip to content

Commit

Permalink
Refactor: Cleaned up unsused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CSSFrancis committed Mar 22, 2024
1 parent ba578ff commit fab3e5b
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 38 deletions.
3 changes: 3 additions & 0 deletions examples/plotting/README.rst
@@ -0,0 +1,3 @@
Plotting
===============
Below is a gallery of examples on how to make nice plots with Matplotlib from hyperspy/ pyxem signals.
8 changes: 8 additions & 0 deletions examples/plotting/making_a_gif.py
@@ -0,0 +1,8 @@
"""
============
Making a Gif
============
This example shows how to create a gif from a series of images. Here we use the "hyperspy" idea of a
signal and navigation axes to create a series of images
"""
7 changes: 4 additions & 3 deletions pyxem/__init__.py
Expand Up @@ -26,9 +26,6 @@
except ImportError:
CUPY_INSTALLED = False

_logger = logging.getLogger(__name__)


from pyxem import components
from pyxem import detectors
from pyxem import dummy_data
Expand All @@ -38,6 +35,10 @@

from . import release_info


_logger = logging.getLogger(__name__)


__all__ = [
"components",
"detectors",
Expand Down
1 change: 0 additions & 1 deletion pyxem/generators/displacement_gradient_tensor_generator.py
Expand Up @@ -141,7 +141,6 @@ def get_single_DisplacementGradientTensor(
# see https://stackoverflow.com/questions/27128688
weights = np.asarray(weights)
# Need vectors normalized to the unstrained region otherwise the weighting breaks down
norm = np.linalg.norm(Vu, axis=1)
Vs = (np.divide(Vs.T, np.linalg.norm(Vu, axis=1)) * np.sqrt(weights)).T
Vu = (np.divide(Vu.T, np.linalg.norm(Vu, axis=1)) * np.sqrt(weights)).T
else:
Expand Down
6 changes: 6 additions & 0 deletions pyxem/signals/__init__.py
Expand Up @@ -74,15 +74,21 @@
"DiffractionVectors1D",
"DiffractionVectors2D",
"Diffraction1D",
"LazyDiffraction1D",
"LazyDiffraction2D",
"Diffraction2D",
"ElectronDiffraction1D",
"LazyElectronDiffraction1D",
"LazyElectronDiffraction2D",
"ElectronDiffraction2D",
"VectorMatchingResults",
"PairDistributionFunction1D",
"PolarDiffraction2D",
"LazyPolarDiffraction2D",
"PolarVectors",
"LazyPolarVectors",
"Power2D",
"LazyPower2D",
"ReducedIntensity1D",
"LearningSegment",
"VDFSegment",
Expand Down
8 changes: 0 additions & 8 deletions pyxem/signals/diffraction2d.py
Expand Up @@ -32,12 +32,6 @@

from pyxem.signals import (
CommonDiffraction,
DPCBaseSignal,
DPCSignal1D,
DPCSignal2D,
LazyDPCBaseSignal,
LazyDPCSignal1D,
LazyDPCSignal2D,
)
from pyxem.utils.pyfai_utils import (
get_azimuthal_integrator,
Expand All @@ -48,7 +42,6 @@
azimuthal_integrate1d,
azimuthal_integrate2d,
gain_normalise,
regional_filter,
remove_bad_pixels,
circular_mask,
find_beam_offset_cross_correlation,
Expand All @@ -75,7 +68,6 @@
from pyxem.utils.signal import (
select_method_from_method_dict,
to_hyperspy_index,
transfer_navigation_axes,
)
import pyxem.utils._pixelated_stem_tools as pst
import pyxem.utils.dask_tools as dt
Expand Down
1 change: 0 additions & 1 deletion pyxem/signals/diffraction_vectors.py
Expand Up @@ -23,7 +23,6 @@
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial import distance_matrix
from sklearn.cluster import DBSCAN
import dask.array as da

from hyperspy.signals import BaseSignal, Signal1D
Expand Down
1 change: 0 additions & 1 deletion pyxem/signals/labeled_diffraction_vectors2d.py
Expand Up @@ -18,7 +18,6 @@


from pyxem.signals.diffraction_vectors2d import DiffractionVectors2D
from scipy.spatial.distance import cdist
import numpy as np
import matplotlib.pyplot as plt

Expand Down
2 changes: 0 additions & 2 deletions pyxem/signals/reduced_intensity1d.py
Expand Up @@ -21,8 +21,6 @@
import numpy as np

from pyxem.components import ReducedIntensityCorrectionComponent
from diffsims.utils.atomic_scattering_params import ATOMIC_SCATTERING_PARAMS
from diffsims.utils.lobato_scattering_params import ATOMIC_SCATTERING_PARAMS_LOBATO
from scipy import special


Expand Down
2 changes: 1 addition & 1 deletion pyxem/signals/tensor_field.py
Expand Up @@ -99,7 +99,7 @@ def get_strain_maps(self):

e11 = np.reciprocal(U.isig[0, 0].T) - 1
e12 = U.isig[0, 1].T
e21 = U.isig[1, 0].T
# e21 = U.isig[1, 0].T # Same as e12
e22 = np.reciprocal(U.isig[1, 1].T) - 1
theta = R.map(_get_rotation_angle, inplace=False)
theta = theta.transpose(2)
Expand Down
21 changes: 0 additions & 21 deletions pyxem/tests/components/test_red_int_correction_component.py

This file was deleted.

0 comments on commit fab3e5b

Please sign in to comment.