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
b82cc6a8
Commit
b82cc6a8
authored
6 years ago
by
Sam Jenkins
Browse files
Options
Downloads
Patches
Plain Diff
Re #24512 updated tests to work with flat vile version
parent
6153f692
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
+79
-87
79 additions, 87 deletions
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
with
79 additions
and
87 deletions
Testing/SystemTests/tests/analysis/EnginXScriptTest.py
+
79
−
87
View file @
b82cc6a8
...
@@ -24,7 +24,7 @@ class CreateVanadiumTest(systemtesting.MantidSystemTest):
...
@@ -24,7 +24,7 @@ class CreateVanadiumTest(systemtesting.MantidSystemTest):
def
runTest
(
self
):
def
runTest
(
self
):
os
.
makedirs
(
cal_directory
)
os
.
makedirs
(
cal_directory
)
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
None
,
force_vanadium
=
True
)
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
None
,
force_vanadium
=
True
,
directory
=
cal_directory
)
def
validate
(
self
):
def
validate
(
self
):
return
"
eng_vanadium_integration
"
,
"
engggui_vanadium_integration.nxs
"
return
"
eng_vanadium_integration
"
,
"
engggui_vanadium_integration.nxs
"
...
@@ -66,84 +66,79 @@ class CreateCalibrationCroppedTest(systemtesting.MantidSystemTest):
...
@@ -66,84 +66,79 @@ class CreateCalibrationCroppedTest(systemtesting.MantidSystemTest):
_try_delete
(
cal_directory
)
_try_delete
(
cal_directory
)
# class CreateCalibrationBankTest(systemtesting.MantidSystemTest):
class
CreateCalibrationBankTest
(
systemtesting
.
MantidSystemTest
):
#
# def runTest(self):
def
runTest
(
self
):
# os.makedirs(cal_directory)
os
.
makedirs
(
cal_directory
)
# test = EnginX(user="test", vanadium_run="236516",
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
None
,
do_cal
=
True
,
directory
=
cal_directory
,
# directory=cal_directory)
crop_type
=
"
banks
"
,
crop_on
=
"
South
"
)
# test.create_vanadium()
# test.create_calibration(cropped="banks", bank="South")
def
validate
(
self
):
#
return
(
"
engg_calibration_bank_2
"
,
"
engggui_calibration_bank_2.nxs
"
,
# def validate(self):
"
engg_calibration_banks_parameters
"
,
"
engggui_calibration_bank_south_parameters.nxs
"
)
# return ("engg_calibration_bank_2", "engggui_calibration_bank_2.nxs",
# "engg_calibration_banks_parameters", "engggui_calibration_bank_south_parameters.nxs")
def
cleanup
(
self
):
#
simple
.
mtd
.
clear
()
# def cleanup(self):
_try_delete
(
cal_directory
)
# simple.mtd.clear()
# _try_delete(cal_directory)
#
class
FocusBothBanks
(
systemtesting
.
MantidSystemTest
):
#
# class FocusBothBanks(systemtesting.MantidSystemTest):
def
runTest
(
self
):
#
os
.
makedirs
(
focus_directory
)
# def runTest(self):
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
"
299080
"
,
do_cal
=
True
,
directory
=
focus_directory
)
# _setup_focus()
# test = EnginX(user="test", vanadium_run="236516",
def
validate
(
self
):
# directory=focus_directory)
return
(
"
engg_focus_output_bank_1
"
,
"
enggui_focusing_output_ws_bank_1.nxs
"
,
# test.focus(run_number="299080")
"
engg_focus_output_bank_2
"
,
"
enggui_focusing_output_ws_bank_2.nxs
"
)
#
# def validate(self):
def
cleanup
(
self
):
# return("engg_focus_output_bank_1", "enggui_focusing_output_ws_bank_1.nxs",
simple
.
mtd
.
clear
()
# "engg_focus_output_bank_2", "enggui_focusing_output_ws_bank_2.nxs")
_try_delete
(
focus_directory
)
#
# def cleanup(self):
# simple.mtd.clear()
class
FocusCropped
(
systemtesting
.
MantidSystemTest
):
# _try_delete(focus_directory)
def
runTest
(
self
):
#
os
.
makedirs
(
focus_directory
)
#
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
"
299080
"
,
directory
=
focus_directory
,
# class FocusCropped(systemtesting.MantidSystemTest):
crop_type
=
"
spectra
"
,
crop_on
=
"
1-20
"
)
#
# def runTest(self):
def
validate
(
self
):
# _setup_focus()
return
"
engg_focus_output
"
,
"
enggui_focusing_output_ws_bank_cropped.nxs
"
# test = EnginX(user="test", vanadium_run="236516",
# directory=focus_directory)
def
cleanup
(
self
):
# test.focus(run_number="299080", cropped="spectra", spectra="1-20")
simple
.
mtd
.
clear
()
#
_try_delete
(
focus_directory
)
# def validate(self):
# return "engg_focus_output", "enggui_focusing_output_ws_bank_cropped.nxs"
#
class
FocusTextureMode
(
systemtesting
.
MantidSystemTest
):
# def cleanup(self):
# simple.mtd.clear()
def
runTest
(
self
):
# _try_delete(focus_directory)
os
.
makedirs
(
focus_directory
)
#
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
None
,
do_cal
=
True
,
directory
=
focus_directory
)
#
simple
.
mtd
.
clear
()
# class FocusTextureMode(systemtesting.MantidSystemTest):
csv_file
=
os
.
path
.
join
(
root_directory
,
"
EnginX.csv
"
)
#
location
=
os
.
path
.
join
(
focus_directory
,
"
User
"
,
"
test
"
,
"
Calibration
"
)
# def runTest(self):
shutil
.
copy2
(
csv_file
,
location
)
# _setup_focus()
csv_file
=
os
.
path
.
join
(
location
,
"
EnginX.csv
"
)
# csv_file = os.path.join(root_directory, "EnginX.csv")
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
"
299080
"
,
do_cal
=
True
,
directory
=
focus_directory
,
# location = os.path.join(focus_directory, "User", "test", "Calibration")
grouping_file
=
csv_file
)
# shutil.copy2(csv_file, location)
output
=
"
engg_focusing_output_ws_texture_bank_{}{}
"
# csv_file = os.path.join(location, "EnginX.csv")
group
=
""
# test = EnginX(user="test", vanadium_run="236516",
# directory=focus_directory)
for
i
in
range
(
1
,
11
):
# test.focus(run_number="299080", grouping_file=csv_file)
group
=
group
+
output
.
format
(
i
,
"
,
"
)
# output = "engg_focusing_output_ws_texture_bank_{}{}"
simple
.
GroupWorkspaces
(
InputWorkspaces
=
group
,
OutputWorkspace
=
"
test
"
)
# group = ""
#
def
validate
(
self
):
# for i in range(1, 11):
outputlist
=
[
"
engg_focusing_output_ws_texture_bank_{}
"
.
format
(
i
)
for
i
in
range
(
1
,
11
)]
# group = group+output.format(i, ",")
filelist
=
[
"
enggui_texture_Bank_{}.nxs
"
.
format
(
i
)
for
i
in
range
(
1
,
11
)]
# simple.GroupWorkspaces(InputWorkspaces=group, OutputWorkspace="test")
validation_list
=
[
x
for
t
in
zip
(
*
[
outputlist
,
filelist
])
for
x
in
t
]
#
return
validation_list
# def validate(self):
# outputlist=["engg_focusing_output_ws_texture_bank_{}".format(i) for i in range(1, 11)]
def
cleanup
(
self
):
# filelist=["enggui_texture_Bank_{}.nxs".format(i) for i in range(1, 11)]
simple
.
mtd
.
clear
()
# validation_list = [x for t in zip(*[outputlist, filelist])for x in t]
_try_delete
(
focus_directory
)
# return validation_list
#
# def cleanup(self):
# simple.mtd.clear()
# _try_delete(focus_directory)
def
_try_delete
(
path
):
def
_try_delete
(
path
):
...
@@ -157,11 +152,8 @@ def _try_delete(path):
...
@@ -157,11 +152,8 @@ def _try_delete(path):
print
(
"
Could not delete output file at:
"
,
path
)
print
(
"
Could not delete output file at:
"
,
path
)
# def _setup_focus():
def
_setup_focus
():
# os.makedirs(focus_directory)
os
.
makedirs
(
focus_directory
)
# test = EnginX(user="test", vanadium_run="236516",
main
(
vanadium_run
=
"
236516
"
,
user
=
"
test
"
,
focus_run
=
None
,
do_cal
=
True
,
directory
=
focus_directory
,
# directory=focus_directory)
crop_type
=
"
spectra
"
,
crop_on
=
"
1-20
"
)
# test.create_vanadium()
simple
.
mtd
.
clear
()
# test.create_calibration()
# test.create_calibration(cropped="spectra", spectra="1-20")
# simple.mtd.clear()
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