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
a163e0b9
Commit
a163e0b9
authored
Dec 09, 2020
by
payno
Browse files
black format
parent
9dd8869d
Pipeline
#38647
passed with stages
in 6 minutes and 10 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
est/app/canvas_launcher/launcher.py
View file @
a163e0b9
from
silx.gui
import
qt
from
Orange.canvas
import
__main__
as
main
try
:
from
orangecanvas
import
config
except
ImportError
:
from
Orange.canvas
import
config
old_config
=
True
else
:
old_config
=
False
...
...
@@ -18,6 +20,7 @@ def version():
if
old_config
:
class
EstConfig
(
config
.
Config
):
ApplicationName
=
"est"
ApplicationVersion
=
version
()
...
...
@@ -33,7 +36,10 @@ if old_config:
@
staticmethod
def
application_icon
(
self
):
return
getIcon
()
else
:
class
EstConfig
(
config
.
Config
):
ApplicationName
=
"est"
ApplicationVersion
=
version
()
...
...
est/app/process.py
View file @
a163e0b9
...
...
@@ -5,6 +5,7 @@ from pypushflow.representation.scheme.ows_parser import OwsParser
try
:
from
est.io.utils.pymca
import
read_spectrum
has_read_spectrum
=
True
except
ImportError
:
has_read_spectrum
=
False
...
...
@@ -13,6 +14,7 @@ from est.core.io import read_xas
import
logging
import
signal
from
pypushflow.representation.scheme.scheme
import
Scheme
try
:
import
h5py
...
...
@@ -25,10 +27,12 @@ logging.basicConfig(level=logging.DEBUG)
_logger
=
logging
.
getLogger
(
__name__
)
def
exec_
(
scheme
:
Scheme
,
input_
:
Union
[
str
,
None
,
dict
]
=
None
,
output_
:
Union
[
str
,
None
,
dict
]
=
None
,
timeout
:
Union
[
int
,
None
]
=
None
):
def
exec_
(
scheme
:
Scheme
,
input_
:
Union
[
str
,
None
,
dict
]
=
None
,
output_
:
Union
[
str
,
None
,
dict
]
=
None
,
timeout
:
Union
[
int
,
None
]
=
None
,
):
def
manage_input
():
if
input_
:
# monkey patch the input file for start nodes if an input is given
...
...
est/app/reprocessing.py
View file @
a163e0b9
...
...
@@ -4,6 +4,7 @@ import logging
from
est.core.types
import
XASObject
from
est.core.reprocessing
import
get_process_instance_frm_h5_desc
from
typing
import
Union
try
:
import
h5py
...
...
est/core/types.py
View file @
a163e0b9
...
...
@@ -402,8 +402,9 @@ class XASObject(object):
)
@
staticmethod
def
_spectra_volume
(
spectra
:
list
,
key
:
str
,
dim_1
:
int
,
dim_2
:
int
,
relative_to
:
str
=
"energy"
):
def
_spectra_volume
(
spectra
:
list
,
key
:
str
,
dim_1
:
int
,
dim_2
:
int
,
relative_to
:
str
=
"energy"
):
"""Convert a list of spectra (mu) to a numpy array.
..note: only convert raw data for now"""
...
...
@@ -611,8 +612,7 @@ class XASObject(object):
return
len
(
self
.
__spectra
)
def
spectra_keys
(
self
)
->
tuple
:
"""keys contained by the spectrum object (energy, mu, normalizedmu...)
"""
"""keys contained by the spectrum object (energy, mu, normalizedmu...)"""
if
len
(
self
.
spectra
)
>
0
:
assert
isinstance
(
self
.
spectra
[
0
],
Spectrum
)
return
tuple
(
self
.
spectra
[
0
].
keys
())
...
...
@@ -803,11 +803,13 @@ class Spectrum(_Spectrum_Base):
_Y_POS_KEY
=
"YPos"
def
__init__
(
self
,
energy
:
Union
[
None
,
numpy
.
ndarray
]
=
None
,
mu
:
Union
[
None
,
numpy
.
ndarray
]
=
None
,
x
:
Union
[
None
,
int
]
=
None
,
y
:
Union
[
None
,
int
]
=
None
):
def
__init__
(
self
,
energy
:
Union
[
None
,
numpy
.
ndarray
]
=
None
,
mu
:
Union
[
None
,
numpy
.
ndarray
]
=
None
,
x
:
Union
[
None
,
int
]
=
None
,
y
:
Union
[
None
,
int
]
=
None
,
):
super
().
__init__
()
if
energy
is
not
None
:
assert
isinstance
(
energy
,
(
numpy
.
ndarray
,
pint
.
Quantity
))
...
...
@@ -1233,8 +1235,6 @@ class _FT(object):
class
Sample
(
object
):
"""Description of the sample. Needed for writing valid nx file"""
def
__init__
(
self
,
name
:
str
=
"undefined sample"
,
description
:
dict
=
None
):
def
__init__
(
self
,
name
:
str
=
"undefined sample"
,
description
:
dict
=
None
):
self
.
name
=
name
self
.
description
=
description
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