#59 changed obj function to only return float #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The objective functions of the calibrator returns a tuple: (total_res, unweighted objective).
ebcpy needs the obj function to return only a float, because the optimization algorithms need this.
Interestingly, this is almost not noticable. See the following code as an example:
The "black_box_function" is the equivalent of the obj function. When beeing evaluated during the optimization, this evaluates correctly (Observable prints of the values). Only at a specific time (in this case when a new population is to be created) there will be an error:
It is though noticable when implementing different optimization algorithms, which immediately cant handle tuple returns of the obj function. Therefore this has to be changed.
Closes #59