MilesCranmer / PySR

High-Performance Symbolic Regression in Python and Julia
https://astroautomata.com/PySR
Apache License 2.0
2.19k stars 207 forks source link

Refactor testing suite to be callable from pysr #221

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

This moves the testing suite to be callable with, e.g.,

from pysr.test import runtests
runtests()

this makes it easier to ensure that the correct PySR is actually being tested, whereas with python -m unittest test.test, it is not clear if it is testing a local copy or the installed version.

This also adds a testing CLI, so that you can run, e.g.,

python -m pysr.test <test>

where <test> is one of "main", "env", "torch", or "jax".