Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent a17b9ad commit dcef8e7
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions benchmarks/hyperparamopt.py
@@ -1,4 +1,5 @@
"""Start a hyperoptimization from a single node"""

import pickle as pkl
import sys

Expand Down
1 change: 1 addition & 0 deletions benchmarks/print_best_model.py
@@ -1,4 +1,5 @@
"""Print the best model parameters and loss"""

import pickle as pkl
from pprint import PrettyPrinter

Expand Down
1 change: 1 addition & 0 deletions docs/generate_papers.py
@@ -1,4 +1,5 @@
"""This script generates the papers.md file from the papers.yml file."""

from pathlib import Path

import yaml
Expand Down
1 change: 1 addition & 0 deletions pysr/denoising.py
@@ -1,4 +1,5 @@
"""Functions for denoising data during preprocessing."""

import numpy as np


Expand Down
1 change: 1 addition & 0 deletions pysr/deprecated.py
@@ -1,4 +1,5 @@
"""Various functions to deprecate features."""

import warnings


Expand Down
1 change: 1 addition & 0 deletions pysr/export_latex.py
@@ -1,4 +1,5 @@
"""Functions to help export PySR equations to LaTeX."""

from typing import List, Optional, Tuple

import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions pysr/export_numpy.py
@@ -1,4 +1,5 @@
"""Code for exporting discovered expressions to numpy"""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions pysr/export_sympy.py
@@ -1,4 +1,5 @@
"""Define utilities to export to sympy"""

from typing import Callable, Dict, List, Optional

import sympy
Expand Down
1 change: 1 addition & 0 deletions pysr/feature_selection.py
@@ -1,4 +1,5 @@
"""Functions for doing feature selection during preprocessing."""

import numpy as np


Expand Down
1 change: 1 addition & 0 deletions pysr/julia_helpers.py
@@ -1,4 +1,5 @@
"""Functions for initializing the Julia environment and installing deps."""

import os
import subprocess
import sys
Expand Down
3 changes: 1 addition & 2 deletions pysr/sklearn_monkeypatch.py
Expand Up @@ -3,8 +3,7 @@
from sklearn.utils import validation


def _ensure_no_complex_data(*args, **kwargs):
...
def _ensure_no_complex_data(*args, **kwargs): ...


try:
Expand Down
7 changes: 4 additions & 3 deletions pysr/sr.py
@@ -1,4 +1,5 @@
"""Define the PySRRegressor scikit-learn interface."""

import copy
import os
import pickle as pkl
Expand Down Expand Up @@ -1658,9 +1659,9 @@ def _run(self, X, y, mutated_params, weights, seed):
fraction_replaced_hof=self.fraction_replaced_hof,
should_simplify=self.should_simplify,
should_optimize_constants=self.should_optimize_constants,
warmup_maxsize_by=0.0
if self.warmup_maxsize_by is None
else self.warmup_maxsize_by,
warmup_maxsize_by=(
0.0 if self.warmup_maxsize_by is None else self.warmup_maxsize_by
),
use_frequency=self.use_frequency,
use_frequency_in_tournament=self.use_frequency_in_tournament,
adaptive_parsimony_scaling=self.adaptive_parsimony_scaling,
Expand Down
1 change: 1 addition & 0 deletions pysr/test/__main__.py
@@ -1,4 +1,5 @@
"""CLI for running PySR's test suite."""

import argparse
import os

Expand Down
6 changes: 3 additions & 3 deletions pysr/test/test_env.py
Expand Up @@ -22,9 +22,9 @@ def test_custom_shared_env(self):
os.environ["JULIA_DEPOT_PATH"] = tmpdir
else:
old_env = os.environ["JULIA_DEPOT_PATH"]
os.environ[
"JULIA_DEPOT_PATH"
] = f"{tmpdir}:{os.environ['JULIA_DEPOT_PATH']}"
os.environ["JULIA_DEPOT_PATH"] = (
f"{tmpdir}:{os.environ['JULIA_DEPOT_PATH']}"
)
Main.eval(
f'pushfirst!(DEPOT_PATH, "{julia_helpers._escape_filename(tmpdir)}")'
)
Expand Down

0 comments on commit dcef8e7

Please sign in to comment.