Permalink
Browse files

oops, don't automatically mixin path analysis

  • Loading branch information...
1 parent 844302e commit 19badd97e400a5fa5e282a917f8ac437e5cc5b96 @palvaro palvaro committed Dec 4, 2011
Showing with 9 additions and 15 deletions.
  1. +0 −3 lib/bud.rb
  2. +5 −11 lib/bud/viz_util.rb
  3. +4 −1 test/tc_meta.rb
View
@@ -74,9 +74,6 @@ module Bud
attr_accessor :stratum_collection_map, :rewritten_strata, :no_attr_rewrite_strata
attr_accessor :metrics
- include MetaAlgebra
- include MetaReports
-
# options to the Bud runtime are passed in a hash, with the following keys
# * network configuration
# * <tt>:ip</tt> IP address string for this instance
View
@@ -76,26 +76,19 @@ def graph_from_instance(bud_instance, viz_name, output_base, collapse=true, fmt=
tabinf[tab] = t[1].class.to_s
end
- begins = {}
- bud_instance.a_preds.each do |b|
- begins[:start] ||= {}
- begins[:start][b.path.split("|").last] = b.fullpath.split("|").last
- begins[:finish] = {}
- begins[:finish][b.fullpath.split("|").last] = true
- end
-
+ begins = get_paths(bud_instance)
bit = bud_instance.builtin_tables
VizUtil.ma_tables.each_pair{|k, v| bit[k] = v}
write_graphs(tabinf, bit, bud_instance.t_cycle,
bud_instance.t_depends, bud_instance.t_rules, viz_name,
output_base, fmt, collapse, bud_instance.meta_parser.depanalysis, -1, nil,
- get_labels(bud_instance), get_paths(bud_instance))
-
- return begins
+ get_labels(bud_instance), begins)
+ begins
end
def get_paths(bud_instance)
+ return {} unless bud_instance.respond_to? :a_preds
begins = {}
bud_instance.a_preds.each do |b|
begins[:start] ||= {}
@@ -107,6 +100,7 @@ def get_paths(bud_instance)
end
def get_labels(bud_instance)
+ return {} unless bud_instance.respond_to? :lps
# sort the paths. sort the paths to the same destination by length.
aps = {}
ap_interm = bud_instance.lps.sort do |a, b|
View
@@ -113,6 +113,9 @@ class TestStratTemporal
class Divergence
include Bud
+
+ include MetaAlgebra
+ include MetaReports
state do
interface input, :cli1, [:data]
@@ -281,7 +284,7 @@ def test_underspecified
def test_temporal_strat
t = TestStratTemporal.new
- assert_equal(4, t.strata.length)
+ assert_equal(3, t.strata.length)
t.tick
assert_equal([["xyz", 1], ["xyz", 2], ["xyz", 3]], t.foo_persist.to_a.sort)
t.tick

0 comments on commit 19badd9

Please sign in to comment.