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
0c37583d
Commit
0c37583d
authored
6 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #24512 added focussing tests
parent
b60865eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
+72
-1
72 additions, 1 deletion
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
with
72 additions
and
1 deletion
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
+
72
−
1
View file @
0c37583d
...
@@ -18,7 +18,7 @@ DIRS = config['datasearch.directories'].split(';')
...
@@ -18,7 +18,7 @@ DIRS = config['datasearch.directories'].split(';')
root_directory
=
os
.
path
.
join
(
DIRS
[
0
],
"
ENGINX
"
)
root_directory
=
os
.
path
.
join
(
DIRS
[
0
],
"
ENGINX
"
)
cal_directory
=
os
.
path
.
join
(
root_directory
,
"
cal
"
)
cal_directory
=
os
.
path
.
join
(
root_directory
,
"
cal
"
)
focus_directory
=
os
.
path
.
join
(
root_directory
,
"
focus
"
)
focus_directory
=
os
.
path
.
join
(
root_directory
,
"
focus
"
)
focus_tests
=
0
class
CreateVanadiumTest
(
systemtesting
.
MantidSystemTest
):
class
CreateVanadiumTest
(
systemtesting
.
MantidSystemTest
):
...
@@ -91,7 +91,66 @@ class CreateCalibrationBankTest(systemtesting.MantidSystemTest):
...
@@ -91,7 +91,66 @@ class CreateCalibrationBankTest(systemtesting.MantidSystemTest):
_try_delete
(
cal_directory
)
_try_delete
(
cal_directory
)
class
FocusBothBanks
(
systemtesting
.
MantidSystemTest
):
def
runTest
(
self
):
_setup_focus
()
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
focus_directory
)
test
.
focus
(
run_number
=
"
299080
"
)
def
validate
(
self
):
return
(
"
engg_focus_output_bank_1
"
,
"
enggui_focusing_output_ws_bank_1.nxs
"
,
"
engg_focus_output_bank_2
"
,
"
enggui_focusing_output_ws_bank_2.nxs
"
)
def
cleanup
(
self
):
simple
.
mtd
.
clear
()
_tear_down_focus
()
class
FocusCropped
(
systemtesting
.
MantidSystemTest
):
def
runTest
(
self
):
_setup_focus
()
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
focus_directory
)
test
.
focus
(
run_number
=
"
299080
"
,
cropped
=
"
spectra
"
,
spectra
=
"
1-20
"
)
def
validate
(
self
):
return
"
engg_focus_output
"
,
"
enggui_focusing_output_ws_bank_cropped.nxs
"
def
cleanup
(
self
):
simple
.
mtd
.
clear
()
_tear_down_focus
()
class
FocusTextureMode
(
systemtesting
.
MantidSystemTest
):
def
runTest
(
self
):
_setup_focus
()
csv_file
=
os
.
path
.
join
(
root_directory
,
"
EnginX.csv
"
)
location
=
os
.
path
.
join
(
focus_directory
,
"
User
"
,
"
test
"
,
"
Calibration
"
)
shutil
.
copy2
(
csv_file
,
location
)
csv_file
=
os
.
path
.
join
(
location
,
"
EnginX.csv
"
)
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
focus_directory
)
test
.
focus
(
run_number
=
"
299080
"
,
grouping_file
=
csv_file
)
output
=
"
engg_focusing_output_ws_texture_bank_{}{}
"
group
=
""
for
i
in
range
(
1
,
11
):
group
=
group
+
output
.
format
(
i
,
"
,
"
)
simple
.
GroupWorkspaces
(
InputWorkspaces
=
group
,
OutputWorkspace
=
"
test
"
)
def
validate
(
self
):
outputlist
=
[
"
engg_focusing_output_ws_texture_bank_{}
"
.
format
(
i
)
for
i
in
range
(
1
,
11
)]
filelist
=
[
"
enggui_texture_Bank_{}.nxs
"
.
format
(
i
)
for
i
in
range
(
1
,
11
)]
validation_list
=
[
x
for
t
in
zip
(
*
[
outputlist
,
filelist
])
for
x
in
t
]
return
validation_list
def
cleanup
(
self
):
simple
.
mtd
.
clear
()
_tear_down_focus
()
def
_try_delete
(
path
):
def
_try_delete
(
path
):
...
@@ -105,3 +164,15 @@ def _try_delete(path):
...
@@ -105,3 +164,15 @@ def _try_delete(path):
print
(
"
Could not delete output file at:
"
,
path
)
print
(
"
Could not delete output file at:
"
,
path
)
def
_setup_focus
():
os
.
makedirs
(
focus_directory
)
test
=
EnginX
(
user
=
"
test
"
,
vanadium_run
=
"
236516
"
,
directory
=
focus_directory
)
test
.
create_vanadium
()
test
.
create_calibration
()
test
.
create_calibration
(
cropped
=
"
spectra
"
,
spectra
=
"
1-20
"
)
simple
.
mtd
.
clear
()
def
_tear_down_focus
():
_try_delete
(
focus_directory
)
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