Commit 273525d2 authored by Henri Payno's avatar Henri Payno
Browse files

[CI] add flake8 test

parent 531a5aec
Pipeline #55966 failed with stages
in 8 seconds
...@@ -16,10 +16,10 @@ check_style: ...@@ -16,10 +16,10 @@ check_style:
stage: style stage: style
image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
before_script: before_script:
- pip install black flake8 - pip install flake8
script: script:
- LC_ALL=C.UTF-8 black --check --safe . - flake8 est
- flake8 - flake8 orangecontrib
# build # build
...@@ -52,7 +52,6 @@ doc: ...@@ -52,7 +52,6 @@ doc:
only: only:
- master - master
# test # test
.build_template: &test_linux_template_pymca .build_template: &test_linux_template_pymca
stage: test stage: test
...@@ -145,6 +144,30 @@ test:python3.7-stretch-pyqt5_pymca_larch: ...@@ -145,6 +144,30 @@ test:python3.7-stretch-pyqt5_pymca_larch:
image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
<<: *test_linux_template_pymca_larch <<: *test_linux_template_pymca_larch
check_lint:
stage: test
image: docker-registry.esrf.fr/dau/ewoks:python_3.8
tags:
- linux
before_script:
- arch
- which python
- python --version
- python -m pip install pip --upgrade
- python -m pip install setuptools --upgrade
- python -m pip install flake8
script:
- python setup.py build
- python -m pip install .[doc]
- python setup.py build_sphinx
- mv build/sphinx/html artifacts/doc
artifacts:
paths:
- artifacts/doc/
when: on_success
expire_in: 2h
only:
- master
test:test-est-tutorials_pymca: test:test-est-tutorials_pymca:
image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython image: docker-registry.esrf.fr/dau/est:python3.7_stretch_pyqt5_gtk3_wxpython
......
...@@ -28,8 +28,6 @@ from est.core.types import Spectrum, XASObject ...@@ -28,8 +28,6 @@ from est.core.types import Spectrum, XASObject
from est.core.process.process import Process from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef from est.core.process.process import _NexusDatasetDef
from larch.xafs.autobk import autobk from larch.xafs.autobk import autobk
import multiprocessing
import functools
import logging import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
......
...@@ -28,8 +28,6 @@ from est.core.types import Spectrum, XASObject ...@@ -28,8 +28,6 @@ from est.core.types import Spectrum, XASObject
from est.core.process.process import Process from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef from est.core.process.process import _NexusDatasetDef
from larch.xafs.mback import mback from larch.xafs.mback import mback
import multiprocessing
import functools
import logging import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
......
...@@ -29,8 +29,6 @@ from est.core.process.process import Process ...@@ -29,8 +29,6 @@ from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef from est.core.process.process import _NexusDatasetDef
from larch.xafs.mback import mback_norm from larch.xafs.mback import mback_norm
from larch.xafs.pre_edge import preedge from larch.xafs.pre_edge import preedge
import multiprocessing
import functools
import logging import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
......
...@@ -29,8 +29,6 @@ from est.core.process.process import Process ...@@ -29,8 +29,6 @@ from est.core.process.process import Process
from est.core.process.process import _NexusSpectrumDef, _NexusDatasetDef from est.core.process.process import _NexusSpectrumDef, _NexusDatasetDef
from est.core.utils.symbol import MU_CHAR from est.core.utils.symbol import MU_CHAR
from larch.xafs.pre_edge import pre_edge from larch.xafs.pre_edge import pre_edge
import multiprocessing
import functools
import logging import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
......
...@@ -30,8 +30,6 @@ from est.core.process.process import _NexusSpectrumDef ...@@ -30,8 +30,6 @@ from est.core.process.process import _NexusSpectrumDef
from est.core.process.process import _NexusDatasetDef from est.core.process.process import _NexusDatasetDef
from larch.xafs.xafsft import xftf from larch.xafs.xafsft import xftf
from est.core.utils.symbol import ANGSTROM_CHAR from est.core.utils.symbol import ANGSTROM_CHAR
import multiprocessing
import functools
import logging import logging
import numpy import numpy
......
...@@ -28,10 +28,7 @@ __authors__ = ["H. Payno"] ...@@ -28,10 +28,7 @@ __authors__ = ["H. Payno"]
__license__ = "MIT" __license__ = "MIT"
__date__ = "04/10/2021" __date__ = "04/10/2021"
import functools
import logging import logging
import multiprocessing
import numpy import numpy
from PyMca5.PyMcaPhysics.xas.XASClass import XASClass from PyMca5.PyMcaPhysics.xas.XASClass import XASClass
from PyMca5.PyMcaPhysics.xas.XASClass import e2k, k2e from PyMca5.PyMcaPhysics.xas.XASClass import e2k, k2e
......
...@@ -28,10 +28,7 @@ __authors__ = ["H. Payno"] ...@@ -28,10 +28,7 @@ __authors__ = ["H. Payno"]
__license__ = "MIT" __license__ = "MIT"
__date__ = "05/10/2021" __date__ = "05/10/2021"
import functools
import logging import logging
import multiprocessing
import numpy import numpy
from PyMca5.PyMcaPhysics.xas.XASClass import XASClass from PyMca5.PyMcaPhysics.xas.XASClass import XASClass
from est.core.process.process import Process from est.core.process.process import Process
......
...@@ -28,9 +28,7 @@ __authors__ = ["H. Payno"] ...@@ -28,9 +28,7 @@ __authors__ = ["H. Payno"]
__license__ = "MIT" __license__ = "MIT"
__date__ = "05/10/2021" __date__ = "05/10/2021"
import functools
import logging import logging
import multiprocessing
from PyMca5.PyMcaPhysics.xas.XASClass import XASClass, e2k from PyMca5.PyMcaPhysics.xas.XASClass import XASClass, e2k
from est.core.process.process import Process from est.core.process.process import Process
from est.core.process.pymca.exafs import process_spectr_exafs from est.core.process.pymca.exafs import process_spectr_exafs
......
...@@ -29,9 +29,7 @@ __license__ = "MIT" ...@@ -29,9 +29,7 @@ __license__ = "MIT"
__date__ = "05/10/2021" __date__ = "05/10/2021"
import functools
import logging import logging
import multiprocessing
from PyMca5.PyMcaPhysics.xas.XASClass import XASClass from PyMca5.PyMcaPhysics.xas.XASClass import XASClass
from est.core.process.process import Process from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef from est.core.process.process import _NexusDatasetDef
......
...@@ -28,8 +28,6 @@ __license__ = "MIT" ...@@ -28,8 +28,6 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
from silx.gui import qt
from Orange.widgets import gui
import logging import logging
from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThread from ewoksorange.bindings.owwidgets import OWEwoksWidgetOneThread
from ewokscore.hashing import MissingData from ewokscore.hashing import MissingData
......
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "07/08/2019"
from silx.gui import qt
from est.core.process.progress import Progress
class QProgress(Progress, qt.QObject):
sigProgress = qt.Signal(int)
def __init__(self, name):
assert name is not None
qt.QObject.__init__(self)
Progress.__init__(self, name)
def startProcess(self):
self.sigProgress.emit(0)
def setAdvancement(self, value):
self.sigProgress.emit(value)
def endProcess(self):
self.sigProgress.emit(100)
...@@ -28,18 +28,13 @@ __license__ = "MIT" ...@@ -28,18 +28,13 @@ __license__ = "MIT"
__date__ = "04/10/2021" __date__ = "04/10/2021"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
import est.core.process.larch.autobk import est.core.process.larch.autobk
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import XasObjectViewer, ViewType from est.gui.XasObjectViewer import XasObjectViewer, ViewType
from est.gui.XasObjectViewer import ( from est.gui.XasObjectViewer import (
_plot_bkg, _plot_bkg,
...@@ -48,8 +43,6 @@ from est.gui.XasObjectViewer import ( ...@@ -48,8 +43,6 @@ from est.gui.XasObjectViewer import (
_plot_chi, _plot_chi,
) )
from est.gui.larch.autobk import _AutobkParameters from est.gui.larch.autobk import _AutobkParameters
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -28,23 +28,17 @@ __license__ = "MIT" ...@@ -28,23 +28,17 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
import est.core.process.larch.mback import est.core.process.larch.mback
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import XasObjectViewer, ViewType from est.gui.XasObjectViewer import XasObjectViewer, ViewType
from est.gui.larch.mback import _MBackParameters from est.gui.larch.mback import _MBackParameters
from orangecontrib.est.progress import QProgress
from est.gui.XasObjectViewer import _plot_norm, _plot_raw, _plot_fpp, _plot_f2 from est.gui.XasObjectViewer import _plot_norm, _plot_raw, _plot_fpp, _plot_f2
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -28,23 +28,18 @@ __license__ = "MIT" ...@@ -28,23 +28,18 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
import est.core.process.larch.mback_norm import est.core.process.larch.mback_norm
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import XasObjectViewer, ViewType from est.gui.XasObjectViewer import XasObjectViewer, ViewType
from est.gui.XasObjectViewer import _plot_norm, _plot_mback_mu from est.gui.XasObjectViewer import _plot_norm, _plot_mback_mu
from est.gui.larch.mback import _MBackParameters from est.gui.larch.mback import _MBackParameters
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -28,18 +28,13 @@ __license__ = "MIT" ...@@ -28,18 +28,13 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
import est.core.process.larch.pre_edge import est.core.process.larch.pre_edge
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import XasObjectViewer, ViewType from est.gui.XasObjectViewer import XasObjectViewer, ViewType
from est.gui.XasObjectViewer import ( from est.gui.XasObjectViewer import (
_plot_raw, _plot_raw,
...@@ -50,8 +45,7 @@ from est.gui.XasObjectViewer import ( ...@@ -50,8 +45,7 @@ from est.gui.XasObjectViewer import (
_plot_pre_edge, _plot_pre_edge,
) )
from est.gui.larch.pre_edge import _MPreEdgeParameters from est.gui.larch.pre_edge import _MPreEdgeParameters
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -28,18 +28,13 @@ __license__ = "MIT" ...@@ -28,18 +28,13 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
import est.core.process.larch.xftf import est.core.process.larch.xftf
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import ( from est.gui.XasObjectViewer import (
XasObjectViewer, XasObjectViewer,
ViewType, ViewType,
...@@ -49,8 +44,7 @@ from est.gui.XasObjectViewer import ( ...@@ -49,8 +44,7 @@ from est.gui.XasObjectViewer import (
_plot_masked_chi_weighted_k, _plot_masked_chi_weighted_k,
) )
from est.gui.larch.xftf import _MXFTFParameters from est.gui.larch.xftf import _MXFTFParameters
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -28,15 +28,10 @@ __license__ = "MIT" ...@@ -28,15 +28,10 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from est.core.types import XASObject
from PyMca5.PyMcaGui.physics.xas.XASPostEdgeParameters import XASPostEdgeParameters from PyMca5.PyMcaGui.physics.xas.XASPostEdgeParameters import XASPostEdgeParameters
from silx.gui import qt from silx.gui import qt
from silx.gui.plot import LegendSelector from silx.gui.plot import LegendSelector
...@@ -48,8 +43,7 @@ from est.gui.XasObjectViewer import ( ...@@ -48,8 +43,7 @@ from est.gui.XasObjectViewer import (
_exafs_postedge_plot, _exafs_postedge_plot,
_exafs_knots_plot, _exafs_knots_plot,
) )
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
......
...@@ -28,14 +28,10 @@ __license__ = "MIT" ...@@ -28,14 +28,10 @@ __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from PyMca5.PyMcaGui.physics.xas.XASFourierTransformParameters import ( from PyMca5.PyMcaGui.physics.xas.XASFourierTransformParameters import (
XASFourierTransformParameters, XASFourierTransformParameters,
) )
...@@ -44,13 +40,11 @@ from silx.gui.plot import LegendSelector ...@@ -44,13 +40,11 @@ from silx.gui.plot import LegendSelector
import est.core.process.pymca.ft import est.core.process.pymca.ft
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from est.gui.XasObjectViewer import XasObjectViewer, ViewType from est.gui.XasObjectViewer import XasObjectViewer, ViewType
from est.gui.XasObjectViewer import _normalized_exafs, _ft_window_plot from est.gui.XasObjectViewer import _normalized_exafs, _ft_window_plot
from est.gui.XasObjectViewer import _ft_intensity_plot, _ft_imaginary_plot from est.gui.XasObjectViewer import _ft_intensity_plot, _ft_imaginary_plot
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
from orangecontrib.est.widgets.container import _ParameterWindowContainer from orangecontrib.est.widgets.container import _ParameterWindowContainer
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......
...@@ -27,20 +27,14 @@ __authors__ = ["H. Payno"] ...@@ -27,20 +27,14 @@ __authors__ = ["H. Payno"]
__license__ = "MIT" __license__ = "MIT"
__date__ = "06/07/2019" __date__ = "06/07/2019"
import functools
import logging import logging
from Orange.widgets import gui from Orange.widgets import gui
from Orange.widgets.settings import Setting from Orange.widgets.settings import Setting
from Orange.widgets.widget import OWWidget
from Orange.widgets.widget import Input, Output
import Orange.data
from silx.gui import qt from silx.gui import qt
import est.core.process.pymca.k_weight import est.core.process.pymca.k_weight
from orangecontrib.est.process import _ProcessForOrangeMixIn from orangecontrib.est.process import _ProcessForOrangeMixIn
from est.core.types import XASObject
from orangecontrib.est.progress import QProgress
from orangecontrib.est.utils import Converter
_logger = logging.getLogger(__file__) _logger = logging.getLogger(__file__)
......