Commit 7b374731 authored by payno's avatar payno
Browse files

PEP8

parent 76aab690
Pipeline #51923 failed with stages
in 11 minutes and 46 seconds
......@@ -49,7 +49,7 @@ from .spectra import Spectra
from est.settings import DEFAULT_READ_TIMEOUT
try:
import larch
import larch # noqa
except ImportError:
_has_larch = False
else:
......@@ -343,7 +343,6 @@ class XASObject:
# default yay of storing data
from est.io import load_data # avoid cyclic import
contains_config_spectrum = "configuration" in ddict or "spectra" in ddict
"""The dict can be on the scheme of the to_dict function, containing
the spectra and the configuration. Otherwise we consider it is simply
the spectra"""
......
......@@ -139,7 +139,6 @@ class ROISelectorDialog(qt.QDialog):
if __name__ == "__main__":
from est.core.types import XASObject
import numpy
from est.core.utils import spectra as spectra_utils
from est.core.process.roi import ROIProcess, _ROI
from silx.gui.colors import Colormap
......
......@@ -67,7 +67,7 @@ class EnergyUnitSelector(qt.QComboBox):
elif unit == ur.kJ:
txt = "kJ"
else:
raise ValueError("Given unit is not managed: {}".format())
raise ValueError("Given unit is not managed: {}".format(unit))
index = self.findText(txt)
if index >= 0:
......
from .io import *
from .io import * # noqa
......@@ -726,15 +726,3 @@ if __name__ == "__main__":
results=process_data2,
processing_order=2,
)
def get_column_name(dat_file):
from silx.io.spech5 import SpecH5
from silx.io.spech5 import SpecFile
spec_h5 = SpecH5(dat_file)
spec_file = SpecFile(dat_file)
if __name__ == "__main__":
get_column_name("specfiledata_tests.dat")
......@@ -28,7 +28,5 @@ __date__ = "06/12/2019"
import logging
import unittest
_logger = logging.getLogger(__name__)
......@@ -35,7 +35,7 @@ import unittest
import os
try:
import PyMca5
import PyMca5 # noqa
except ImportError:
has_pymca = False
else:
......
from .read import get_data
from .read import get_data # noqa
......@@ -299,13 +299,6 @@ class InputInformation:
else:
return None
@property
def scan_title(self):
if self.is_spec_input():
return self.spec_info.scan_title
else:
return None
@property
def spec_file(self):
if self.is_spec_input():
......
......@@ -38,13 +38,13 @@ import os
import xml.etree.ElementTree as ET
try:
import PyMca5
import PyMca5 # noqa
except ImportError:
has_pymca = False
else:
has_pymca = True
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
from .converter import *
from .converter import * # noqa
......@@ -85,6 +85,6 @@ def _retrieve_energy(domain):
energy = numpy.arange(len(domain.attributes), dtype="f")
try:
energy = numpy.array([float(a.name) for a in domain.attributes])
except:
except Exception:
_logger.error("fail to retrieve energy from attributes")
return energy
......@@ -220,7 +220,6 @@ class NormalizationOW(
def __init__(self):
super().__init__()
# super().__init__()
self._latest_xas_obj = None
self._window = NormalizationWindow(parent=self)
layout = gui.vBox(self.mainArea, "normalization").layout()
......@@ -236,14 +235,12 @@ class NormalizationOW(
# connect signals / slots
pymcaWindowContainer = self._window._pymcaWindow
_sig = pymcaWindowContainer.sigChanged.connect(self._updateProcess)
pymcaWindowContainer.sigChanged.connect(self._updateProcess)
if hasattr(pymcaWindowContainer._mainwidget, "sigE0CalculationRequested"):
pymcaWindowContainer._mainwidget.sigE0CalculationRequested.connect(
self._getE0FrmDialog
)
# self.handleNewSignals()
def _updateProcess(self):
self._update_settings()
if self._latest_xas_obj:
......
......@@ -152,7 +152,7 @@ class EnergyRoiOW(
except Exception as e:
_logger.error(e)
else:
OWEwoksWidget.accept(self)
super().accept(self)
def updateProperties(self):
# as dim are named tuple we have to cast them to dict
......
......@@ -137,7 +137,7 @@ class RoiSelectionOW(
except Exception as e:
_logger.error(e)
else:
OWEwoksWidget.accept(self)
super().accept(self)
def updateProperties(self):
# as dim are named tuple we have to cast them to dict
......
......@@ -44,9 +44,6 @@ from est.core.types import XASObject
_logger = logging.getLogger(__file__)
_DEBUG = False
class XASInputOW(
OWWidget,
):
......@@ -106,7 +103,7 @@ class XASInputOW(
try:
self._loadSettings()
except:
except Exception:
pass
# expose api
......@@ -126,12 +123,6 @@ class XASInputOW(
except ValueError as e:
qt.QMessageBox.warning(self, "", str(e))
else:
if _DEBUG is True and xas_obj.n_spectrum > 100:
from est.core.process.roi import ROIProcess, _ROI
roiProcess = ROIProcess()
roiProcess.setRoi(origin=(0, 0), size=(10, 10))
xas_obj = roiProcess.process(xas_obj)
self.Outputs.xas_obj.send(xas_obj)
def _loadSettings(self):
......@@ -177,7 +168,7 @@ class XASInputOW(
try:
if url and url.is_valid():
setter(url.path())
except ... as e:
except Exception:
logging.info("fail to load ", url_path)
load_url(self._spectra_url_setting, self._inputDialog.setSpectraUrl)
......
from est.app.utils import get_xas_obj
from silx.io.url import DataUrl
import silx.io.utils
from est.units import ur
from larch.xafs import etok
from silx.gui import qt
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment