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

PEP8

parent 76aab690
Pipeline #51923 failed with stages
in 11 minutes and 46 seconds
from .launcher import Launcher
from .launcher import Launcher # noqa
......@@ -7,14 +7,13 @@ from ewoksorange.owsconvert import ows_to_ewoks
from .utils import get_unit
from .utils import get_url
from .utils import convert_spectra_dims
from .utils import get_xas_obj
try:
import h5py
has_h5py = True
except:
import h5py # noqa
except ImportError:
has_h5py = False
else:
has_h5py = True
logging.basicConfig(level=logging.DEBUG)
_logger = logging.getLogger(__name__)
......
......@@ -37,7 +37,7 @@ from est.io.utils.information import InputInformation
from silx.io.url import DataUrl
try:
import PyMca5
import PyMca5 # noqa
except ImportError:
has_pymca = False
else:
......
......@@ -32,18 +32,19 @@ from silx.io.url import DataUrl
from est.units import ur
from est.core.types import Dim
from est.io.utils import get_data
from est.core.types import Spectrum, XASObject
from est.core.types import XASObject
from est.core.io import read_xas
from est.io.utils.information import InputInformation
import logging
from est import settings
try:
from est.io.utils.spec import read_spectrum
has_read_spectrum = True
from est.io.utils.spec import read_spectrum # noqa
except ImportError:
has_read_spectrum = False
else:
has_read_spectrum = True
_logger = logging.getLogger(__name__)
......
......@@ -33,7 +33,7 @@ from est.io import read_xas, write_xas, get_xasproc
from est.core.types import XASObject
from silx.io.url import DataUrl
from est.core.types import Dim
from est.units import ur, convert_to
from est.units import ur
from typing import Union
from est.io.utils.information import InputInformation
import h5py
......
......@@ -27,12 +27,8 @@ __authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "27/01/2021"
from est.core.types import XASObject
from .process import Process
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
import logging
from typing import Union
_logger = logging.getLogger(__name__)
......
......@@ -30,8 +30,6 @@ __date__ = "06/11/2019"
from .process import Process
from est.core.types import XASObject
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from est.io.utils.information import InputInformation
import pkg_resources
......
......@@ -27,8 +27,6 @@
from est.core.types import Spectrum, XASObject
from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from larch.xafs.autobk import autobk
import multiprocessing
import functools
......
......@@ -27,8 +27,6 @@
from est.core.types import Spectrum, XASObject
from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from larch.xafs.mback import mback
import multiprocessing
import functools
......@@ -93,7 +91,7 @@ def process_spectr_mback(
):
if opt_name in _conf:
opts[opt_name] = _conf[opt_name]
if not "z" in opts:
if "z" not in opts:
raise ValueError("atomic number of the absorber is not specify")
if _DEBUG is True:
......
......@@ -27,8 +27,6 @@
from est.core.types import Spectrum, XASObject
from est.core.process.process import Process
from est.core.process.process import _NexusDatasetDef
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from larch.xafs.mback import mback_norm
from larch.xafs.pre_edge import preedge
import multiprocessing
......
......@@ -27,8 +27,6 @@
from est.core.types import Spectrum, XASObject
from est.core.process.process import Process
from est.core.process.process import _NexusSpectrumDef, _NexusDatasetDef
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from est.core.utils.symbol import MU_CHAR
from larch.xafs.pre_edge import pre_edge
import multiprocessing
......
......@@ -34,7 +34,7 @@ import urllib.request
from est.core.types import Spectrum, XASObject
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
......@@ -34,7 +34,7 @@ import urllib.request
from est.core.types import Spectrum, XASObject
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
......@@ -34,7 +34,7 @@ import urllib.request
from est.core.types import Spectrum, XASObject
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
......@@ -34,7 +34,7 @@ import urllib.request
from est.core.types import Spectrum, XASObject
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
......@@ -35,12 +35,12 @@ import numpy
from est.core.types import Spectrum
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
has_larch = True
from est.core.process.larch.xftf import larch_xftf, process_spectr_xftf as xftf
from est.core.process.larch.xftf import process_spectr_xftf as xftf
from est.core.process.larch.autobk import process_spectr_autobk as autobk
from est.core.process.larch.pre_edge import process_spectr_pre_edge as pre_edge
from est.io.utils.larch import read_ascii
......
......@@ -34,7 +34,7 @@ import urllib.request
from est.core.types import Spectrum, XASObject
try:
import larch
import larch # noqa
except ImportError:
has_larch = False
else:
......
......@@ -28,8 +28,6 @@ from est.core.types import Spectrum, XASObject
from est.core.process.process import Process
from est.core.process.process import _NexusSpectrumDef
from est.core.process.process import _NexusDatasetDef
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from larch.xafs.xafsft import xftf
from est.core.utils.symbol import ANGSTROM_CHAR
import multiprocessing
......
......@@ -29,8 +29,6 @@ __date__ = "18/01/2021"
from est.core.types import XASObject
from est.core.types import Spectrum
from est.core.process.process import _input_desc
from est.core.process.process import _output_desc
from .process import Process
from .process import _NexusSpectrumDef
from .process import _NexusDatasetDef
......@@ -40,7 +38,6 @@ import numpy
import pkg_resources
import multiprocessing
import functools
from typing import Union
_logger = logging.getLogger(__name__)
......@@ -80,21 +77,21 @@ def process_noise_savgol(
)
if "noise" in configuration:
configuration = configuration["noise"]
if not "window_size" in configuration:
if "window_size" not in configuration:
raise ValueError("`window_size` should be specify. Missing in configuration")
else:
window_size = configuration["window_size"]
if not "polynomial_order" in configuration:
if "polynomial_order" not in configuration:
raise ValueError(
"`polynomial_order` should be specify. Missing in configuration"
)
else:
polynomial_order = configuration["polynomial_order"]
if not "e_min" in configuration:
if "e_min" not in configuration:
e_min = None
else:
e_min = configuration["e_min"]
if not "e_max" in configuration:
if "e_max" not in configuration:
e_max = None
else:
e_max = configuration["e_max"]
......
......@@ -124,13 +124,6 @@ class _NexusSpectrumDef:
def title_latex(self):
return self.__title_latex
@title.setter
def title_latex(self, title):
if not isinstance(title, (str, type(None))):
raise TypeError("`title` should be an instance of str or None")
else:
self.__title_latex = title
class _NexusDatasetDef:
"""Util function to define a Nexus plot"""
......
Markdown is supported
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