Skip to content

Commit

Permalink
Merge 1bfc635 into b1b8fed
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Mar 20, 2023
2 parents b1b8fed + 1bfc635 commit 520f674
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/helpers/optimizations_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ def status_text(status)
status_text = {
Optimization::OPTIMIZATION_ERROR => "Optimization_Error",
Optimization::PENDING => "Pending",
Optimization::VALID_POINT => "Valid_Point",
Optimization::INVALID_POINT => "Invalid_Point",
Optimization::RUNTIME_ERROR => "Runtime_Error",
Optimization::SOLUTION_REACHED => "Solution_Reached",
Optimization::VALID_POINT => "Valid Point",
Optimization::INVALID_POINT => "Invalid Point",
Optimization::RUNTIME_ERROR => "Runtime Error",
Optimization::SOLUTION_REACHED => "Solution Reached",
Optimization::RUNNING => "Running"
}
status_text[status] ? status_text[status] : "Empty"
Expand Down
4 changes: 4 additions & 0 deletions app/lib/whats_opt/openmdao_variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def default_py_value
end
end

def ones_py_value
default_py_value
end

def lower_py_value
"-inf"
end
Expand Down
4 changes: 1 addition & 3 deletions app/models/analysis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,9 @@ def output_variables
end

def coupling_variables
# TODO: see if it can be optimize using SQL
unless @couplings
conns = Connection.of_analysis(self).select{|c| !c.driverish?}
# FIXME: only scalar couplings are handled at the moment for EGMDO
@couplings = conns.map(&:from).uniq # .select(&:is_scalar?)
@couplings = conns.map(&:from).uniq
end
@couplings
end
Expand Down
7 changes: 6 additions & 1 deletion app/models/variable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def init_py_value
default_py_value
end
else
self.parameter.init
is_num = true if Float(self.parameter.init) rescue false
if is_num && self.ndim > 0
ones_py_value + " * #{self.parameter.init}"
else
self.parameter.init
end
end
end

Expand Down

0 comments on commit 520f674

Please sign in to comment.