Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
b933dea
1
Parent(s):
6fdc3b9
Add pre-commit hooks for unused imports
Browse files- .pre-commit-config.yaml +5 -0
- benchmarks/print_best_model.py +0 -1
- docs/gen_param_docs.py +0 -1
- pysr/__init__.py +16 -0
- pysr/export_jax.py +0 -3
- pysr/export_latex.py +0 -1
- pysr/test/__init__.py +2 -0
.pre-commit-config.yaml
CHANGED
@@ -18,3 +18,8 @@ repos:
|
|
18 |
rev: 0.6.1
|
19 |
hooks:
|
20 |
- id: nbstripout
|
|
|
|
|
|
|
|
|
|
|
|
18 |
rev: 0.6.1
|
19 |
hooks:
|
20 |
- id: nbstripout
|
21 |
+
# Unused imports:
|
22 |
+
- repo: https://github.com/hadialqattan/pycln
|
23 |
+
rev: "v2.2.2"
|
24 |
+
hooks:
|
25 |
+
- id: pycln
|
benchmarks/print_best_model.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
"""Print the best model parameters and loss"""
|
2 |
-
import sys
|
3 |
import numpy as np
|
4 |
import pickle as pkl
|
5 |
import hyperopt
|
|
|
1 |
"""Print the best model parameters and loss"""
|
|
|
2 |
import numpy as np
|
3 |
import pickle as pkl
|
4 |
import hyperopt
|
docs/gen_param_docs.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
# Load YAML file param_groupings.yml:
|
2 |
-
from pathlib import Path
|
3 |
from yaml import safe_load
|
4 |
import sys
|
5 |
|
|
|
1 |
# Load YAML file param_groupings.yml:
|
|
|
2 |
from yaml import safe_load
|
3 |
import sys
|
4 |
|
pysr/__init__.py
CHANGED
@@ -12,3 +12,19 @@ from .julia_helpers import install
|
|
12 |
from .feynman_problems import Problem, FeynmanProblem
|
13 |
from .export_jax import sympy2jax
|
14 |
from .export_torch import sympy2torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
from .feynman_problems import Problem, FeynmanProblem
|
13 |
from .export_jax import sympy2jax
|
14 |
from .export_torch import sympy2torch
|
15 |
+
|
16 |
+
__all__ = [
|
17 |
+
"sklearn_monkeypatch",
|
18 |
+
"__version__",
|
19 |
+
"pysr",
|
20 |
+
"PySRRegressor",
|
21 |
+
"best",
|
22 |
+
"best_tex",
|
23 |
+
"best_callable",
|
24 |
+
"best_row",
|
25 |
+
"install",
|
26 |
+
"Problem",
|
27 |
+
"FeynmanProblem",
|
28 |
+
"sympy2jax",
|
29 |
+
"sympy2torch",
|
30 |
+
]
|
pysr/export_jax.py
CHANGED
@@ -1,7 +1,4 @@
|
|
1 |
-
import functools as ft
|
2 |
import sympy
|
3 |
-
import string
|
4 |
-
import random
|
5 |
|
6 |
# Special since need to reduce arguments.
|
7 |
MUL = 0
|
|
|
|
|
1 |
import sympy
|
|
|
|
|
2 |
|
3 |
# Special since need to reduce arguments.
|
4 |
MUL = 0
|
pysr/export_latex.py
CHANGED
@@ -3,7 +3,6 @@ import sympy
|
|
3 |
from sympy.printing.latex import LatexPrinter
|
4 |
import pandas as pd
|
5 |
from typing import List
|
6 |
-
import warnings
|
7 |
|
8 |
|
9 |
class PreciseLatexPrinter(LatexPrinter):
|
|
|
3 |
from sympy.printing.latex import LatexPrinter
|
4 |
import pandas as pd
|
5 |
from typing import List
|
|
|
6 |
|
7 |
|
8 |
class PreciseLatexPrinter(LatexPrinter):
|
pysr/test/__init__.py
CHANGED
@@ -3,3 +3,5 @@ from .test_env import runtests as runtests_env
|
|
3 |
from .test_jax import runtests as runtests_jax
|
4 |
from .test_torch import runtests as runtests_torch
|
5 |
from .test_cli import runtests as runtests_cli
|
|
|
|
|
|
3 |
from .test_jax import runtests as runtests_jax
|
4 |
from .test_torch import runtests as runtests_torch
|
5 |
from .test_cli import runtests as runtests_cli
|
6 |
+
|
7 |
+
__all__ = ["runtests", "runtests_env", "runtests_jax", "runtests_torch", "runtests_cli"]
|