What kotlin package gives numpy capabilities? - numpy

I would like to convert python code that uses numpy to Kotlin. Which package is recommended to use that delivers most (or all) of numpy capabilities?
Thanks

See: https://github.com/Kotlin/multik
For more information:
https://blog.jetbrains.com/kotlin/2021/02/multik-multidimensional-arrays-in-kotlin/
Multik Architecture
Initially, we attempted to add Kotlin bindings to existing solutions,
such as NumPy. However, this proved cumbersome and introduced
unnecessary environmental complexity while providing little benefit to
justify the overhead. As a result, we have abandoned that approach and
started Multik from scratch.

Related

How MapDataset captures user defined function from Python and inject into C++ implementation

I am getting started with TF and I am interested in 1) learning how tf.data implementation works, in particular, on how the C++ backend captures/executes user defined-function by Python scripts.
I was expecting that C++ backend would use Python embedded approach, but apparently this doesnt happen; maybe because of performance hits in instantiating python interpreters on c++ for each example/batch. Instead, tf.data seems to transform user-defined functions by Python scripts in graphs on the C++ side, as mentioned in this great video by TF folks at 5:15.
I have been trying to make sense of python/ops/gen_dataset_ops.py, tensorflow/core/ops/dataset_ops.cc, tensorflow/core/kernels/data/map_dataset_op.cc, tensorflow/core/framework/function.h, ``tensorflow/core/kernels/data/captured_function.h` without success. Any pointer on how to understand this flow would be truly appreciated!
Assuming user-defined functions are transformed in c++ graphs, 2) does that mean that the user-defined function must use only native python operations or python classes/modules could also be used and "somehow" converted into C++?

Workflow for going from Numpy to Embedded C?

I'm pretty new with Embedded C, but I've got some operations on numpy arrays that I think I would like to try to put into an embedded system.
I can't seem to find any documentation or recommendations on this, but I would imagine there is a recommended workflow.
Any thoughts?

Does Sympy 0.7.1 work with Jython?

Does anybody now whether sympy 0.7.1 will work with Jython?
No, it doesn't work - I think it doesn't even import. There's an open issue for this in sympy's bug tracker. The development version should import fine, but there are problems still.
It's late but for all future readers:
As of Jython-2.7.1, it can import SymPy and most of SymPy works on it.
However, it is very slow compared to CPython possibly due to this issue http://bugs.jython.org/issue2604. See #4332.
You can download the Jython-2.7.1 from mvnrepository. If it shows you 0 Bytes then you can use this alternate link

Is there a Matlab tool similar to Python's Doctest?

In my Python development, doctest has really helped both to
make writing unit tests less annoying, and
integrate usage examples with documentation.
I was wondering, is there anything like this available in the Matlab world? It doesn't have to literally use code comments as a test, but if it had those two desirable qualities, that would be great!
This exists now! There are three versions out there:
An Octave-compatible version that still gets some development
A version of Matlab-xUnit with an integrated doctest runner
The original version from 2010, which is self-contained and emits results in TAP format
Not yet, but there is something to generate documentation called M2HTML.
It is very useful, and you can take a look at the examples at that page to see how wonderful results it's producing (even dependency graphs :) ).
For unit testing in MATLAB, even if there are many solutions, mlUnit was the most efficient to me.
There is no direct equivalent to doctest in MATLAB.
There is, however, a nice unit testing framework on the Matlab File Exchange.

An example of ctypes on IronPython?

I'm trying to understand ctypes, and it's relationship to IronClad, on IronPython. (Ctypes is supposed to be implemented in the latest IronPython release.) Can somebody give a simple example of ctypes in IronPython that works on Mono/OSX? When trying the standard demos, I get:
import ctypes
SystemError: libdl.so
Am I missing something obvious?
More generally, how does ctypes relate to the IronClad project?
I don't know the answer to your first question (I don't use Mono - sorry), but I can answer your general question.
IronClad is an adaptor that allows existing CPython extension modules, written against the CPython API, to work seamlessly on IronPython. Ctypes, on the other hand, is an FFI (Foreign Function Interface) that allows Python code to call into native code in a platform-independent way.
Before ctypes, the only way to access native code from Python was to write a CPython extension that was tightly coupled to CPython; ctypes removes that coupling and allows it to work on any Python implementation that implements ctypes. IronClad exists to allow all of the legacy extensions to continue to work on IronPython. For new stuff, though, ctypes is the way to go.