Closed stroxler closed 12 years ago
These functions will come in handy!
Can you add the .. autofunction:: la.ones etc to the sphinx doc?
I noticed that in numpy np.ones and np.zeros just call np.empty with fill values of 1 and 0, respectively.
Maybe we should go that way too? So if we made a la.empty then la.ones and la.zeros could use that and just fill the arrays. That would be cleaner (less duplicate code) plus it would give us a la.empty function.
I can do that. Empty() can't be tested easily, but that is no problem. I guess you could view the other tests as testing it.
Could you add See Also sections? ones, zeros, empty, lrange could all be in each others docstrings.
The _args and *_kwargs cannot be dropped if we want the function to behave the way we had initially decided. But we could make it follow the same rules that the others follow, in which case they can be.
The issue is that without _args, you can't get something like la.lrange(5,4,3) to work. It would have to be la.lrange((5,4,3)). That's why all these functions had args and _kwargs in the first place. But I don't see a strong reason to prefer the current call. It is more convenient, but if the docstring is confusing does that matter?
Good point. Let's go with the shape input so that lrange matches la.ones, zeros and empty instead la.rand, randn.
That was a typo. Should be fixed now.
Closes #15