3b1b / manim

Animation engine for explanatory math videos
MIT License
60.43k stars 5.71k forks source link

x_min = x_min or self.input_line.x_min can incorrectly assign a default value #864

Closed medhapotluri closed 4 years ago

medhapotluri commented 4 years ago

https://github.com/3b1b/manim/blob/master/from_3b1b/old/alt_calc.py#L115

I believe the line x_min = x_min or self.input_line.x_min is intended to assign a default value to x_min only if no value is passed in for x_min and x_min is None, but it will also assign a default value if 0 is passed in forx_min. x_min could evaluate to 0 in the case that the same value is passed in for x and sample_radius to get_local_sample_dots.

PgBiel commented 4 years ago

That file is an old project used for 3b1b's videos. It won't be updated; most files in the old folder have issues or won't work on the latest version of manim because they're simply old projects. So, don't worry about it.

If you want to use that code and believe the code there is wrong, you can fix it in your program using x_min if x_min is not None else self.input_line.x_min.