Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xsocs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
22
Issues
22
List
Boards
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kmap
xsocs
Commits
4646fcb3
Commit
4646fcb3
authored
Dec 07, 2018
by
Thomas Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean-up unused code
parent
ce50d120
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
83 deletions
+0
-83
xsocs/process/test/test_fitter.py
xsocs/process/test/test_fitter.py
+0
-83
No files found.
xsocs/process/test/test_fitter.py
View file @
4646fcb3
...
...
@@ -33,97 +33,14 @@ __date__ = "05/01/2016"
import
os
import
shutil
import
sys
import
tempfile
import
unittest
import
numpy
as
np
from
silx.utils.testutils
import
ParametricTestCase
from
xsocs
import
config
from
xsocs.test.utils
import
test_resources
from
xsocs.process.fit
import
PeakFitter
,
FitResult
,
FitTypes
,
BackgroundTypes
from
xsocs.io.FitH5
import
FitH5
def
_cmp_fit_h5_files
(
test_case
,
ref_h5
,
this_h5
):
"""Compares two FitH5 files.
:param test_case:
:param ref_h5:
:param this_h5:
:return:
"""
ref_entries
=
ref_h5
.
entries
()
this_entries
=
this_h5
.
entries
()
test_case
.
assertEqual
(
ref_entries
,
this_entries
)
for
entry
in
ref_entries
:
_cmp_fit_h5_processes
(
test_case
,
ref_h5
,
this_h5
,
entry
)
def
_cmp_fit_h5_processes
(
test_case
,
ref_h5
,
this_h5
,
entry
):
"""Compares two FitH5 files
:param test_case:
:param ref_h5:
:param this_h5:
:param entry:
:return:
"""
ref_processes
=
ref_h5
.
processes
(
entry
)
this_processes
=
this_h5
.
processes
(
entry
)
test_case
.
assertEqual
(
ref_processes
,
this_processes
)
for
process
in
ref_processes
:
_cmp_fit_h5_results
(
test_case
,
ref_h5
,
this_h5
,
entry
,
process
)
def
_cmp_fit_h5_results
(
test_case
,
ref_h5
,
this_h5
,
entry
,
process
):
"""Compares two FitH5 files
:param test_case:
:param ref_h5:
:param this_h5:
:param entry:
:param process:
:return:
"""
ref_results
=
ref_h5
.
get_result_names
(
entry
,
process
)
this_results
=
this_h5
.
get_result_names
(
entry
,
process
)
test_case
.
assertEqual
(
ref_results
,
this_results
)
if
sys
.
platform
==
'win32'
:
# Relax tests on Windows
compare_arrays
=
np
.
allclose
else
:
compare_arrays
=
np
.
array_equal
for
result
in
ref_results
:
ref_qx
=
ref_h5
.
get_axis_result
(
entry
,
process
,
result
,
0
)
this_qx
=
this_h5
.
get_axis_result
(
entry
,
process
,
result
,
0
)
test_case
.
assertTrue
(
compare_arrays
(
ref_qx
,
this_qx
))
ref_qy
=
ref_h5
.
get_axis_result
(
entry
,
process
,
result
,
1
)
this_qy
=
this_h5
.
get_axis_result
(
entry
,
process
,
result
,
1
)
test_case
.
assertTrue
(
compare_arrays
(
ref_qy
,
this_qy
))
ref_qz
=
ref_h5
.
get_axis_result
(
entry
,
process
,
result
,
2
)
this_qz
=
this_h5
.
get_axis_result
(
entry
,
process
,
result
,
2
)
test_case
.
assertTrue
(
compare_arrays
(
ref_qz
,
this_qz
))
class
TestPeakFitter
(
ParametricTestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment