jameshughes89 / cs4XX-EvolutionaryComputation

CS 4XX: Evolutionary Computation
http://csci340.com/
GNU General Public License v3.0
5 stars 14 forks source link

:technologist: Code --- ~Remove fstrings if not really fstrings~ Include more details in exceptions :microscope: #158

Closed jameshughes89 closed 12 months ago

jameshughes89 commented 12 months ago

What

~Remove the use of f strings when there is no need for f string~ Add more details to the f strings for the exceptions.

Why

~ Mostly because my flake8 yelled at me~ It's better this way

Testing

:+1:

Additional Notes

The messages are redundant to a silly level, but whatever, it's at least showing you that you were in fact wrong. E.g.

"Total fitness of population is 0" vs f"Total fitness of population is 0: {sum(population)}"

Obv the sum will be 0, but still, it shows you.

jameshughes89 commented 12 months ago

Even for dumb checks like this, it can be helpful to include the erroneous value in the error message. sum cannot be zero but got: {sum} is more helpful than sum cannot be zero.

good call, brother