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
189d97f7
Commit
189d97f7
authored
9 years ago
by
Harry Jeffery
Browse files
Options
Downloads
Patches
Plain Diff
Refs #11355 Transfer truncate extents test
parent
1574effe
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
+26
-0
26 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
26 additions
and
6 deletions
Code/Mantid/Framework/MDAlgorithms/test/CutMDTest.h
+
26
−
0
View file @
189d97f7
...
...
@@ -163,6 +163,32 @@ public:
AnalysisDataService
::
Instance
().
remove
(
wsName
);
}
void
test_truncate_extents
()
{
const
std
::
string
wsName
=
"__CutMDTest_truncate_extents"
;
auto
algCutMD
=
FrameworkManager
::
Instance
().
createAlgorithm
(
"CutMD"
);
algCutMD
->
initialize
();
algCutMD
->
setRethrows
(
true
);
algCutMD
->
setProperty
(
"InputWorkspace"
,
sharedWSName
);
algCutMD
->
setProperty
(
"OutputWorkspace"
,
wsName
);
algCutMD
->
setProperty
(
"P1Bin"
,
"0,1.1,1"
);
algCutMD
->
setProperty
(
"P2Bin"
,
"21"
);
algCutMD
->
setProperty
(
"P3Bin"
,
"0.1"
);
algCutMD
->
setProperty
(
"CheckAxes"
,
false
);
algCutMD
->
setProperty
(
"NoPix"
,
true
);
algCutMD
->
execute
();
TS_ASSERT
(
algCutMD
->
isExecuted
());
IMDWorkspace_sptr
outWS
=
AnalysisDataService
::
Instance
().
retrieveWS
<
IMDWorkspace
>
(
wsName
);
TS_ASSERT
(
outWS
.
get
());
TS_ASSERT_EQUALS
(
outWS
->
getDimension
(
0
)
->
getNBins
(),
1
);
TS_ASSERT_EQUALS
(
outWS
->
getDimension
(
1
)
->
getNBins
(),
1
);
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 @
189d97f7
...
...
@@ -22,12 +22,6 @@ class CutMDTest(unittest.TestCase):
def
tearDown
(
self
):
DeleteWorkspace
(
self
.
__in_md
)
def
test_truncate_extents
(
self
):
out_md
=
CutMD
(
self
.
__in_md
,
P1Bin
=
[
0
,
1.1
,
1
],
P2Bin
=
[
21
],
P3Bin
=
[
0.1
],
CheckAxes
=
False
,
NoPix
=
True
)
self
.
assertEqual
(
1
,
out_md
.
getDimension
(
0
).
getNBins
(),
"
Step is beyond range. Should just be integrated
"
)
self
.
assertEqual
(
1
,
out_md
.
getDimension
(
1
).
getNBins
(),
"
Step is beyond range. Should just be integrated
"
)
def
test_wrong_projection_workspace_format_wrong_column_numbers
(
self
):
projection
=
CreateEmptyTableWorkspace
()
projection
.
addColumn
(
"
str
"
,
"
name
"
)
...
...
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