[Lang] make Matrix.__init__ less response by introducing multiple initializers #1095
Labels
discussion
Welcome discussion!
feature request
Suggest an idea on this project
GAMES201
GAMES 201 students' wishlist
good first issue
A great chance for starters
python
Python engineering related
Milestone
Concisely describe the proposed feature
I strongly argue about the ultra-massive-centralized-multiplexer in
ti.Matrix.__init__
:... said the Linux Kernel Coding Style, and I believe the 80x24 rule also works in python too.
Not to say lobal variables, just the arguments alone, there are 11.
Describe the solution you'd like (if any)
Also note that the API initializing a
ti.Matrix
is highly centralized, GAMES201 students can easily get confused by error messages when they're not using the correct argument specification:Don't you think a better design could be:
to give
ti.Matrix.__init__
less duty just like currentlyti.Matrix.ones
andti.Matrix.zeros
does?Or at least we can make
ti.Matrix.__init__
serve as a router just redirecting to the actual functions liketi.Matrix.init_as_local
andti.Matrix.init_as_var
, instead of putting those implementations inside ofti.Matrix.__init__
if-else-if's?Additional comments
As I mentioned in #1046 (comment).
Note that we should always try our best to make a well-polished matrix/vector API before Taichi v1.0.0 comes.
The text was updated successfully, but these errors were encountered: