Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/lint_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ name: Lint

on:
workflow_call:
inputs:
linter:
type: string
description: Linter to use for the benchmarks. For now only supports flake8 and ruff.
default: flake8

jobs:
linter-flake8:
linter:
runs-on: ubuntu-latest

# Cancel in-progress workflows when pushing
Expand All @@ -20,7 +25,11 @@ jobs:
with:
python-version: 3.8

- name: Lint with flake8
- name: Lint with ${{ inputs.linter }}
run: |
pip install flake8
flake8 .
pip install ${{ inputs.linter }}
if [ "${{ inputs.linter }}" = "ruff" ]; then
ruff check .
else
flake8 .
fi
4 changes: 2 additions & 2 deletions .github/workflows/test_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
type: string
python_version:
description: Python version to use for the tests.
default: "3.10"
default: "3.12"
required: false
type: string
extra_args:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
then
user=${BENCHOPT_BRANCH%@*}
branch=${BENCHOPT_BRANCH##*@}
pip install -U git+https://github.com/$user/benchopt@$branch
pip install -U "benchopt @ git+https://github.com/$user/benchopt@$branch"
elif [[ "$BENCHOPT_VERSION" == "latest" ]]
then
pip install -U benchopt
Expand Down
11 changes: 9 additions & 2 deletions datasets/simulated.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Dataset(BaseDataset):
(1000, 500),
(5000, 200),
],
'random_state': [27],
}

# List of packages needed to run the dataset. See the corresponding
Expand All @@ -29,8 +28,16 @@ def get_data(self):
# to `Objective.set_data`. This defines the benchmark's
# API to pass data. It is customizable for each benchmark.

# Get a random seed to generate the data. The seed is generated from
# the `get_seed` method, which ensures that the same seed is used
# across different runs of the benchmark, and different solvers.
# The use of `use_repetition=True` ensures that the seed changes across
# different repetitions of the benchmark, which can be useful to
# generate different data for each repetition.
seed = self.get_seed(use_repetition=True)

# Generate pseudorandom data using `numpy`.
rng = np.random.RandomState(self.random_state)
rng = np.random.RandomState(seed)
X = rng.randn(self.n_samples, self.n_features)
y = rng.randn(self.n_samples)

Expand Down
Loading