-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add the disappearing sample function
- Loading branch information
1 parent
0e35dee
commit c60f89d
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SevgiAkten - Why are you adding the deleted function again? Does it have any use? If so, who uses, is there
sample(...
function call anywhere?If it is substantial, why tests still pass even tough it is absent?
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the sample(...) function call is present here, and before I started reviewing the code, it was causing an error in the optimizer.py file because the function was not defined. I thought it might have been accidentally deleted.
`# Evaluate the final solution sampled from the probability vector
best_byte_ch = byte_operators.bits_to_floats(sample(vector))
best_byte_result = problem.f(best_byte_ch)`
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, the tests are not written properly, right? One can not run each single file after a change, so tests should satisfy the robustness of the package.
I have been changing things and observing the test results, all of my changes pass tests, but now I can see it is not the point and I might have broken something.
This is a sign of a poor design.
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at that, https://github.com/SevgiAkten/pycellga/actions, everything is in green but it seems I have broken at least one thing.
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right. I will now write comprehensive tests for each part of the optimizer separately. This oversight is entirely my fault, and I will make sure to address it.
c60f89d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.