Skip to content

Commit

Permalink
isort pass
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Aug 20, 2021
1 parent 80ff3c6 commit cffb163
Show file tree
Hide file tree
Showing 64 changed files with 56 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile = black
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ repository, and the results are hosted on the
(conbench) $ git add foo.py


### Sort imports (before committing)
(conbench) $ cd ~/workspace/conbench/
(conbench) $ isort .
Fixing foo.py
(conbench) $ git add foo.py


### Lint code (before committing)
(qa) $ cd ~/workspace/conbench/
(qa) $ flake8
Expand Down
1 change: 0 additions & 1 deletion conbench/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flask as f


api = f.Blueprint("api", __name__)
rule = api.add_url_rule

Expand Down
1 change: 0 additions & 1 deletion conbench/api/_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from ..api import _examples as ex
from ..config import Config


spec = apispec.APISpec(
title=Config.APPLICATION_NAME,
version="1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion conbench/api/_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os

import flask as f
import flask_login
import flask.views
import flask_login


def as_bool(x):
Expand Down
3 changes: 2 additions & 1 deletion conbench/api/_google.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import flask as f
import json
import os

import flask as f
import requests


Expand Down
4 changes: 1 addition & 3 deletions conbench/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import flask_login
import marshmallow


from ..api import _google
from ..api import rule
from ..api import _google, rule
from ..api._docs import spec
from ..api._endpoint import ApiEndpoint
from ..api.users import User
Expand Down
1 change: 0 additions & 1 deletion conbench/api/benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import flask as f
import flask_login


from ..api import rule
from ..api._docs import spec
from ..api._endpoint import ApiEndpoint, maybe_login_required
Expand Down
1 change: 0 additions & 1 deletion conbench/api/compare.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flask as f


from ..api import rule
from ..api._endpoint import ApiEndpoint, maybe_login_required
from ..entities._comparator import BenchmarkComparator, BenchmarkListComparator
Expand Down
2 changes: 1 addition & 1 deletion conbench/api/history.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..api import rule
from ..api._endpoint import ApiEndpoint, maybe_login_required
from ..entities._entity import NotFound
from ..entities.history import get_history, HistorySerializer
from ..entities.history import HistorySerializer, get_history
from ..entities.summary import Summary


Expand Down
1 change: 0 additions & 1 deletion conbench/api/users.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import flask_login
import marshmallow


from ..api import rule
from ..api._docs import spec
from ..api._endpoint import ApiEndpoint
Expand Down
3 changes: 1 addition & 2 deletions conbench/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import flask as f


app = f.Blueprint("app", __name__)
rule = app.add_url_rule


from .index import * # noqa
from .auth import * # noqa
from .batches import * # noqa
from .benchmarks import * # noqa
from .compare import * # noqa
from .index import * # noqa
from .runs import * # noqa
from .users import * # noqa
2 changes: 1 addition & 1 deletion conbench/app/_plots.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dateutil
import json

import bokeh.plotting
import dateutil

from ..hacks import sorted_data

Expand Down
4 changes: 2 additions & 2 deletions conbench/app/compare.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import copy
import flask as f
import json

import bokeh
import flask as f

from ..app import rule
from ..app._endpoint import AppEndpoint
from ..app._plots import simple_bar_plot, TimeSeriesPlotMixin
from ..app._plots import TimeSeriesPlotMixin, simple_bar_plot
from ..app.benchmarks import BenchmarkMixin, RunMixin
from ..config import Config

Expand Down
3 changes: 1 addition & 2 deletions conbench/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import click

from .runner import REGISTRY, LIST
from .runner import LIST, REGISTRY
from .util import register_benchmarks


register_benchmarks()
BENCHMARKS = {}
for benchmark in REGISTRY:
Expand Down
3 changes: 1 addition & 2 deletions conbench/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import getpass

import os

APPLICATION_NAME = "Conbench"

Expand Down
4 changes: 1 addition & 3 deletions conbench/db.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker

from sqlalchemy.orm import scoped_session, sessionmaker

engine = None
session_maker = sessionmaker(future=True)
Expand Down
1 change: 0 additions & 1 deletion conbench/entities/_comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from ..units import formatter_for_unit


CHANGE = 5.0 # percent changed threshold
Z_SCORE = 5.0 # z-score threshold

Expand Down
1 change: 0 additions & 1 deletion conbench/entities/_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ..db import Session


Base = declarative_base()
NotNull = functools.partial(Column, nullable=False)
Nullable = functools.partial(Column, nullable=True)
Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/case.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sqlalchemy as s
from sqlalchemy.dialects import postgresql

from ..entities._entity import Base, EntityMixin, generate_uuid, NotNull
from ..entities._entity import Base, EntityMixin, NotNull, generate_uuid


class Case(Base, EntityMixin):
Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
Base,
EntityMixin,
EntitySerializer,
generate_uuid,
NotNull,
Nullable,
generate_uuid,
)


Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Base,
EntityMixin,
EntitySerializer,
generate_uuid,
NotNull,
generate_uuid,
)


Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sqlalchemy as s
from sqlalchemy import CheckConstraint as check

from ..entities._entity import Base, EntityMixin, generate_uuid, NotNull
from ..entities._entity import Base, EntityMixin, NotNull, generate_uuid


class Data(Base, EntityMixin):
Expand Down
10 changes: 2 additions & 8 deletions conbench/entities/distribution.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import sqlalchemy as s
from sqlalchemy import func
from sqlalchemy import CheckConstraint as check
from sqlalchemy import func
from sqlalchemy.dialects.postgresql import insert

from ..db import Session
from ..entities._entity import (
Base,
EntityMixin,
generate_uuid,
NotNull,
Nullable,
)
from ..entities._comparator import _less_is_better
from ..entities._entity import Base, EntityMixin, NotNull, Nullable, generate_uuid
from ..entities.commit import Commit
from ..entities.machine import Machine
from ..entities.run import Run
Expand Down
4 changes: 2 additions & 2 deletions conbench/entities/machine.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import flask as f
import marshmallow
import sqlalchemy as s
from sqlalchemy import func
from sqlalchemy import CheckConstraint as check
from sqlalchemy import func
from sqlalchemy.ext.hybrid import hybrid_property

from ..entities._entity import (
Base,
EntityMixin,
EntitySerializer,
generate_uuid,
NotNull,
generate_uuid,
)


Expand Down
6 changes: 3 additions & 3 deletions conbench/entities/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
from sqlalchemy import CheckConstraint as check
from sqlalchemy.orm import relationship

from ..entities._comparator import z_improvement, z_regression
from ..entities._entity import (
Base,
EntityMixin,
EntitySerializer,
generate_uuid,
NotNull,
Nullable,
generate_uuid,
)
from ..entities._comparator import z_improvement, z_regression
from ..entities.case import Case
from ..entities.context import Context
from ..entities.commit import Commit, get_github_commit, repository_to_url
from ..entities.context import Context
from ..entities.data import Data
from ..entities.distribution import update_distribution
from ..entities.machine import Machine, MachineSchema
Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/time.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sqlalchemy as s
from sqlalchemy import CheckConstraint as check

from ..entities._entity import Base, EntityMixin, generate_uuid, NotNull
from ..entities._entity import Base, EntityMixin, NotNull, generate_uuid


class Time(Base, EntityMixin):
Expand Down
2 changes: 1 addition & 1 deletion conbench/entities/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Base,
EntityMixin,
EntitySerializer,
generate_uuid,
NotNull,
generate_uuid,
)
from ..extensions import login_manager

Expand Down
1 change: 0 additions & 1 deletion conbench/extensions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flask_bootstrap
import flask_login


login_manager = flask_login.LoginManager()
bootstrap = flask_bootstrap.Bootstrap()
1 change: 0 additions & 1 deletion conbench/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from .machine_info import github_info, machine_info, python_info, r_info
from .util import Connection


REGISTRY = []
LIST = []

Expand Down
1 change: 0 additions & 1 deletion conbench/tests/api/_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from ...entities.summary import Summary
from ...runner import Conbench


CHILD = "02addad336ba19a654f9c857ede546331be7b631"
PARENT = "4beb514d071c9beec69b8917b5265e77ade22fb3"
GRANDPARENT = "6d703c4c7b15be630af48d5e9ef61628751674b2"
Expand Down
4 changes: 1 addition & 3 deletions conbench/tests/api/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
from ...entities._entity import NotFound
from ...entities.distribution import Distribution
from ...entities.summary import Summary
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures
from ...tests.helpers import _uuid


ARROW_REPO = "https://github.com/apache/arrow"
CONBENCH_REPO = "https://github.com/ursacomputing/conbench"

Expand Down
3 changes: 1 addition & 2 deletions conbench/tests/api/test_commits.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from ...api._examples import _api_commit_entity
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures


def _expected_entity(commit):
Expand Down
4 changes: 1 addition & 3 deletions conbench/tests/api/test_compare.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from ...api._examples import _api_compare_entity, _api_compare_list
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures
from ...tests.helpers import _uuid


CASE = "snappy, cpu_count=2, parquet, arrow, nyctaxi_sample"


Expand Down
3 changes: 1 addition & 2 deletions conbench/tests/api/test_contexts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from ...api._examples import _api_context_entity
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures


def _expected_entity(context):
Expand Down
1 change: 0 additions & 1 deletion conbench/tests/api/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ...tests.api import _asserts


this_dir = os.path.abspath(os.path.dirname(__file__))


Expand Down
3 changes: 1 addition & 2 deletions conbench/tests/api/test_history.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from ...api._examples import _api_history_entity
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures


def _expected_entity(summary):
Expand Down
3 changes: 1 addition & 2 deletions conbench/tests/api/test_machines.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from ...api._examples import _api_machine_entity
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures


def _expected_entity(machine):
Expand Down
3 changes: 1 addition & 2 deletions conbench/tests/api/test_runs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import urllib

from ...api._examples import _api_run_entity
from ...tests.api import _asserts
from ...tests.api import _fixtures
from ...tests.api import _asserts, _fixtures
from ...tests.helpers import _uuid


Expand Down

0 comments on commit cffb163

Please sign in to comment.