Commit 551164e9 authored by Eduardo Rodrigues's avatar Eduardo Rodrigues
Browse files

Remove unnecessary code while at it

parent 1cb14108
Pipeline #3584044 failed with stages
in 41 seconds
......@@ -57,31 +57,9 @@ class DVNode(namedtuple('DVNode', ['node', 'extra_outputs'])): # noqa
@property
def name(self):
"""Selection name"""
"""DVNode (CompositeNode instance) name."""
return self.node.name
@property
def output_producer(self):
"""Return the producer that defines the output of this line.
The producer is defined as the last child in the control flow node,
i.e. the last item passed as the `algs` argument to the `HltLine`
constructor.
If the producer creates no output, None is returned.
"""
children = self.node.children
last = children[-1]
# Could in principle have control node here; will deal with this use
# case if it arises
assert isinstance(last, Algorithm)
# If the last algorithm produces nothing, there is no 'producer'
return last if last.outputs else None
def produces_output(self):
"""Return True if this line produces output."""
return self.output_producer is not None
def davinci_control_flow(options, user_analysis_nodes=[], fsr_nodes=[]):
"""
......
......@@ -12,7 +12,6 @@
import pytest
from PyConf.Algorithms import Gaudi__Examples__VoidConsumer as VoidConsumer
from PyConf.Algorithms import Gaudi__Examples__IntDataProducer as IntDataProducer
from PyConf.Algorithms import GaudiHistoAlgorithm
from DaVinci.Configuration import run_davinci_app
......@@ -76,24 +75,13 @@ def test_lumi_counters_in_data():
assert any("EventAccounting/EventAccount" in algs for algs in nodes[2])
def test_DVNode_simplest():
def test_DVNode():
"""
Basic test of the DVNode class.
"""
node = DVNode("MyAlgs", [VoidConsumer()])
assert node.name == "MyAlgs"
assert not node.produces_output()
def test_DVNode_with_producer():
"""
Basic test of the DVNode class.
"""
node = DVNode("MyAlgs", [IntDataProducer()])
assert node.produces_output()
assert node.output_producer.type == IntDataProducer().type
def test_prepare_davinci_nodes():
......
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