Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
4eafac6b
Commit
4eafac6b
authored
9 years ago
by
Harry Jeffery
Browse files
Options
Downloads
Patches
Plain Diff
Refs #11355 Transfer 4th bin param test
parent
56c1cc33
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
+28
-0
28 additions, 0 deletions
Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py
+0
-6
0 additions, 6 deletions
...ework/PythonInterface/test/python/mantid/api/CutMDTest.py
with
28 additions
and
6 deletions
Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
+
28
−
0
View file @
4eafac6b
...
...
@@ -63,6 +63,34 @@ public:
TS_ASSERT_THROWS_NOTHING
(
alg
.
initialize
())
TS_ASSERT
(
alg
.
isInitialized
())
}
void
test_exec_throws_if_giving_4th_binning_param_when_workspace_is_3d
()
{
const
std
::
string
wsName
=
"__CutMDTest_4thbinon3dthrows"
;
FrameworkManager
::
Instance
().
exec
(
"CreateMDWorkspace"
,
10
,
"OutputWorkspace"
,
wsName
.
c_str
(),
"Dimensions"
,
"3"
,
"Extents"
,
"-10,10,-10,10,-10,10"
,
"Names"
,
"H,K,L"
,
"Units"
,
"U,U,U"
);
FrameworkManager
::
Instance
().
exec
(
"SetSpecialCoordinates"
,
4
,
"InputWorkspace"
,
wsName
.
c_str
(),
"SpecialCoordinates"
,
"HKL"
);
auto
algCutMD
=
FrameworkManager
::
Instance
().
createAlgorithm
(
"CutMD"
);
algCutMD
->
initialize
();
algCutMD
->
setRethrows
(
true
);
algCutMD
->
setProperty
(
"InputWorkspace"
,
wsName
);
algCutMD
->
setProperty
(
"OutputWorkspace"
,
wsName
);
algCutMD
->
setProperty
(
"P1Bin"
,
"0.1"
);
algCutMD
->
setProperty
(
"P2Bin"
,
"0.1"
);
algCutMD
->
setProperty
(
"P3Bin"
,
"0.1"
);
algCutMD
->
setProperty
(
"P4Bin"
,
"0.1"
);
TS_ASSERT_THROWS
(
algCutMD
->
execute
(),
std
::
runtime_error
)
AnalysisDataService
::
Instance
().
remove
(
wsName
);
}
};
#endif
/* MANTID_MDALGORITHMS_CUTMDTEST_H_ */
This diff is collapsed.
Click to expand it.
Code/Mantid/Framework/PythonInterface/test/python/mantid/api/CutMDTest.py
+
0
−
6
View file @
4eafac6b
...
...
@@ -22,12 +22,6 @@ class CutMDTest(unittest.TestCase):
def
tearDown
(
self
):
DeleteWorkspace
(
self
.
__in_md
)
def
test_exec_throws_if_giving_4th_binning_parameter_when_workspace_is_3D
(
self
):
test_md
=
CreateMDWorkspace
(
Dimensions
=
3
,
Extents
=
[
-
10
,
10
,
-
10
,
10
,
-
10
,
10
],
Names
=
"
H,K,L
"
,
Units
=
"
U,U,U
"
)
# Explicitly set the coordinate system to lab Q.
SetSpecialCoordinates
(
InputWorkspace
=
test_md
,
SpecialCoordinates
=
'
HKL
'
)
self
.
assertRaises
(
RuntimeError
,
CutMD
,
InputWorkspace
=
test_md
,
OutputWorkspace
=
"
out_ws
"
,
P1Bin
=
[
0.1
],
P2Bin
=
[
0.1
],
P3Bin
=
[
0.1
],
P4Bin
=
[
0.1
])
def
test_slice_to_original
(
self
):
out_md
=
CutMD
(
self
.
__in_md
,
P1Bin
=
[
0.1
],
P2Bin
=
[
0.1
],
P3Bin
=
[
0.1
],
CheckAxes
=
False
)
self
.
assertTrue
(
isinstance
(
out_md
,
IMDEventWorkspace
),
"
Should default to producing an IMDEventWorkspace.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment