EMS-TU-Ilmenau / fastmat

A library to build up lazily evaluated expressions of linear transforms for efficient scientific computing.
https://fastmat.readthedocs.io
Apache License 2.0
24 stars 8 forks source link

Expose options interface to all classes #40

Closed ChristophWWagner closed 5 years ago

ChristophWWagner commented 5 years ago

Finally there was a case where fiddling around with Matrix baseclass' internal options to achieve something a user actually dreams of. Explicitly, forcing element contiguousy and ordering for input arrays prior to processing. Internally controlled by the flags _forceInputAlignment and _useFortranStyle.

Exposed to the outer world these can be controlled via the _initProperties arguments forceInputAlignment=True and fortranStyle=True. Unfortunately not all classes currently forward arbitrary **options of __init__() to _initProperties, yet alone offers **options in the first place. This must change for consistency reasons alone

Technically a user could actually just call _initProperties, supply the fixed arguments from the object itself and attach some new options but this is ugly. Very ugly. And on top of that any method starting with an _ should never be called by a user in the first place.

So this needs to change :)

SebastianSemper commented 5 years ago

Agreed.

This being agreed upon, we should find a place, where to document stuff like this such that it is easily found by the interested power user.

ChristophWWagner commented 5 years ago

Good.

How about we spend a dedicated section to API documentation and make this a part of it? Would also make sense to spend the baseclass init() method a docstring that documents general options while each class may elaborate more (and should so) on its special arguments. Currently help(aClass.__init__) is not very informative. Does sphynx inherit docstrings from baseclasses btw?