back to home

blink1073 / oct2py

Run M Files from Python - GNU Octave to Python bridge

270 stars
52 forks
1 issues
Jupyter NotebookPythonMATLAB

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing blink1073/oct2py in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/blink1073/oct2py)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Oct2Py: Python to GNU Octave Bridge Oct2Py allows you to seamlessly call M-files and Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as: To run .m function, you need to explicitly add the path to .m file using: To get the output of .m file after setting the path, use: If you want to run legacy m-files, do not have MATLAB®, and do not fully trust a code translator, this is your library. Features • Supports all Octave datatypes and most Python datatypes and Numpy dtypes. • Provides OctaveMagic for IPython, including inline plotting in notebooks. • Supports cell arrays and structs/struct arrays with arbitrary nesting. • Supports sparse matrices. • Builds methods on the fly linked to Octave commands (e.g. above). • Thread-safety: each Oct2Py object uses an independent Octave session. • Can be used as a context manager. • Supports Unicode characters. • Supports logging of session commands. • Optional timeout command parameter to prevent runaway Octave sessions. Installation You must have GNU Octave installed and in your environment variable. Alternatively, you can set an or environment variable that points to executable itself. You must have the Numpy and Scipy libraries for Python installed. See the installation instructions for more details. Once the dependencies have been installed, run: If using conda, it is available on conda-forge: Documentation Documentation is available online. For version information, see the Changelog. JupyterHub with Qt Support To enable Octave's Qt graphics toolkit in a JupyterHub environment (or any headless server), you need a virtual display. Install the required system packages: Start before launching JupyterHub (or in a server startup script): Then configure oct2py to use the Qt backend in your notebook or script: Alternatively, set to run Octave under : For Binder-based deployments, the directory in this repository contains an listing required packages and a script that launches and exports before the Jupyter server starts, enabling Qt graphics out of the box.