-
Notifications
You must be signed in to change notification settings - Fork 29
Things I've had to look up starting to use SciRust #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Will try to answer some of the questions. Online documentation hosted at : http://indigits.github.io/scirust/doc/scirust/index.html . Actually you don't have to import so many things. There is a small module called
All the necessary traits are automatically imported the moment u add scirust::api::*. Even using Now, in order to take care of typical cases of construction, I have introduced a whole lot of constructor functions in |
I have been thinking that general usage examples and the design principles behind the SciRust should be captured in the form of an open book. I started a bit of work on it but haven't yet invested much time on it. http://shailesh1729.gitbooks.io/scirust-design-guide/content/. Since the design itself is currently quite fluid, hence less motivation to write stuff which may have to be rewritten later. But we can discuss this further. |
Yes, indexing is a problem at the moment. In Python, they provided special support for multi-indices at the language level for numpy. I think Rust allows the concept of compiler plugins which can be used to introduce additional library specific syntax. If one could work on that, then a[i, j] type of syntax should be possible to support. But I haven't had the heart to experiment with compiler plugins yet. |
On cell_iter, since there are different kinds of iterators possible, it might be a better idea to have explicit long names for their implementation. We can then introduce shorter names using typedef type stuff. A simple
would do the job. Similarly, consider calculating I have been using convention of mean_cw and mean_rw for column wise or row wise operation. You will see _cw and _rw appearing at a lot of places. After this, an additional function Rust doesn't support default values for function arguments. It suggests to go for different functions in such cases (till I last checked). MATLAB lets specify the dimension over which work is to be done as an argument to most functions. Since MATLAB fundamental data type is N-D array, this is okay. For matrices, most operations are typically either over rows or over columns. So I feel that specifying _cw and _rw could be a good convention. This is off course up to debate and discussion. I didn't have any plans to extend the Matrix data structure to become an N-D array. If we have to introduce N-D array at a later point of time, I was thinking that they could be developed as a separate structure which could seamlessly interact with matrices but would not provide operations which are applicable only for matrices (like linear algebra operations). |
I will try to add a set of simple usage examples in the main documentation at the front page itself. Since examples in the documentation are verified while running unit tests, they are going to be maintained quite well. |
Thanks for the write up! |
About indexing, I think we can already support syntax like a[(i,j)] simply by implementing Index<(isize, isize)>. Then change Index to panic unless we have a single row or a single column. What do you think? |
It isn't very pretty, but much nicer than get, I think |
The documentation has been updated with couple of examples README.md also points to it already. Though readme itself doesn't have examples yet. Will do that also some time.
|
I've contributed a little code, so I'm not as fresh as a typical new user, but I've still had to hunt around for the follow as I tried to convert some numerical code to use SciRust. I think our goal should be to be friendly towards someone coming to do numerical code from Python or R or Matlab; the intersection of numerical developers and rust experts is pretty small.
ones
is not directly importable [E0253]". Are there more friendly ways to expose this function? this is a very common function in my usage, and we should consider this as a UI issue.The text was updated successfully, but these errors were encountered: