GSoC’23 - GNU Octave: First 5 Weeks

GSoC
Code
Internship
GNU Octave
Author

Vipul Cariappa

Published

July 9, 2023

This is an account of all the tasks that I am finished with from the start of GSoC, or am working on at the moment.

Completed Tasks

  • Moved the repository which was previously hosted by a single person to hosting it under the GNU Octave project at GitLab. Work on this front was mainly done by my mentor Colin.
    Link to the repository at GitLab: GNU Octave / Octave Pythonic.

  • Supporting the latest versions of Python in Pythonic.
    Pythonic previously only supported Python version 3.9 and below. Now Pythonic supports the latest version of Python which is Python 3.11.
    Link to Merged MR at GitLab: Support python 3.10 & 3.11 and drops support for less then 3.7.

  • Using Python Stable ABI in Pythonic to support multiple versions of Python.
    Pythonic now uses Python Stable ABI. Python Stable ABI is a limited subset of the Python C API which Python Organisation grantees to be backward and forward compatible with old and new versions of Python.
    Link to Merged MR at GitLab: Updating Pythonic to use Python Stable ABI.

  • Updating the CI/CD pipeline at GitLab to test Pythonic against multiple versions of Python and Octave.
    In this update, we also migrated to use the official Docker image for Octave provided by GNU Octave. Now our automated CI/CD testing, tests Pythonic with the latest version of Octave which is version 8.2 with all the supported Python versions i.e. from Python version 3.7 to 3.11. It also tests Octave 7.1 with Python 3.9 and Octave 6.1 with Python 3.10. The CI/CD pipeline updates I am talking about at this point are restricted to testing on Linux. For testing on other platforms read the sections below.
    Link to Merged MR at GitLab: Updating gitlab CI/CD to use official gnu octave docker image.

  • Provide proof of concept of pyimport.
    pyimport is a command to import Python functions, classes, namespaces, or any other symbols into the Octave workspace. The concept is appreciated, but may not be merged into the main branch as it is a workaround to the fact that function handles are not yet supported on Pythonic.
    Link to Merge Request at GitLab: Add support to import modules using pyimport command.

  • Updated the Pythonic wiki with a list of functions and class methods Pythonic offers.
    Link to the wiki: Pythonic/fullAPI.

On Going Work

  • Implementation of destructor for pyobjects
    Destructor was previously not supported on Pythonic. Variables which were no longer used were still kept in memory and were not freed/released from memory. This was due to a bug in the core Octave interpreter (bug #46497, classdef: delete destructor method…). This bug is now fixed.
    Link to Merge Request at GitLab: Support for destructor of pyobject.

  • Implementation of pyenv function
    pyenv is a MATLAB compatibility function. pyenv lets the user select the version of Python to be used. At the time of writing this article, the pyenv functionality is working properly on Linux systems, but using it on Windows crashes Octave. To me, it looks like an issue with how Octave is packaged on Windows. Because depending on how Octave is launched the functionality works or does not work. Any progress on this will be appended to this article later.
    Link to Merge Request at GitLab: pyenv function to select python version.

  • Testing on Windows (and MacOS)
    I am primarily focusing on Windows. My mentor is currently looking at MacOS. Octave does not offer a Windows Docker image to test on Windows. Compiling any octave package which contains C/C++ code required some Linux specific tools to be installed (at least in the case of Pythonic), which is usually bundled with Octave on Windows. But compiling Pythonic on GitLab’s CI/CD pipeline has been a work with no success till now.
    Link to Merge Request on Gitlab: CI: Build / Test on Windows.

Issues / Discussions I Opened

Miscellaneous

Issues or discussions I opened or any other contributions to the GNU Octave which do not directly concern my GSoC project.