Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
payno
id06workflow
Commits
d719ad15
Commit
d719ad15
authored
Oct 16, 2018
by
payno
Browse files
[fix] fix datareduction operation
parent
cd60a4f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
id06workflow/core/experiment/operation/datareduction.py
View file @
d719ad15
...
...
@@ -53,7 +53,7 @@ class DataReduction(OverwritingOperation):
if
cache_data
is
None
:
self
.
_cache_data
=
self
.
data
[...][::
self
.
_z_factor
,
::
self
.
_y_factor
,
::
self
.
_x_factor
]
else
:
self
.
_cache_data
=
cache_data
self
.
_cache_data
=
cache_data
[::
self
.
_z_factor
,
::
self
.
_y_factor
,
::
self
.
_x_factor
]
return
self
.
_cache_data
def
compute
(
self
):
...
...
@@ -66,9 +66,12 @@ class DataReduction(OverwritingOperation):
raise
ValueError
(
'No data in cache'
)
self
.
data
=
self
.
_cache_data
self
.
clear_cache
()
self
.
registerOperation
()
return
self
.
data
def
clear_cache
(
self
):
self
.
_cache_data
=
None
def
key
(
self
):
return
' '
.
join
((
self
.
_name
,
'x:'
,
str
(
self
.
_x_factor
),
'y:'
,
str
(
self
.
_y_factor
),
'z:'
,
str
(
self
.
_z_factor
)))
orangecontrib/id06workflow/widgets/datareduction.py
View file @
d719ad15
...
...
@@ -92,12 +92,9 @@ class DataReductionOW(OWWidget):
def
_process
(
self
,
experiment
):
if
experiment
is
None
:
return
try
:
operation
=
DataReduction
(
experiment
=
experiment
,
x_factor
=
self
.
getXReduction
(),
y_factor
=
self
.
getYReduction
(),
z_factor
=
self
.
getZReduction
())
operation
.
compute
()
self
.
send
(
"data"
,
experiment
)
except
Exception
as
e
:
_logger
.
error
(
e
)
operation
=
DataReduction
(
experiment
=
experiment
,
x_factor
=
self
.
getXReduction
(),
y_factor
=
self
.
getYReduction
(),
z_factor
=
self
.
getZReduction
())
operation
.
compute
()
self
.
send
(
"data"
,
experiment
)
Write
Preview
Supports
Markdown
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