mindsdb / lightwood

Lightwood is Legos for Machine Learning.
GNU General Public License v3.0
434 stars 92 forks source link

Fix 'ambiguous variable name 'l' issue in lightwood\encoder\text\helpers\rnn_helpers.py #1188

Closed truesoni closed 10 months ago

truesoni commented 10 months ago

Improvement Suggestion: Found an issue: ambiguous variable name 'l'

It's currently on:

[lightwood\encoder\text\helpers\rnn_helpers.py:247]

Variables named I, O, and l can be very hard to read. This is because the letter I and the letter l are easily confused, and the letter O and the number 0 can be easily confused. Change the names of these variables to something more descriptive.

Example of incorrect code: The code in this example could be misinterpreted to be 0 * 1.08 (zero times one-point-eight).

O = 100.0
total = O * 1.08

Example of correct code: This example clarifies that we're multiplying an order variable by another number.

order = 100.0
total = order * 1.08
paxcema commented 10 months ago

Hi @truesoni, thanks for highlighting this.

The file you indicate is actually deprecated, and cannot be used at all. If anything, we should actually remove this from the source code. Will open up an issue for that, but I'll close this one as won't fix.

truesoni commented 10 months ago

ok, thanks for the feedback