Skip to content

Commit

Permalink
Remove custom environment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Feb 7, 2024
1 parent 56f0425 commit 31ecc71
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 77 deletions.
14 changes: 3 additions & 11 deletions pysr/_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

import click

from ..test import (
get_runtests_cli,
runtests,
runtests_env,
runtests_jax,
runtests_torch,
)
from ..test import get_runtests_cli, runtests, runtests_jax, runtests_torch


@click.group("pysr")
Expand Down Expand Up @@ -48,15 +42,15 @@ def _install(julia_project, quiet, precompile):
)


TEST_OPTIONS = {"main", "env", "jax", "torch", "cli"}
TEST_OPTIONS = {"main", "jax", "torch", "cli"}


@pysr.command("test", help="Run PySR test suite.")
@click.argument("tests", nargs=-1)
def _tests(tests):
"""Run part of the PySR test suite.
Choose from main, env, jax, torch, and cli.
Choose from main, jax, torch, and cli.
"""
if len(tests) == 0:
raise click.UsageError(
Expand All @@ -70,8 +64,6 @@ def _tests(tests):
if test in TEST_OPTIONS:
if test == "main":
runtests()
elif test == "env":
runtests_env()
elif test == "jax":
runtests_jax()
elif test == "torch":
Expand Down
18 changes: 12 additions & 6 deletions pysr/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,6 @@ class PySRRegressor(MultiOutputMixin, RegressorMixin, BaseEstimator):
delete_tempfiles : bool
Whether to delete the temporary files after finishing.
Default is `True`.
julia_project : str
A Julia environment location containing a Project.toml
(and potentially the source code for SymbolicRegression.jl).
Default gives the Python package directory, where a
Project.toml file should be present from the install.
update: bool
Whether to automatically update Julia packages when `fit` is called.
You should make sure that PySR is up-to-date itself first, as
Expand Down Expand Up @@ -740,7 +735,6 @@ def __init__(
temp_equation_file: bool = False,
tempdir: Optional[str] = None,
delete_tempfiles: bool = True,
julia_project: Optional[str] = None,
update: bool = False,
output_jax_format: bool = False,
output_torch_format: bool = False,
Expand Down Expand Up @@ -873,6 +867,18 @@ def __init__(
f"Ignoring parameter; please pass {k} during the call to fit instead.",
FutureWarning,
)
elif k == "julia_project":
warnings.warn(
"The `julia_project` parameter has been deprecated. To use a custom "
"julia project, you should instead:\n"
" 1. Clone the PySR repository.\n"
" 2. Modify the `pysr/juliapkg.json` file's specification of the "
'SymbolicRegression.jl package to have `"dev": true` and `"path": '
'"/path/to/custom/project"`.\n'
" 3. Install this PySR package with `pip install -e .` from the "
"PySR repository root.\n"
"You should now be able to use the custom julia project.",
)
else:
raise TypeError(
f"{k} is not a valid keyword argument for PySRRegressor."
Expand Down
2 changes: 0 additions & 2 deletions pysr/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from .test import runtests
from .test_cli import get_runtests as get_runtests_cli
from .test_env import runtests as runtests_env
from .test_jax import runtests as runtests_jax
from .test_torch import runtests as runtests_torch

__all__ = [
"runtests",
"runtests_env",
"runtests_jax",
"runtests_torch",
"get_runtests_cli",
Expand Down
58 changes: 0 additions & 58 deletions pysr/test/test_env.py

This file was deleted.

0 comments on commit 31ecc71

Please sign in to comment.