Commit 404c0547 authored by payno's avatar payno
Browse files

black format

parent 12c91b49
......@@ -105,12 +105,14 @@ def exec_(
signal.signal(signal.SIGINT, signal_handler)
xas_obj = get_xas_obj(input_energy_unit=input_energy_unit,
input_=input_,
input_spectra_url=input_spectra_url,
input_dims=input_dims,
input_channel_url=input_channel_url,
input_configuration_url=input_configuration_url)
xas_obj = get_xas_obj(
input_energy_unit=input_energy_unit,
input_=input_,
input_spectra_url=input_spectra_url,
input_dims=input_dims,
input_channel_url=input_channel_url,
input_configuration_url=input_configuration_url,
)
workflow._start_actor.trigger(("data", xas_obj.to_dict()))
workflow._end_actor.join(timeout)
......
......@@ -34,6 +34,7 @@ from est.core.types import Dim
from typing import Union
from est.core.types import Spectrum, XASObject
from est.core.io import read_xas
try:
from est.io.utils.pymca import read_spectrum
......@@ -107,11 +108,14 @@ def get_url(my_str):
raise ValueError("unrecognized url {}".format(my_str))
def get_xas_obj(input_energy_unit=ur.eV, input_: Union[str, None, dict] = None,
input_spectra_url: Union[None, DataUrl] = None,
input_dims: Union[None, tuple] = None,
input_channel_url: Union[None, DataUrl] = None,
input_configuration_url: Union[None, DataUrl] = None):
def get_xas_obj(
input_energy_unit=ur.eV,
input_: Union[str, None, dict] = None,
input_spectra_url: Union[None, DataUrl] = None,
input_dims: Union[None, tuple] = None,
input_channel_url: Union[None, DataUrl] = None,
input_configuration_url: Union[None, DataUrl] = None,
):
"""load xas object from command line input"""
if input_ is not None:
if input_dims is None:
......@@ -121,8 +125,7 @@ def get_xas_obj(input_energy_unit=ur.eV, input_: Union[str, None, dict] = None,
input_, energy_unit=input_energy_unit, dimensions=input_dims
)
spectrum = Spectrum(energy=energy, mu=mu)
return XASObject(energy=energy, spectra=(spectrum,), dim1=1,
dim2=1)
return XASObject(energy=energy, spectra=(spectrum,), dim1=1, dim2=1)
else:
raise ValueError("Unable to read spectrum")
else:
......
......@@ -38,15 +38,11 @@ import pkg_resources
class DumpXasObject(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -138,15 +138,11 @@ _USE_MULTIPROCESSING_POOL = False
class Larch_autobk(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -127,15 +127,11 @@ _USE_MULTIPROCESSING_POOL = False
class Larch_mback(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -136,15 +136,11 @@ _USE_MULTIPROCESSING_POOL = False
class Larch_mback_norm(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -125,15 +125,11 @@ _USE_MULTIPROCESSING_POOL = False
class Larch_pre_edge(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -128,15 +128,11 @@ _USE_MULTIPROCESSING_POOL = False
class Larch_xftf(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -43,7 +43,6 @@ _input_desc = namedtuple("_input_desc", ["name", "type", "handler", "doc"])
_output_desc = namedtuple("_output_desc", ["name", "type", "doc"])
class Process(object):
def __init__(self, name):
assert type(name) is str
......
......@@ -148,17 +148,12 @@ class PyMca_exafs(Process):
"""Process spectra for exafs and get information about the processing
advancement"""
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -152,15 +152,11 @@ _USE_MULTIPROCESSING_POOL = False
class PyMca_ft(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -142,15 +142,11 @@ _USE_MULTIPROCESSING_POOL = False
class PyMca_k_weight(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -126,15 +126,11 @@ _USE_MULTIPROCESSING_POOL = False
class PyMca_normalization(Process):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self):
......
......@@ -57,15 +57,11 @@ def xas_roi(xas_obj):
class _ROI(object):
inputs = [
_input_desc(
name="xas_obj", type=XASObject, handler="process", doc=""
),
_input_desc(name="xas_obj", type=XASObject, handler="process", doc=""),
]
outputs = [
_output_desc(
name="xas_obj", type=XASObject, doc=""
),
_output_desc(name="xas_obj", type=XASObject, doc=""),
]
def __init__(self, origin, size):
......
......@@ -60,7 +60,9 @@ class AutobkWindow(qt.QMainWindow):
# xas object viewer
mapKeys = ["mu", "bkg", "chie", "k", "chi", "e0"]
self.xasObjViewer = XasObjectViewer(mapKeys=mapKeys)
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel("Energy (eV)")
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel(
"Energy (eV)"
)
self.xasObjViewer._spectrumViews[0]._plotWidget.getYAxis().setLabel(
"Absorption (a.u.)"
)
......
......@@ -60,7 +60,9 @@ class MbackWindow(qt.QMainWindow):
# xas object viewer
mapKeys = ["mu", "fpp", "f2"]
self.xasObjViewer = XasObjectViewer(mapKeys=mapKeys)
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel("Energy (eV)")
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel(
"Energy (eV)"
)
self.setCentralWidget(self.xasObjViewer)
self._parametersWindow = _ParameterWindowContainer(
parent=self, parametersWindow=_MBackParameters
......
......@@ -60,7 +60,9 @@ class Mback_normWindow(qt.QMainWindow):
# xas object viewer
mapKeys = ["mu", "mback_mu", "norm"]
self.xasObjViewer = XasObjectViewer(mapKeys=mapKeys)
self.xasObjViewer._spectrumViews[0]._plotWidgetWidget.getXAxis().setLabel("Energy (eV)")
self.xasObjViewer._spectrumViews[0]._plotWidgetWidget.getXAxis().setLabel(
"Energy (eV)"
)
self.setCentralWidget(self.xasObjViewer)
self._parametersWindow = _ParameterWindowContainer(
parent=self, parametersWindow=_MBackParameters
......
......@@ -66,7 +66,9 @@ class _PreEdgeWindow(qt.QMainWindow):
# xas object viewer
mapKeys = ["mu", "norm", "norm_area"]
self.xasObjViewer = XasObjectViewer(mapKeys=mapKeys)
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel("Energy (eV)")
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel(
"Energy (eV)"
)
self.setCentralWidget(self.xasObjViewer)
self._parametersWindow = _ParameterWindowContainer(
parent=self, parametersWindow=_MPreEdgeParameters
......
......@@ -83,7 +83,9 @@ class XFTFWindow(qt.QMainWindow):
# xas object viewer
mapKeys = ["mu", "chir", "chir_mag", "chir_re", "chir_im", "chir_pha"]
self.xasObjViewer = XasObjectViewer(mapKeys=mapKeys)
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel("Energy (eV)")
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel(
"Energy (eV)"
)
self.setCentralWidget(self.xasObjViewer)
self._parametersWindow = _ParameterWindowContainer(
parent=self, parametersWindow=_MXFTFParameters
......
......@@ -66,8 +66,12 @@ class FTWindow(qt.QMainWindow):
)
self.xasObjViewer._spectrumViews[0]._plotWidget.getXAxis().setLabel("K")
self.xasObjViewer._spectrumViews[1]._plotWidget.getXAxis().setLabel("R (Angstrom)")
self.xasObjViewer._spectrumViews[1]._plotWidget.getYAxis().setLabel("Arbitrary Units")
self.xasObjViewer._spectrumViews[1]._plotWidget.getXAxis().setLabel(
"R (Angstrom)"
)
self.xasObjViewer._spectrumViews[1]._plotWidget.getYAxis().setLabel(
"Arbitrary Units"
)
self.setCentralWidget(self.xasObjViewer)
self._pymcaWindow = _ParameterWindowContainer(
parent=self, parametersWindow=XASFourierTransformParameters
......
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