Skip to content
Snippets Groups Projects
Commit f849a471 authored by Henri Payno's avatar Henri Payno
Browse files

move dependency to ewoks 0.1.0rc

parent 9407dc5e
No related branches found
No related tags found
1 merge request!49Move to ewwoks 0 1 0rc0
......@@ -30,6 +30,7 @@ __date__ = "20/07/2021"
from ewoksorange.bindings import ows_to_ewoks, ewoks_to_ows
from ewokscore.graph import TaskGraph
from ewokscore.graph.analysis import start_nodes
from est.core.utils import DownloadDataset
import unittest
import tempfile
......@@ -81,22 +82,12 @@ class TestOrangeGraph(unittest.TestCase):
# step 1: from ows to ewoks graph
graph = ows_to_ewoks(self._example_pymca_ows)
self.assertTrue(isinstance(graph, TaskGraph))
self.assertEqual(len(graph.start_nodes()), 1)
self.assertTrue("input" in graph.start_nodes())
for node in (
"input",
"output",
"normalization",
"exafs",
"k weight",
"fourier transform",
):
self.assertTrue(node in graph.graph.nodes())
self.assertEqual(len(start_nodes(graph.graph)), 1)
self.assertEqual(len(graph.graph.edges), 5)
# step 2: from generated ewoks graph to orange
destination = os.path.join(self.folder, "output_pymca_examples.ows")
ewoks_to_ows(ewoksgraph=graph, destination=destination)
ewoks_to_ows(graph=graph, destination=destination)
self.assertTrue(os.path.exists(destination))
# insure links and nodes are defined
tree = ET.parse(destination)
......@@ -106,29 +97,6 @@ class TestOrangeGraph(unittest.TestCase):
self.assertTrue("nodes" in children_tags)
self.assertTrue("links" in children_tags)
self.assertTrue("node_properties" in children_tags)
# check nodes
nodes = [elmt for elmt in children_tags["nodes"]]
nodes_by_name = {node.get("name"): node.get("qualified_name") for node in nodes}
qualified_names = (
"orangecontrib.est.widgets.utils.xas_input.XASInputOW",
"orangecontrib.est.widgets.utils.xas_output.XASOutputOW",
"orangecontrib.est.widgets.pymca.normalization.NormalizationOW",
"orangecontrib.est.widgets.pymca.exafs.ExafsOW",
"orangecontrib.est.widgets.pymca.k_weight.KWeightOW",
"orangecontrib.est.widgets.pymca.ft.FTOW",
)
names = (
"input",
"output",
"normalization",
"exafs",
"k weight",
"fourier transform",
)
for q_name, name in zip(qualified_names, names):
self.assertEqual(nodes_by_name[name], q_name)
# check links
links = [elmt for elmt in children_tags["links"]]
......@@ -142,15 +110,12 @@ class TestOrangeGraph(unittest.TestCase):
# step 1: from ows to ewoks graph
graph = ows_to_ewoks(self._example_larch_ows)
self.assertTrue(isinstance(graph, TaskGraph))
self.assertEqual(len(graph.start_nodes()), 1)
self.assertTrue("input" in graph.start_nodes())
for node in ("input", "output", "pre edge", "autobk", "xftf"):
self.assertTrue(node in graph.graph.nodes())
self.assertEqual(len(start_nodes(graph.graph)), 1)
self.assertEqual(len(graph.graph.edges), 4)
# step 2: from generated ewoks graph to orange
destination = os.path.join(self.folder, "output_larch_examples.ows")
ewoks_to_ows(ewoksgraph=graph, destination=destination)
ewoks_to_ows(graph=graph, destination=destination)
self.assertTrue(os.path.exists(destination))
# insure links and nodes are defined
tree = ET.parse(destination)
......@@ -160,27 +125,6 @@ class TestOrangeGraph(unittest.TestCase):
self.assertTrue("nodes" in children_tags)
self.assertTrue("links" in children_tags)
self.assertTrue("node_properties" in children_tags)
# check nodes
nodes = [elmt for elmt in children_tags["nodes"]]
nodes_by_name = {node.get("name"): node.get("qualified_name") for node in nodes}
qualified_names = (
"orangecontrib.est.widgets.utils.xas_input.XASInputOW",
"orangecontrib.est.widgets.utils.xas_output.XASOutputOW",
"orangecontrib.est.widgets.larch.pre_edge.PreEdgeOW",
"orangecontrib.est.widgets.larch.autobk.AutobkOW",
"orangecontrib.est.widgets.larch.xftf.XFTFOW",
)
names = (
"input",
"output",
"pre edge",
"autobk",
"xftf",
)
for q_name, name in zip(qualified_names, names):
self.assertEqual(nodes_by_name[name], q_name)
# check links
links = [elmt for elmt in children_tags["links"]]
......
......@@ -33,7 +33,7 @@ install_requires =
numpy
h5py>=3.1
Pint
ewoksorange @ git+https://gitlab.esrf.fr/workflow/ewoks/ewoksorange
ewoks>=0.1.0rc
silx>=0.15
[options.entry_points]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment