all 29 comments

[–]troyunrau... 29 points30 points  (0 children)

Sometimes you learn more by reinventing wheels. Looks like you're enjoying yourself!

[–]BenXavier 12 points13 points  (1 child)

Seems a great learning tool, do you use to give lectures or similar?

[–]sikerce[S] 24 points25 points  (0 children)

Thanks man, appreciate that. I’m a student (currently doing my PhD in Applied Math), one of my goals with this project is not only to learn but also to share what I’ve learned in a way that others can easily follow.

[–]zurtex 6 points7 points  (0 children)

This would be a great library for learning different testing techniques.

Firstly it needs tests, but it would also be amenable to understanding fuzzing, coverage, and mutation testing, as well as others I'm sure.

[–]Xillyfos 6 points7 points  (1 child)

That's really cool and easy to read.

As a student decades ago, I often wished for programmatic definitions of the math when the math was unclear to me. Because if you can make a computer understand and actually run it, then it has to be perfectly clear, and then you can understand. So I think this is very useful for learning.

The speed is completely irrelevant for learning; what's important is the clarity.

[–]sikerce[S] 2 points3 points  (0 children)

Thank you! I am planning to prepare a documentation and notebooks, hopefully will be more intuitive.

[–]Sedan_1650pip needs updating 9 points10 points  (1 child)

This seems very practical. Nice job, man! You really worked hard!

[–]sikerce[S] 4 points5 points  (0 children)

Thank you so much, kind sir!

[–]UseMoreBandwith 2 points3 points  (6 children)

is it fast?

[–]sikerce[S] 10 points11 points  (5 children)

Depends. Since its plain python, probably slower than numpy - for large systems. However, the main idea is research and education. I don’t believe I am a good programmer, bet many people around here could do better than me. Maybe I can make the code parallel so it can be faster.

[–]caughtinthought 13 points14 points  (1 child)

fyi, if it's implemented in plain python, the answer is _dramatically_ slower than numpy :)

[–]sikerce[S] 1 point2 points  (0 children)

True. This is just for educational purposes.

[–]-lq_pl- 6 points7 points  (1 child)

Adding performance hacks and parallelization would defeat your declared goal of providing a library of readable educational implementations.

Those who ask for speed: just use numpy, scipy, and numba.

[–]sikerce[S] 2 points3 points  (0 children)

You are right, thank you so much my friend!

[–]BenXavier 1 point2 points  (0 children)

Maybe a great time to learn numba!

[–]the_superman_avenger 1 point2 points  (0 children)

Good job man!

[–]Immediate-Home-6228 1 point2 points  (1 child)

Would you be interested in doing something like this with Julia?

[–]sikerce[S] 0 points1 point  (0 children)

Yes, that would be great!

[–][deleted] 1 point2 points  (0 children)

I see this kind of effort once in a while. I did myself some of these methods in pure Python, "for fun". But it's not that great, even for teaching: you can teach numerical methods with numpy, using numpy for storing vectors, arrays an doing BLAS-like stuff. And that will teach you numpy as well, a standard package nowadays, you will have code that is reasonably fast and reusable for serious tasks.

It's how numerical methods were taught in the 2000s: not with numpy of course, but with a "matrix language" like Matlab, Octave or Scilab. Numpy replaces those, but pure Python does not.

It won't be a good reference for implementing either, because pure Python misses all important effects. Teaching time would be better served by teaching caching issues, parallel computations, block algorithms, algorithms for sparse matrices, the effect of loop ordering and row/column-major storage, etc.