Currently there is no order of how methods appear, for example, within the TensorBase class and in math.py. There is no strict convention for organizing methods and functions but a general pattern to follow would be:
class SomeClass(object):
def __magic_methods__(self):
"magic methods first, usually in alphabetical order"
def _private_method(self):
"worker methods next, also in alphabetical order"
def a_method(self):
"then normal methods, also in alphabetical order"`
Totally agree with you there! And I will implement this for my Code as well.
I also see a problem with class organization and how they interact with each other, because often the docs aren't sufficient explaining code interactions. I suggest a small diagram or a flow chart to get ppl to get our code faster and of course also easier!
I've gone through all the current code and organized it in PR #351, and it might be a good thing to add also to the style guidelines for the project so we can try to stay consistent throughout. Also totally agree with you, there should be a relatively easy to understand logic behind the class organization. We use draw.io quite frequently at my work for such things, so this could be a good tool for such a task.
Sounds like a good idea, Im getting to it on my code!
Most helpful comment
I've gone through all the current code and organized it in PR #351, and it might be a good thing to add also to the style guidelines for the project so we can try to stay consistent throughout. Also totally agree with you, there should be a relatively easy to understand logic behind the class organization. We use draw.io quite frequently at my work for such things, so this could be a good tool for such a task.