Skip to main content

best-python

The goal of this project is to provide a way to use the best-brainstorm Matlab solvers in Python, compatible with MNE-Python.

For now, the project is using matlab.engine to call the best-brainstorm functions from Python, so you need to have Matlab installed on the computer.

Installation

Matlab and matlabengine package installation

You need to have Matlab installed on your computer. Then, you can install the matlabengine package matching the Matlab version you have installed.

You can run the get_matlab_version.py script to get the version of Matlab installed on your computer.

python get_matlab_version.py

It should return something like:

Getting MATLAB version... Please wait.
MATLAB version found: 24.1.0.123456
Run the following command in the terminal to install the required version:
pip install matlabengine>=24.1.0,<25.0.0

Then, you can install the matlabengine package with the version found:

pip install matlabengine>=24.1.0,<25.0.0

After that, you can install the best-python package:

pip install best-python

Best-brainstorm installation

As the best-python package is using the best-brainstorm functions, you need to have the best-brainstorm toolbox downloaded on your computer.

You can download the best-brainstorm toolbox from the best-brainstorm github.

Usage

You can use the functions from the best-python package like this:

import best_python

# Create a new instance of the wrapper
# You need to provide the path to the best-brainstorm root folder
matlab_wrapper = best_python.MatlabWrapper("C:/PATH/OF/BEST-BRAINSTORM/ROOT/FOLDER")

# Call the solver
stc = matlab_wrapper.mem_solver(evoked, forward, noise_cov, depth=0.8, loose=0.0)

Full example

You can find a full example in the tests/test.py file link.

Release files for bestpython 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bestpython 0.0.5
File Size Uploaded
bestpython-0.0.5.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bestpython 0.0.5
File Interpreter ABI Platform
bestpython-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 16.3 kB

Release files / bestpython-0.0.5.tar.gz

Download URL bestpython-0.0.5.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4a7de5cc3ac5d8bc9dfe56606bddf7c538c6907d58b460ad5823a1dc9db8a51f
BLAKE2b-256 checksum
How to use checksums
bb97d61884b79346e4e7d1d23fdd0a1b46725993627b8429d7becad53fb16219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.0

Release files / bestpython-0.0.5-py3-none-any.whl

Download URL bestpython-0.0.5-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ba850ef0b3205e43beb0705b586e4798043920e8562315490a3a244498eee8b
BLAKE2b-256 checksum
How to use checksums
a9580c8aac30986948bb57d7da0fbe7164b3c32f4dd615e50c8742db35dad9bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page