force-h2020 / force-bdss

Business Decision System general interface
BSD 2-Clause "Simplified" License
2 stars 2 forks source link

FIX: Create BaseMCOCommunicator before listeners in EvaluateOperation #335

Closed flongford closed 4 years ago

flongford commented 4 years ago

This PR closes #333

It refactors part of the EvaluateOperation.run method into a new EvaluateOperation.create_mco_communicator method, which is called before any listeners are set up.

Additionally, we remove the _deliver_start_event and _deliver_finish_event methods from being called, since these should signify the beginning and end of an optimization procedure (handled by the OptimizerOperation), rather than a single point evaluation.

Note:

Any Exceptions raised during the instantiation will now be propagated through to the BDSSApplication.run method, rather than returning False. The only reasoning behind the previous design I can see is to avoid any uncontrolled crashes of the force_bdss program in the event of a failure. However, since the run method is already executed in a try block, any exceptions will be handled accordingly by above.

codecov[bot] commented 4 years ago

Codecov Report

Merging #335 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #335   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files          60       60           
  Lines        1693     1694    +1     
  Branches      172      172           
=======================================
+ Hits         1666     1667    +1     
  Misses         23       23           
  Partials        4        4           
Impacted Files Coverage Δ
force_bdss/app/evaluate_operation.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0e249a4...7eb1963. Read the comment docs.