Skip to content

Commit

Permalink
refs #10693. Relax restrictions.
Browse files Browse the repository at this point in the history
I think these original restrictions made sense, but currently LoadSQW is not loading workspaces in the HKL frame, and therefore this restriction is going to prove a problem for beta testers.

I've set it to be a warning only if AxisCheck=False.
  • Loading branch information
OwenArnold committed Dec 16, 2014
1 parent 1e827aa commit fbb888f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -175,8 +175,6 @@ def replace(self, entry):

def __verify_input_workspace(self, to_cut):
coord_system = to_cut.getSpecialCoordinateSystem()
if not coord_system == SpecialCoordinateSystem.HKL:
raise ValueError("Input Workspace must be in reciprocal lattice dimensions (HKL)")

ndims = to_cut.getNumDims()
if ndims < 3 or ndims > 4:
Expand All @@ -185,6 +183,10 @@ def __verify_input_workspace(self, to_cut):
# Try to sanity check the order of the dimensions. This is important.
axes_check = self.getProperty("CheckAxes").value
if axes_check:

if not coord_system == SpecialCoordinateSystem.HKL:
raise ValueError("Input Workspace must be in reciprocal lattice dimensions (HKL)")

predicates = ["^(H.*)|(\\[H,0,0\\].*)$","^(K.*)|(\\[0,K,0\\].*)$","^(L.*)|(\\[0,0,L\\].*)$"]
n_crystallographic_dims = __builtin__.min(3, ndims)
for i in range(n_crystallographic_dims):
Expand Down
Expand Up @@ -26,7 +26,7 @@ def test_exec_throws_if_not_a_hkl_workspace(self):
test_md = CreateMDWorkspace(Dimensions=3, Extents=[-10,10,-10,10,-10,10], Names="A,B,C", Units="U,U,U")
# Explicitly set the coordinate system to lab Q.
SetSpecialCoordinates(InputWorkspace=test_md, SpecialCoordinates='Q (lab frame)')
self.assertRaises(RuntimeError, CutMD, InputWorkspace=test_md, OutputWorkspace="out_ws", P1Bin=[0.1], P2Bin=[0.1], P3Bin=[0.1], CheckAxes=False)
self.assertRaises(RuntimeError, CutMD, InputWorkspace=test_md, OutputWorkspace="out_ws", P1Bin=[0.1], P2Bin=[0.1], P3Bin=[0.1], CheckAxes=True)

def test_exec_throws_if_set_to_be_a_hkl_workspace_but_with_missaligned_dimension_names(self):
test_md = CreateMDWorkspace(Dimensions=3, Extents=[-10,10,-10,10,-10,10], Names="K,H,L", Units="U,U,U") # K,H,L are the dimension names
Expand Down

0 comments on commit fbb888f

Please sign in to comment.