Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Cleanup with asv_runner #1287

Merged
merged 12 commits into from
Jul 6, 2023
1,329 changes: 16 additions & 1,313 deletions asv/benchmark.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion asv/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import sys
import abc

from .. import config, util
from asv import config, util

from . import common_args

# This list is ordered in order of average workflow
Expand Down
8 changes: 5 additions & 3 deletions asv/commands/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
import math

import tabulate
from asv_runner.console import color_print
from asv_runner.statistics import get_err

from . import Command, common_args
from ..benchmarks import Benchmarks
from ..machine import iter_machine_files
from ..results import iter_results_for_machine_and_hash
from ..repo import get_repo, NoSuchNameError
from ..util import human_value, load_json
from ..console import log, color_print
from ..console import log
from ..environment import get_environments
from .. import util, statistics

Expand Down Expand Up @@ -265,12 +267,12 @@ def results_default_iter(commit_hash):
time_2 = math.nan

if benchmark in ss_1 and ss_1[benchmark][0]:
err_1 = statistics.get_err(time_1, ss_1[benchmark][0])
err_1 = get_err(time_1, ss_1[benchmark][0])
else:
err_1 = None

if benchmark in ss_2 and ss_2[benchmark][0]:
err_2 = statistics.get_err(time_2, ss_2[benchmark][0])
err_2 = get_err(time_2, ss_2[benchmark][0])
else:
err_2 = None

Expand Down
4 changes: 3 additions & 1 deletion asv/commands/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import os
import argparse

from asv_runner.console import color_print

from . import Command, common_args
from .run import Run
from .compare import Compare
from ..repo import get_repo, NoSuchNameError
from ..console import color_print, log
from ..console import log
from .. import results, util


Expand Down
4 changes: 3 additions & 1 deletion asv/commands/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import sys
import tempfile

from asv_runner.console import color_print

from . import Command, common_args
from ..benchmarks import Benchmarks
from ..console import log, color_print
from ..console import log
from ..environment import get_environments, is_existing_only
from ..machine import Machine
from ..profiling import ProfilerGui
Expand Down
4 changes: 3 additions & 1 deletion asv/commands/quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import os
import shutil

from asv_runner.console import color_print

from . import Command
from ..console import log, color_print
from ..console import log


class Quickstart(Command):
Expand Down
5 changes: 3 additions & 2 deletions asv/commands/rm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import sys
from fnmatch import fnmatchcase

from asv_runner.console import get_answer_default

from . import Command, util
from .. import console
from ..console import log
from ..results import iter_results

Expand Down Expand Up @@ -92,7 +93,7 @@ def run(cls, conf, patterns, y=True):
log.info(f"Removing {len(files_to_remove)} files")

if not y:
do = console.get_answer_default("Perform operations", "n")
do = get_answer_default("Perform operations", "n")
if len(do) and do.lower()[0] != 'y':
sys.exit(0)

Expand Down
4 changes: 3 additions & 1 deletion asv/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import math
from collections import defaultdict

from asv_runner.console import color_print

from . import Command, common_args
from ..benchmarks import Benchmarks
from ..machine import iter_machine_files
from ..results import iter_results_for_machine, iter_results_for_machine_and_hash
from ..runner import format_benchmark_result
from ..repo import get_repo, NoSuchNameError
from ..util import load_json
from ..console import log, color_print
from ..console import log
from ..environment import get_environments
from .. import util

Expand Down
Loading