diff --git a/hexrd/distortion/distortionabc.py b/hexrd/distortion/distortionabc.py index c1ae2a473..f2eb2882a 100644 --- a/hexrd/distortion/distortionabc.py +++ b/hexrd/distortion/distortionabc.py @@ -8,7 +8,9 @@ class DistortionABC(metaclass=abc.ABCMeta): @abc.abstractmethod def apply(self, xy_in): """Apply distortion mapping""" + raise NotImplementedError @abc.abstractmethod def apply_inverse(self, xy_in): """Apply inverse distortion mapping""" + raise NotImplementedError diff --git a/hexrd/fitting/calibration/calibrator.py b/hexrd/fitting/calibration/calibrator.py index 730395491..de9634b67 100644 --- a/hexrd/fitting/calibration/calibrator.py +++ b/hexrd/fitting/calibration/calibrator.py @@ -8,6 +8,7 @@ class Calibrator(ABC): @abstractmethod def type(self): """The type of the calibrator""" + raise NotImplementedError @abstractmethod def create_lmfit_params(self, current_params): @@ -24,6 +25,7 @@ def create_lmfit_params(self, current_params): for the lattice parameters. The Laue calibrator creates lmfit parameters for crystal parameters. """ + raise NotImplementedError @abstractmethod def update_from_lmfit_params(self, params_dict): @@ -36,6 +38,7 @@ def update_from_lmfit_params(self, params_dict): For example, the powder calibrator will update the lattice parameters on the material. The Laue calibrator will update crystal parameters. """ + raise NotImplementedError @abstractmethod def residual(self, calibration_data=None): @@ -45,6 +48,7 @@ def residual(self, calibration_data=None): the calibration class instead, in which case, calibration_data can be `None`. """ + raise NotImplementedError @property @abstractmethod @@ -69,8 +73,10 @@ def calibration_picks(self): string of the hkl. And "picks" are either a list of points (powder) or a single point (laue). The picks are in cartesian coordinates. """ + raise NotImplementedError @calibration_picks.setter @abstractmethod def calibration_picks(self, val): """Setter for calibration_picks. See getter docs for details.""" + raise NotImplementedError diff --git a/hexrd/instrument/detector.py b/hexrd/instrument/detector.py index 82784105d..6b8851f17 100644 --- a/hexrd/instrument/detector.py +++ b/hexrd/instrument/detector.py @@ -57,7 +57,7 @@ class Detector: @property @abstractmethod def detector_type(self): - pass + raise NotImplementedError @abstractmethod def cart_to_angles(self, xy_data, rmat_s=None, tvec_s=None, @@ -91,6 +91,7 @@ def cart_to_angles(self, xy_data, rmat_s=None, tvec_s=None, DESCRIPTION. """ + raise NotImplementedError @abstractmethod def angles_to_cart(self, tth_eta, @@ -125,22 +126,24 @@ def angles_to_cart(self, tth_eta, The (n, 2) array on the n input coordinates in the . """ + raise NotImplementedError @abstractmethod def cart_to_dvecs(self, xy_data): """Convert cartesian coordinates to dvectors""" + raise NotImplementedError @abstractmethod def pixel_angles(self, origin=ct.zeros_3): - pass + raise NotImplementedError @abstractmethod def pixel_tth_gradient(self, origin=ct.zeros_3): - pass + raise NotImplementedError @abstractmethod def pixel_eta_gradient(self, origin=ct.zeros_3): - pass + raise NotImplementedError @property @abstractmethod @@ -149,6 +152,7 @@ def beam_position(self): returns the coordinates of the beam in the cartesian detector frame {Xd, Yd, Zd}. NaNs if no intersection. """ + raise NotImplementedError @property @@ -727,11 +731,11 @@ def config_dict(self, chi=0, tvec=ct.zeros_3, elif panel_buffer is None: # still None on self # !!! this gets handled by unwrap_dict_to_h5 now - ''' - if style.lower() == 'hdf5': - # !!! can't write None to hdf5; substitute with zeros - panel_buffer = np.r_[0., 0.] - ''' + + # if style.lower() == 'hdf5': + # # !!! can't write None to hdf5; substitute with zeros + # panel_buffer = np.r_[0., 0.] + pass det_dict['buffer'] = panel_buffer det_dict.update(self.extra_config_kwargs)