Commit c9dc4655 authored by payno's avatar payno
Browse files

[esrftaskgraph] insure example_larch.ows and example_pymca.ows can be converted to graph

processing source code used:

input_ows_file = "..."
from esrf2orange3.owsconvert import ows_to_esrf, esrf_to_ows
from esrftaskgraph.graph import TaskGraph
graph = ows_to_esrf(input_ows_file)
parent 7dc04564
......@@ -131,7 +131,8 @@ class EnergyROIProcess(Process):
return est.version.version
def program_name(self):
@staticmethod
def registry_name():
return "energy-roi"
__call__ = process
......@@ -57,7 +57,8 @@ class DumpXasObject(Process):
def output_file(self, output_file):
self._output_file = output_file
def program_name(self):
@staticmethod
def registry_name():
"""Name of the program used for this processing"""
return "xas writer"
......
......@@ -206,7 +206,8 @@ class Larch_autobk(Process):
return larch.version.version_data()["larch"]
def program_name(self):
@staticmethod
def registry_name():
return "larch_autobk"
__call__ = process
......@@ -205,7 +205,8 @@ class Larch_mback(Process):
return larch.version.version_data()["larch"]
def program_name(self):
@staticmethod
def registry_name():
return "larch_mback"
__call__ = process
......@@ -212,7 +212,8 @@ class Larch_mback_norm(Process):
return larch.version.version_data()["larch"]
def program_name(self):
@staticmethod
def program_name():
return "larch_mback_norm"
__call__ = process
......@@ -261,7 +261,8 @@ class Larch_pre_edge(Process):
return larch.version.version_data()["larch"]
def program_name(self):
@staticmethod
def program_name():
return "larch_pre_edge"
__call__ = process
......@@ -294,7 +294,8 @@ class Larch_xftf(Process):
return larch.version.version_data()["larch"]
def program_name(self):
@staticmethod
def program_name():
return "larch_xftf"
__call__ = process
......@@ -252,7 +252,8 @@ class NoiseProcess(Process):
def program_version(self):
return pkg_resources.get_distribution("est").version
def program_name(self):
@staticmethod
def registry_name(self):
return "noise_savgol"
__call__ = process
......@@ -34,6 +34,7 @@ from est.core.types import XASObject
from ..utils import extract_properties_from_dict
import logging
from collections import namedtuple
from esrftaskgraph.task import Task
from typing import Iterable
_logger = logging.getLogger(__name__)
......@@ -191,7 +192,7 @@ class _NexusDatasetDef:
return self.name
class Process(object):
class Process(Task):
def __init__(self, name):
assert type(name) is str
self._name = name
......@@ -234,10 +235,6 @@ class Process(object):
assert isinstance(_xas_obj, XASObject)
return _xas_obj
def program_name(self) -> str:
"""Name of the program used for this processing"""
raise NotImplementedError("Base class")
def program_version(self) -> str:
"""version of the program used for this processing"""
raise NotImplementedError("Base class")
......
......@@ -227,7 +227,8 @@ class PyMca_exafs(Process):
return PyMca5.version()
def program_name(self):
@staticmethod
def program_name():
return "pymca_exafs"
__call__ = process
......
......@@ -239,7 +239,8 @@ class PyMca_ft(Process):
return PyMca5.version()
def program_name(self):
@staticmethod
def program_name():
return "pymca_ft"
__call__ = process
......
......@@ -235,7 +235,8 @@ class PyMca_k_weight(Process):
return PyMca5.version()
def program_name(self):
@staticmethod
def program_name():
return "pymca_k_weight"
__call__ = process
......
......@@ -218,7 +218,8 @@ class PyMca_normalization(Process):
return PyMca5.version()
def program_name(self):
@staticmethod
def program_name():
return "pymca_normalization"
__call__ = process
......
......@@ -200,4 +200,8 @@ class ROIProcess(Process):
else:
return _xas_obj
@staticmethod
def registry_name():
return "roi"
__call__ = process
......@@ -157,7 +157,7 @@ class AutobkOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.larch.autobk.Larch_autobk
esrftaskclass = est.core.process.larch.autobk.Larch_autobk
_larchSettings = Setting(dict())
"""Store the configuration of the PyMca XASClass"""
......
......@@ -133,7 +133,7 @@ class MbackOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.larch.mback.Larch_mback
esrftaskclass = est.core.process.larch.mback.Larch_mback
_larchSettings = Setting(dict())
"""Store the configuration of the larch configuration"""
......
......@@ -133,7 +133,7 @@ class Mback_normOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.larch.mback_norm.Larch_mback_norm
esrftaskclass = est.core.process.larch.mback_norm.Larch_mback_norm
_larchSettings = Setting(dict())
"""Store the configuration of the larch configuration"""
......
......@@ -152,7 +152,7 @@ class PreEdgeOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.larch.pre_edge.Larch_pre_edge
esrftaskclass = est.core.process.larch.pre_edge.Larch_pre_edge
_larchSettings = Setting(dict())
"""Store the configuration of the larch configuration"""
......
......@@ -169,7 +169,7 @@ class XFTFOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.larch.xftf.Larch_xftf
esrftaskclass = est.core.process.larch.xftf.Larch_xftf
_larchSettings = Setting(dict())
"""Store the configuration of the larch configuration"""
......
......@@ -134,7 +134,7 @@ class ExafsOW(_ProcessForOrangeMixIn, OWWidget):
resizing_enabled = True
allows_cycle = False
process_function = est.core.process.pymca.exafs.PyMca_exafs
esrftaskclass = est.core.process.pymca.exafs.PyMca_exafs
_larchSettings = Setting(dict())
"""Store the configuration of the PyMca XASClass"""
......
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