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
0a61cc25
Commit
0a61cc25
authored
Aug 12, 2021
by
Wout De Nolf
Browse files
flake8
parent
8749bde5
Pipeline
#52597
passed with stages
in 15 minutes and 30 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
0a61cc25
...
...
@@ -16,10 +16,10 @@ check_style:
stage
:
style
image
:
docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
before_script
:
-
pip install black
-
pip install black
flake8
script
:
# run black
-
LC_ALL=C.UTF-8 black --check --safe .
-
flake8
# build
...
...
est/__main__.py
View file @
0a61cc25
...
...
@@ -36,9 +36,6 @@ __date__ = "10/12/2020"
import
logging
logging
.
basicConfig
()
import
sys
from
silx.utils.launcher
import
Launcher
...
...
@@ -50,6 +47,9 @@ except ImportError:
import_version
=
False
logging
.
basicConfig
()
def
main
():
"""Main function of the launcher
...
...
est/app/canvas_launcher/launcher.py
View file @
0a61cc25
...
...
@@ -10,7 +10,8 @@ except ImportError:
else
:
old_config
=
False
from
.splash
import
splash_screen
,
getIcon
import
os
,
sys
import
os
import
sys
from
Orange.misc
import
environ
import
pkg_resources
...
...
est/core/process/larch/pre_edge.py
View file @
0a61cc25
...
...
@@ -152,7 +152,7 @@ class Larch_pre_edge(
_xas_obj
,
data_keys
=
(
_NexusDatasetDef
(
"flat"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
"\mu(E)"
"flat"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
r
"\mu(E)"
),
_NexusDatasetDef
(
"dmude"
),
_NexusDatasetDef
(
"edge_step_poly"
),
...
...
@@ -162,11 +162,11 @@ class Larch_pre_edge(
_NexusDatasetDef
(
"pre_edge_details"
),
_NexusDatasetDef
(
"e0"
,
"eV"
),
_NexusDatasetDef
(
"Mu"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
"\mu(E)"
"Mu"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
r
"\mu(E)"
),
_NexusDatasetDef
(
"energy"
,
"eV"
),
_NexusDatasetDef
(
"mu_ref"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
"\mu(E)"
"mu_ref"
,
units
=
"{}(E)"
.
format
(
MU_CHAR
),
units_latex
=
r
"\mu(E)"
),
_NexusDatasetDef
(
"I0"
),
_NexusDatasetDef
(
"I1"
),
...
...
@@ -179,7 +179,7 @@ class Larch_pre_edge(
auxiliary_signals
=
None
,
silx_style
=
{
"signal_scale_type"
:
"linear"
},
title
=
"Mu"
,
title_latex
=
"\mu"
,
title_latex
=
r
"\mu"
,
),
_NexusSpectrumDef
(
signal
=
"Mu"
,
...
...
@@ -196,7 +196,7 @@ class Larch_pre_edge(
auxiliary_signals
=
(
"mu_ref"
,),
silx_style
=
{
"signal_scale_type"
:
"linear"
},
title
=
"Mu vs Mu ref"
,
title_latex
=
"\mu \quad vs \quad \mu_{ref}"
,
title_latex
=
r
"\mu \quad vs \quad \mu_{ref}"
,
),
_NexusSpectrumDef
(
signal
=
"flat"
,
...
...
@@ -204,7 +204,7 @@ class Larch_pre_edge(
auxiliary_signals
=
None
,
silx_style
=
{
"signal_scale_type"
:
"linear"
},
title
=
"Mu flat"
,
title_latex
=
"\mu_{flat}"
,
title_latex
=
r
"\mu_{flat}"
,
),
),
)
...
...
est/core/process/larch/xftf.py
View file @
0a61cc25
...
...
@@ -188,41 +188,41 @@ class Larch_xftf(
_NexusDatasetDef
(
"chir_im"
,
units
=
"{}^(-3)"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}^{-3}"
,
units_latex
=
r
"\mathring{A}^{-3}"
,
),
_NexusDatasetDef
(
"chir_re"
),
_NexusDatasetDef
(
"chir_mag"
,
units
=
"{}^(-3)"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}^{-3}"
,
units_latex
=
r
"\mathring{A}^{-3}"
,
),
_NexusDatasetDef
(
"masked_chir_mag"
,
units
=
"{}"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}"
,
units_latex
=
r
"\mathring{A}"
,
),
_NexusDatasetDef
(
"r"
,
units
=
"{}"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}"
"r"
,
units
=
"{}"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
r
"\mathring{A}"
),
_NexusDatasetDef
(
"masked_r"
,
units
=
"{}"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}"
,
units_latex
=
r
"\mathring{A}"
,
),
_NexusDatasetDef
(
"k"
,
units
=
"{}^(-1)"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}^{-1}"
,
units_latex
=
r
"\mathring{A}^{-1}"
,
),
_NexusDatasetDef
(
"masked_k"
,
units
=
"{}^(-1)"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}^{-1}"
,
units_latex
=
r
"\mathring{A}^{-1}"
,
),
_NexusDatasetDef
(
"masked_chi_weighted_k"
,
units
=
"{}^(-2)"
.
format
(
ANGSTROM_CHAR
),
units_latex
=
"\mathring{A}^{-2}"
,
units_latex
=
r
"\mathring{A}^{-2}"
,
),
),
plots
=
(
...
...
@@ -232,7 +232,7 @@ class Larch_xftf(
auxiliary_signals
=
None
,
silx_style
=
{
"signal_scale_type"
:
"linear"
},
title
=
"chi(k)*k^k_weight"
,
title_latex
=
"\chi(k).k^{k\_weight}"
,
title_latex
=
r
"\chi(k).k^{k\_weight}"
,
),
_NexusSpectrumDef
(
signal
=
"masked_chir_mag"
,
...
...
est/core/process/pymca/normalization.py
View file @
0a61cc25
...
...
@@ -32,7 +32,7 @@ import functools
import
logging
import
multiprocessing
from
PyMca5.PyMcaPhysics.xas.XASClass
import
XASClass
from
est.core.process.process
import
Process
,
Progress
from
est.core.process.process
import
Process
from
est.core.process.process
import
_NexusDatasetDef
from
est.core.types
import
Spectrum
,
XASObject
...
...
est/core/process/pymca/test/test_workflow.py
View file @
0a61cc25
...
...
@@ -23,7 +23,7 @@
#
# ###########################################################################*/
"""
unit test for workflow composed of pymca process
unit test for workflow composed of pymca process
"""
__authors__
=
[
"H. Payno"
]
__license__
=
"MIT"
...
...
est/gui/noise.py
View file @
0a61cc25
...
...
@@ -70,7 +70,7 @@ class _SavitskyGolayNoiseOpts(qt.QWidget):
qt
.
QWidget
.
__init__
(
self
,
parent
)
self
.
setLayout
(
qt
.
QFormLayout
())
#
#
Inputs
# Inputs
self
.
layout
().
addRow
(
qt
.
QLabel
(
"Inputs"
,
self
))
# add window size
...
...
@@ -104,8 +104,9 @@ class _SavitskyGolayNoiseOpts(qt.QWidget):
self
.
_eEnd
.
setValue
(
10000000000
)
self
.
layout
().
addRow
(
qt
.
QLabel
(
" - E end"
,
self
),
self
.
_eEnd
)
#
#
Outputs
# Outputs
self
.
layout
().
addRow
(
qt
.
QLabel
(
"Outputs"
,
self
))
# raw data average noise
self
.
_rawData
=
qt
.
QLineEdit
(
""
,
self
)
self
.
_rawData
.
setReadOnly
(
True
)
...
...
est/gui/qtapplicationmanager.py
View file @
0a61cc25
...
...
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#############################################################################*/
#
############################################################################*/
"""
This module is used to manage the rsync between files for transfert.
...
...
est/gui/roiselector.py
View file @
0a61cc25
...
...
@@ -64,8 +64,7 @@ class ROISelector(qt.QWidget):
self
.
_roi
.
setName
(
"ROI"
)
self
.
_roiManager
.
addRoi
(
self
.
_roi
)
self
.
__roi_first_definition
=
True
"""flag used make sure the roi is clearly visible at least during the
first processing"""
"""flag used make sure the roi is clearly visible at least during the first processing"""
# Create the table widget displaying
self
.
_roiTable
=
RegionOfInterestTableWidget
()
...
...
est/io/io.py
View file @
0a61cc25
...
...
@@ -161,6 +161,7 @@ def load_data(
assert
name
==
"spectra"
# TODO: might need to be improved because this is redefined each
# time. Not sure about the cost
@
silx
.
io
.
h5py_utils
.
retry
(
retry_timeout
=
timeout
)
def
read_dataset
(
url
):
spectra
=
[]
...
...
est/version.py
View file @
0a61cc25
...
...
@@ -50,6 +50,7 @@ Thus 2.1.0a3 is hexversion 0x020100a3.
"""
from
__future__
import
absolute_import
,
print_function
,
division
from
collections
import
namedtuple
__authors__
=
[
"Jérôme Kieffer"
,
"H.Payno"
]
__license__
=
"MIT"
...
...
@@ -83,8 +84,6 @@ SERIAL = 1 # <16
date
=
__date__
from
collections
import
namedtuple
_version_info
=
namedtuple
(
"version_info"
,
[
"major"
,
"minor"
,
"micro"
,
"releaselevel"
,
"serial"
]
)
...
...
orangecontrib/est/test/__init__.py
View file @
0a61cc25
...
...
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#############################################################################*/
#
############################################################################*/
__authors__
=
[
"H.Payno"
]
...
...
run_tests.py
View file @
0a61cc25
...
...
@@ -44,6 +44,7 @@ import time
import
unittest
import
collections
from
argparse
import
ArgumentParser
import
warnings
class
StreamHandlerUnittestReady
(
logging
.
StreamHandler
):
...
...
@@ -79,7 +80,6 @@ logging.root.addHandler(createBasicHandler())
# Capture all default warnings
logging
.
captureWarnings
(
True
)
import
warnings
warnings
.
simplefilter
(
"default"
)
...
...
snippets/raw_bm23_analysis.py
View file @
0a61cc25
...
...
@@ -57,10 +57,8 @@ class AnalysisThread(threading.Thread):
max_raw_energy
=
max
(
self
.
spectrum
.
energy
)
if
HAS_REACH_END_VALUE
:
norm2
=
max_raw_energy
-
100
spline_range_end
=
max_raw_energy
-
50
else
:
norm2
=
max_raw_energy
spline_range_end
=
max_raw_energy
ft_k_range_end
=
etok
(
norm2
)
# here ft_k value seems really strange no ?
return
{
...
...
@@ -155,7 +153,7 @@ class AnalysisThread(threading.Thread):
with
HDF5File
(
filename
=
url
.
file_path
(),
mode
=
"r"
)
as
h5f
:
if
url
.
data_path
()
in
h5f
:
setattr
(
input_information
,
set_fct
,
url
)
except
:
except
Exception
:
_logger
.
warning
(
"{} not set because not found"
.
format
(
set_fct
))
self
.
mu_ref_url
=
DataUrl
(
...
...
@@ -173,19 +171,19 @@ class AnalysisThread(threading.Thread):
# TODO: add a process attact to attach informations from an url.
try
:
xas_obj
.
spectra
.
data
.
flat
[
0
].
I0
=
get_data
(
self
.
I0_url
)
except
:
except
Exception
:
pass
try
:
xas_obj
.
spectra
.
data
.
flat
[
0
].
I1
=
get_data
(
self
.
I1_url
)
except
:
except
Exception
:
pass
try
:
xas_obj
.
spectra
.
data
.
flat
[
0
].
I2
=
get_data
(
self
.
I2_url
)
except
:
except
Exception
:
pass
try
:
xas_obj
.
spectra
.
data
.
flat
[
0
].
mu_ref
=
get_data
(
self
.
mu_ref_url
)
except
:
except
Exception
:
pass
configuration
=
self
.
get_configuration
()
...
...
@@ -267,7 +265,7 @@ class AnalysisThread(threading.Thread):
):
try
:
I_data
=
silx_utils
.
get_data
(
IX_url
)
except
:
except
Exception
:
pass
else
:
concurrent
.
submitToQtMainThread
(
...
...
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