lib/experiment.rb in expetable-0.2.1 vs lib/experiment.rb in expetable-0.2.2
- old
+ new
@@ -46,14 +46,15 @@
@list = YAML.load_file(expfile) || Array.new
end
def add(opts)
name_available = self.name_available?(opts[:name])
if name_available
- #newexp = {:name => opts[:name], :date => Time.now, :fake_phy => opts[:fake_phy]}
newexp = {:name => opts[:name], :date => Time.now}
- newexp.merge!({:fake_phy => opts[:fake_phy]}) unless opts[:fake_phy].nil?
- newexp.merge!({:initial_phy => opts[:initial_phy]}) unless opts[:initial_phy].nil?
+ #newexp.merge!({:fake_phy => opts[:fake_phy]}) unless opts[:fake_phy].nil?
+ [:fake_phy, :initial_phy, :parsi_size, :bunch_size].each do |label|
+ newexp.merge!({label => opts[label]}) unless opts[label].nil?
+ end
@list.push newexp
self.save
true
end
end
@@ -71,9 +72,10 @@
end
end
self.save
end
def last_iteration(name)
+ # TODO is this working?
e = self.find_by_name(name)
e.last_bunch_dir unless e.nil?
end
def show
puts "Current Experiments"