vatlab / sos-scilab

sos language module for scilab
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Scilab Integration? #1

Open avianinc opened 2 years ago

avianinc commented 2 years ago

Any chance of integrating Scilab with SoS. Scilab is a solid open source alternative to MATLAB. Scilab includes Xcos which is similar to Simulink. (see https://www.scilab.org/).

BoPeng commented 2 years ago

Since scilab has a kernel that is similar to octave, I believe that it should be fairly straightforward to create an extension for it. Let me look into it.

tsara-s commented 2 years ago

We're working on it. What are you using to run Scilab? I downloaded scilab-6.1.1 and scilab-branch-6.1 but it does not open on my mac (Monterey 12.4)

avianinc commented 2 years ago

Wow... this is great. Here are the builds for Mac --> https://www.utc.fr/~mottelet/scilab_for_macOS.html My suggestion is to stick with the 6.0.2 build for now (although Im not sure it matters to your build)... but this version still maintains a solid connection with modelica which is why we are looking to use it with SoS.

Let me know and I'll make time to help... regards

tsara-s commented 2 years ago

We've concluded that we cannot use the MATLAB syntax for scilab, so we will make a new module

BoPeng commented 2 years ago

@avianinc Let me explain a bit more.

scilab can already be used in sos-notebook. You can use magics such as %expand and %magic as demonstrated here, but it cannot exchange variables with other kernels.

sos relies on some "converter" functions to represent variables in non-Python kernels (in this case scilab) in a string that can be executed in Python to "reproduce" the content of the variable. For example, using the sos_py_repr function that is defined for Octave when the Octave kernel is loaded, a matrix will be saved to disk and be read (by pandas) in Python. Although the syntax for scilab is similar to Octave, this function currently does not work for scilab so we cannot use the sos-matlab language module for scilab.

Since we are not familiar with scilab, we will have to rely on scilab users like you to provide us with such a function. We will appreciate it if you can have a look at this function and see why it does not work for variables such as a=[1 2 ; 3 4].

avianinc commented 2 years ago

Understood... I'll take a look and see what I can do.

BoPeng commented 2 years ago

We are making progress by learning scilab along the way. We will likely release a beta version of the scilab module this week.

avianinc commented 2 years ago

Just checking back in... anything I can do to help? Testing? Regards...

BoPeng commented 2 years ago

Data frame does not work since we could not find an equivalent datatype in scilab. Other than that we believe the module is working ok, although we are doing more testing and documentation before we make an initial release.

Anyway it should be safe for you to install the module from source and start testing.