Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
workflow
ewoksapps
est
Commits
13493a73
Commit
13493a73
authored
Mar 11, 2021
by
payno
Browse files
[esrftaskgraph] from task graph to orange widget: handle graph and qualified name
settings are not handled yet.
parent
1dc2c251
Changes
7
Hide whitespace changes
Inline
Side-by-side
est/core/process/ignoreprocess.py
0 → 100644
View file @
13493a73
from
esrftaskgraph
import
Task
class
IgnoreTask
(
Task
):
INPUT_NAMES
=
[
"xas_obj"
]
OUTPUT_NAMES
=
[
"xas_obj"
]
def
process
(
self
):
pass
class
IgnoreInput
(
IgnoreTask
):
@
staticmethod
def
registry_name
():
return
"ignored read"
class
IgnoreOrangeConversion
(
IgnoreTask
):
@
staticmethod
def
registry_name
():
return
"ignored conversion to orange table"
class
IgnoreSavingPoint
(
IgnoreTask
):
@
staticmethod
def
registry_name
():
return
"ignored saving point"
class
IgnoreE0Calculation
(
IgnoreTask
):
@
staticmethod
def
registry_name
():
return
"ignored E0 calculation"
est/core/process/noise.py
View file @
13493a73
...
...
@@ -253,7 +253,7 @@ class NoiseProcess(Process):
return
pkg_resources
.
get_distribution
(
"est"
).
version
@
staticmethod
def
registry_name
(
self
):
def
registry_name
():
return
"noise_savgol"
__call__
=
process
est/core/types/xasobject.py
View file @
13493a73
...
...
@@ -59,7 +59,7 @@ else:
_logger
=
logging
.
getLogger
(
__name__
)
class
XASObject
()
:
class
XASObject
:
"""Base class of XAS
:param spectra: absorbed beam as a list of :class:`.Spectrum` or a
...
...
orangecontrib/est/widgets/utils/converter.py
View file @
13493a73
...
...
@@ -33,6 +33,7 @@ from Orange.widgets.widget import Input, Output
from
est.core.types
import
XASObject
from
orangecontrib.est.utils
import
Converter
import
Orange.data
import
est.core.process.ignoreprocess
class
ConverterOW
(
OWWidget
):
...
...
@@ -63,6 +64,8 @@ class ConverterOW(OWWidget):
# by default we want to avoid sending 'Orange.data.Table' to avoid
# loosing the XASObject flow process and results.
esrftaskclass
=
est
.
core
.
process
.
ignoreprocess
.
IgnoreOrangeConversion
@
Inputs
.
xas_obj
def
process
(
self
,
xas_object
):
if
xas_object
is
None
:
...
...
orangecontrib/est/widgets/utils/e0calculator.py
View file @
13493a73
...
...
@@ -36,7 +36,7 @@ import Orange.data
from
orangecontrib.est.utils
import
Converter
from
silx.gui
import
qt
import
functools
import
est.core.process.ignoreprocess
import
est.core.process.setconfig
from
est.core.types
import
XASObject
from
est.gui.e0calculator
import
E0Calculator
,
E0ComputationMethod
...
...
@@ -66,7 +66,9 @@ class E0calculatorOW(OWWidget):
"Region of Interest"
,
]
esrftaskclass
=
est
.
core
.
process
.
setconfig
.
_xas_set_config
# I guess this one should not be ignored. We should at least have
# some settings management or an algorithm to find E0
esrftaskclass
=
est
.
core
.
process
.
ignoreprocess
.
IgnoreE0Calculation
want_main_area
=
True
resizing_enabled
=
True
...
...
orangecontrib/est/widgets/utils/saving_point.py
View file @
13493a73
...
...
@@ -32,6 +32,7 @@ from Orange.widgets.widget import OWWidget
from
Orange.widgets.widget
import
Input
,
Output
from
est.core.types
import
XASObject
from
silx.gui
import
qt
import
est.core.process.ignoreprocess
import
logging
_logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -57,6 +58,8 @@ class SavingPointOW(OWWidget):
resizing_enabled
=
False
allows_cycle
=
False
esrftaskclass
=
est
.
core
.
process
.
ignoreprocess
.
IgnoreSavingPoint
class
Inputs
:
xas_obj
=
Input
(
"xas_obj"
,
XASObject
,
default
=
True
)
...
...
orangecontrib/est/widgets/utils/xas_input.py
View file @
13493a73
...
...
@@ -33,14 +33,14 @@ from Orange.widgets import gui
from
Orange.widgets.settings
import
Setting
from
orangecontrib.est.process
import
OWESRFWidget
from
Orange.widgets.widget
import
OWWidget
from
Orange.widgets.widget
import
Output
from
silx.gui
import
qt
from
silx.io.url
import
DataUrl
import
est.core.io
import
est.core.process.ignoreprocess
from
est.core.types
import
XASObject
from
est.gui.xas_object_definition
import
XASObjectWindow
from
es
rftaskgraph
import
Variable
from
es
t.core.types
import
XASObject
_logger
=
logging
.
getLogger
(
__file__
)
...
...
@@ -48,7 +48,7 @@ _logger = logging.getLogger(__file__)
_DEBUG
=
False
class
XASInputOW
(
OW
ESRF
Widget
):
class
XASInputOW
(
OWWidget
):
"""
Widget used for signal extraction
"""
...
...
@@ -60,6 +60,7 @@ class XASInputOW(OWESRFWidget):
priority
=
0
category
=
"esrfWidgets"
keywords
=
[
"spectroscopy"
,
"signal"
,
"input"
,
"file"
]
esrftaskclass
=
est
.
core
.
process
.
ignoreprocess
.
IgnoreInput
want_main_area
=
True
...
...
@@ -77,10 +78,8 @@ class XASInputOW(OWESRFWidget):
_I2_url_setting
=
Setting
(
str
())
_mu_ref_url_setting
=
Setting
(
str
())
process_function
=
est
.
core
.
io
.
read_frm_file
class
Outputs
:
output
=
Output
(
"xas_obj"
,
Variable
)
res_xas_obj
=
Output
(
"xas_obj"
,
XASObject
)
# by default we want to avoid sending 'Orange.data.Table' to avoid
# loosing the XASObject flow process and results.
...
...
@@ -92,9 +91,6 @@ class XASInputOW(OWESRFWidget):
self
.
_inputDialog
=
XASObjectWindow
(
parent
=
self
)
self
.
_inputWindow
.
layout
().
addWidget
(
self
.
_inputDialog
,
0
,
0
,
1
,
2
)
style
=
qt
.
QApplication
.
instance
().
style
()
icon
=
style
.
standardIcon
(
qt
.
QStyle
.
SP_DialogApplyButton
)
# add the apply button
types
=
qt
.
QDialogButtonBox
.
Ok
self
.
_buttons
=
qt
.
QDialogButtonBox
(
parent
=
self
)
...
...
@@ -108,7 +104,6 @@ class XASInputOW(OWESRFWidget):
layout
=
gui
.
vBox
(
self
.
mainArea
,
"input"
).
layout
()
layout
.
addWidget
(
self
.
_inputWindow
)
# deal with setting
try
:
self
.
_loadSettings
()
except
:
...
...
@@ -123,8 +118,6 @@ class XASInputOW(OWESRFWidget):
self
.
_inputDialog
.
getMainWindow
().
editingFinished
.
connect
(
self
.
_storeSettings
)
self
.
setFileSelected
=
self
.
_inputDialog
.
setDatFile
self
.
handleNewSignals
()
def
_emitNewFile
(
self
,
*
args
,
**
kwargs
):
try
:
xas_obj
=
self
.
_inputDialog
.
buildXASObject
()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment