Closed Nikhil-42 closed 2 months ago
Im taking Intro to SWE, and we have to make a contribution to an Open source Project. So, ima do this
Hello! Can you possibly specify a bit more how you'd like for the usage of MArrayDirection
to be removed?
Hello! Can you possibly specify a bit more how you'd like for the usage of
MArrayDirection
to be removed?
Instead of creating a new enum MArrayDirection
for UP, DOWN, LEFT, RIGHT we should just be checking for equality with from manim import UP, DOWN, LEFT, RIGHT
Thank you for your response! So this is my first contribution to an OS project, so I hope you understand if I still have a few questions. If I'm understanding correctly, anytime I see something along the lines of MArrayDirection.RIGHT
(or that otherwise tries to access a member the enum), I should simply rewrite/replace with the RIGHT
constant, as imported from manim
?
Thank you for your response! So this is my first contribution to an OS project, so I hope you understand if I still have a few questions. If I'm understanding correctly, anytime I see something along the lines of
MArrayDirection.RIGHT
(or that otherwise tries to access a member the enum), I should simply rewrite/replace with theRIGHT
constant, as imported frommanim
?
Yes that's the idea, if you want more information please connect with UF's Open Source club on discord.
Description
The use of enums here to implement getters, setters, and mutators is not necessary and decreases readability. For example, instead of
fetch_mob(MArrayElementComp)
it is much better simply to have 4 methodsget_body()
,get_value()
,get_index()
, andget_label()
. The 4 methods are self-documenting and the resulting code is actually shorter.Although I like the use of enums for specifying the directions (
MArrayDirection
), Manim has adopted the use of standard numpy arrays (UP
,DOWN
,LEFT
,RIGHT
) to denote directions. The use of an additional enum is unnecessary and doesn't conform with Manim practices.TODO
MArrayElementComp
MArrayDirection