nnaisense / evotorch

Advanced evolutionary computation library built directly on top of PyTorch, created at NNAISENSE.
https://evotorch.ai
Apache License 2.0
1.01k stars 63 forks source link

Fix the signature of `_do_cross_over(...)` #30

Closed engintoklu closed 2 years ago

engintoklu commented 2 years ago

The CrossOver base class has a method _do_cross_over(...) that is meant to be overriden by the inheriting classes. Although the documentation and the initial signature of _do_cross_over(...) claims that the expected arguments are batch (the original SolutionBatch), parents1 (decision values of the first half of the selected parents) and parents2 (decision values of the second half of the selected parents), what the class CrossOver actually does is to call it only with the arguments parents1 and parents2 (this can be confirmed by looking at the _do(...) method of CrossOver). All our CrossOver subclasses also define their implementations of _do_cross_over(...) with the arguments parents1 and parents2 only. Therefore, the initial signature of _do_cross_over(...) and its docstring are misleading. This pull request aims to fix those misleading elements.

codecov-commenter commented 2 years ago

Codecov Report

Merging #30 (efc3403) into master (1bb5412) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #30   +/-   ##
=======================================
  Coverage   53.48%   53.48%           
=======================================
  Files          43       43           
  Lines        6254     6254           
=======================================
  Hits         3345     3345           
  Misses       2909     2909           
Impacted Files Coverage Δ
src/evotorch/operators/base.py 33.01% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.