Skip to content

Commit

Permalink
Remove deprecated classes
Browse files Browse the repository at this point in the history
Previously deprecated in #302
  • Loading branch information
Anthchirp committed Apr 22, 2021
1 parent 75cc907 commit 835773d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 116 deletions.
115 changes: 1 addition & 114 deletions datablock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import libtbx

import dxtbx.imageset
import dxtbx.model.compare
import dxtbx.model
from dxtbx.format.FormatMultiImage import FormatMultiImage
from dxtbx.format.image import ImageBool, ImageDouble
from dxtbx.format.Registry import get_format_class_for_file
Expand Down Expand Up @@ -930,116 +930,3 @@ def __call__(self, a, b):
fixed_rotation_tolerance=self.fixed_rotation_tolerance,
setting_rotation_tolerance=self.setting_rotation_tolerance,
)


class BeamDiff:
def __init__(
self,
wavelength_tolerance=1e-6,
direction_tolerance=1e-6,
polarization_normal_tolerance=1e-6,
polarization_fraction_tolerance=1e-6,
):
warnings.warn(
"dxtbx.datablock.BeamDiff is deprecated. "
"Use dxtbx.model.compare.beam_diff instead",
DeprecationWarning,
stacklevel=2,
)
self.wavelength_tolerance = wavelength_tolerance
self.direction_tolerance = direction_tolerance
self.polarization_normal_tolerance = polarization_normal_tolerance
self.polarization_fraction_tolerance = polarization_fraction_tolerance

def __call__(self, a, b):
return dxtbx.model.compare.beam_diff(
a,
b,
wavelength_tolerance=self.wavelength_tolerance,
direction_tolerance=self.direction_tolerance,
polarization_normal_tolerance=self.polarization_normal_tolerance,
polarization_fraction_tolerance=self.polarization_fraction_tolerance,
).split("\n")


class DetectorDiff:
def __init__(
self, fast_axis_tolerance=1e-6, slow_axis_tolerance=1e-6, origin_tolerance=1e-6
):
warnings.warn(
"dxtbx.datablock.DetectorDiff is deprecated. "
"Use dxtbx.model.compare.detector_diff instead",
DeprecationWarning,
stacklevel=2,
)
self.fast_axis_tolerance = fast_axis_tolerance
self.slow_axis_tolerance = slow_axis_tolerance
self.origin_tolerance = origin_tolerance

def __call__(self, a, b):
return dxtbx.model.compare.detector_diff(
a,
b,
fast_axis_tolerance=self.fast_axis_tolerance,
slow_axis_tolerance=self.slow_axis_tolerance,
origin_tolerance=self.origin_tolerance,
).split("\n")


class GoniometerDiff:
def __init__(
self,
rotation_axis_tolerance=1e-6,
fixed_rotation_tolerance=1e-6,
setting_rotation_tolerance=1e-6,
):
warnings.warn(
"dxtbx.datablock.GoniometerDiff is deprecated. "
"Use dxtbx.model.compare.goniometer_diff instead",
DeprecationWarning,
stacklevel=2,
)
self.rotation_axis_tolerance = rotation_axis_tolerance
self.fixed_rotation_tolerance = fixed_rotation_tolerance
self.setting_rotation_tolerance = setting_rotation_tolerance

def __call__(self, a, b):
return dxtbx.model.compare.goniometer_diff(
a,
b,
rotation_axis_tolerance=self.rotation_axis_tolerance,
fixed_rotation_tolerance=self.fixed_rotation_tolerance,
setting_rotation_tolerance=self.setting_rotation_tolerance,
).split("\n")


class ScanDiff:
def __init__(self, scan_tolerance=0.03):
warnings.warn(
"dxtbx.datablock.ScanDiff is deprecated. "
"Use dxtbx.model.compare.scan_diff instead",
DeprecationWarning,
stacklevel=2,
)
self.scan_tolerance = scan_tolerance

def __call__(self, a, b):
return dxtbx.model.compare.scan_diff(
a, b, scan_tolerance=self.scan_tolerance
).split("\n")


class SequenceDiff:
def __init__(self, tolerance):
warnings.warn(
"dxtbx.datablock.SequenceDiff is deprecated. "
"Use dxtbx.model.compare.sequence_diff instead",
DeprecationWarning,
stacklevel=2,
)
self._tolerance = tolerance

def __call__(self, sequence1, sequence2):
return dxtbx.model.compare.sequence_diff(
sequence1, sequence2, tolerance=self._tolerance
).split("\n")
2 changes: 0 additions & 2 deletions model/experiment_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
DataBlockTemplateImporter,
DetectorComparison,
GoniometerComparison,
SequenceDiff,
)
from dxtbx.format.Format import Format
from dxtbx.format.FormatMultiImage import FormatMultiImage
Expand Down Expand Up @@ -59,7 +58,6 @@
"DetectorComparison",
"ExperimentListFactory",
"GoniometerComparison",
"SequenceDiff",
]


Expand Down

0 comments on commit 835773d

Please sign in to comment.