lesteve / scikit-learn-tests-pyodide

Run scikit-learn test suite inside Pyodide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

This repository runs the scikit-learn tests in Pyodide using the scikit-learn development version and the Pyodide development version.

As of end-September 2023, scikit-learn runs its test suite inside Pyodide (latest release, which is 0.24.1 at the time of writing) in its CI :tada::tada::tada:. See Linux_Nightly_Pyodide job in azure-pipelines.yml, script to build Pyodide wheel and script to test Pyodide wheel.

There are a few xfailed tests due to Pyodide limitations related to threads, processes, floating point exceptions, memmaps and importlib. To see the xfailed tests, look at this.

This repository uses artifacts from https://github.com/lesteve/scipy-tests-pyodide, which builds every day a Pyodide distribution in debug mode from the Pyodide main branch and scikit-learn from the main branch.

How to run locally

You can run all tests by module like this:

python run-tests-by-modules.py

You can run selected tests with additional pytest arguments like this:

python run-tests-by-modules.py sklearn.tree -k poisson -q

Or do a similar thing it directly with the js helper:

node --experimental-fetch scikit-learn-pytest.js --pyargs sklearn.tree -k poisson -q

scikit-learn-pytest.js is strongly inspired from a previous version of numpy/numpy#21895.

About

Run scikit-learn test suite inside Pyodide


Languages

Language:Python 80.0%Language:JavaScript 20.0%