diff --git a/py4DSTEM/braggvectors/diskdetection.py b/py4DSTEM/braggvectors/diskdetection.py index e329d193e..a66ff62ea 100644 --- a/py4DSTEM/braggvectors/diskdetection.py +++ b/py4DSTEM/braggvectors/diskdetection.py @@ -10,6 +10,7 @@ from py4DSTEM.datacube import DataCube from py4DSTEM.preprocess.utils import get_maxima_2D from py4DSTEM.process.utils.cross_correlate import get_cross_correlation_FT + try: from py4DSTEM.braggvectors.diskdetection_aiml import find_Bragg_disks_aiml except (ImportError, ModuleNotFoundError): diff --git a/py4DSTEM/io/filereaders/__init__.py b/py4DSTEM/io/filereaders/__init__.py index eb5cd02e1..372275f11 100644 --- a/py4DSTEM/io/filereaders/__init__.py +++ b/py4DSTEM/io/filereaders/__init__.py @@ -2,6 +2,7 @@ from py4DSTEM.io.filereaders.read_K2 import read_gatan_K2_bin from py4DSTEM.io.filereaders.empad import read_empad from py4DSTEM.io.filereaders.read_mib import load_mib + try: from py4DSTEM.io.filereaders.read_arina import read_arina except (ImportError, ModuleNotFoundError): diff --git a/py4DSTEM/io/importfile.py b/py4DSTEM/io/importfile.py index 73e402de0..b3002c77e 100644 --- a/py4DSTEM/io/importfile.py +++ b/py4DSTEM/io/importfile.py @@ -90,6 +90,7 @@ def import_file( data = load_mib(filepath, mem=mem, binfactor=binfactor, **kwargs) elif filetype == "arina": from py4DSTEM.io.filereaders import read_arina + data = read_arina(filepath, mem=mem, binfactor=binfactor, **kwargs) elif filetype == "abTEM": data = read_abTEM(filepath, mem=mem, binfactor=binfactor, **kwargs) diff --git a/py4DSTEM/process/__init__.py b/py4DSTEM/process/__init__.py index 8acee4e3c..b04451913 100644 --- a/py4DSTEM/process/__init__.py +++ b/py4DSTEM/process/__init__.py @@ -4,11 +4,13 @@ from py4DSTEM.process import phase from py4DSTEM.process import calibration from py4DSTEM.process import utils + try: from py4DSTEM.process import classification except (ImportError, ModuleNotFoundError): pass from py4DSTEM.process import diffraction + try: from py4DSTEM.process import wholepatternfit except (ImportError, ModuleNotFoundError): diff --git a/py4DSTEM/process/diffraction/crystal_viz.py b/py4DSTEM/process/diffraction/crystal_viz.py index d3e4b682a..b5a22d609 100644 --- a/py4DSTEM/process/diffraction/crystal_viz.py +++ b/py4DSTEM/process/diffraction/crystal_viz.py @@ -453,7 +453,8 @@ def plot_scattering_intensity( int_sf_plot = calc_1D_profile( k, self.g_vec_leng, - (self.struct_factors_int**int_power_scale) * (self.g_vec_leng**k_power_scale), + (self.struct_factors_int**int_power_scale) + * (self.g_vec_leng**k_power_scale), remove_origin=True, k_broadening=k_broadening, int_scale=int_scale, @@ -1883,7 +1884,6 @@ def plot_clusters( for a0 in range(self.cluster_sizes.shape[0]): if self.cluster_sizes[a0] >= area_min: - if outline_grains: from skimage.morphology import erosion diff --git a/py4DSTEM/process/phase/utils.py b/py4DSTEM/process/phase/utils.py index 2834e8c2e..0ed82f703 100644 --- a/py4DSTEM/process/phase/utils.py +++ b/py4DSTEM/process/phase/utils.py @@ -202,7 +202,9 @@ def evaluate_gaussian_envelope( self, alpha: Union[float, np.ndarray] ) -> Union[float, np.ndarray]: xp = self._xp - return xp.exp(-0.5 * self._gaussian_spread**2 * alpha**2 / self._wavelength**2) + return xp.exp( + -0.5 * self._gaussian_spread**2 * alpha**2 / self._wavelength**2 + ) def evaluate_spatial_envelope( self, alpha: Union[float, np.ndarray], phi: Union[float, np.ndarray] @@ -1755,6 +1757,7 @@ def unwrap_phase_2d(array, weights=None, gauge=None, corner_centered=True, xp=np def unwrap_phase_2d_skimage(array, corner_centered=True, xp=np): from skimage.restoration import unwrap_phase + if xp is np: array = array.astype(np.float64) unwrapped_array = unwrap_phase(array, wrap_around=corner_centered).astype( diff --git a/py4DSTEM/utils/configuration_checker.py b/py4DSTEM/utils/configuration_checker.py index 6edf44ffc..cbdbd2881 100644 --- a/py4DSTEM/utils/configuration_checker.py +++ b/py4DSTEM/utils/configuration_checker.py @@ -6,8 +6,7 @@ from importlib.util import find_spec # need a mapping of pypi/conda names to import names -import_mapping_dict = { -} +import_mapping_dict = {} # programatically get all possible requirements in the import name style @@ -523,8 +522,7 @@ def print_no_extra_checks(m: str): # dict of extra check functions -funcs_dict = { -} +funcs_dict = {} #### main function used to check the configuration of the installation