Commit 4c771e17 authored by Samuel GAIST's avatar Samuel GAIST

[core] Pre-commit cleanup

parent 967387e1
Pipeline #41778 passed with stage
in 17 minutes and 51 seconds
......@@ -45,22 +45,21 @@ Forward importing from :py:mod:`beat.backend.python.algorithm`
:py:class:`beat.backend.python.algorithm.Storage`
:py:class:`beat.backend.python.algorithm.Runner`
"""
import os
import six
import numpy
import pkg_resources
import simplejson as json
import six
from beat.backend.python.algorithm import Algorithm as BackendAlgorithm
from beat.backend.python.algorithm import Runner # noqa
from beat.backend.python.algorithm import Storage
from . import dataformat
from . import library
from . import schema
from . import prototypes
from beat.backend.python.algorithm import Storage
from beat.backend.python.algorithm import Runner # noqa
from beat.backend.python.algorithm import Algorithm as BackendAlgorithm
from . import schema
def load_algorithm_prototype(prefix):
......
......@@ -53,16 +53,15 @@ Forward importing from :py:mod:`beat.backend.python.data`:
:py:func:`beat.backend.python.data.load_data_index_db`
:py:func:`beat.backend.python.data.foundSplitRanges`
"""
from beat.backend.python.data import mixDataIndices # noqa
from beat.backend.python.data import getAllFilenames # noqa
from beat.backend.python.data import DataSource # noqa
from beat.backend.python.data import CachedDataSink # noqa
from beat.backend.python.data import CachedDataSource # noqa
from beat.backend.python.data import DatabaseOutputDataSource # noqa
from beat.backend.python.data import RemoteDataSource # noqa
from beat.backend.python.data import DataSink # noqa
from beat.backend.python.data import CachedDataSink # noqa
from beat.backend.python.data import DataSource # noqa
from beat.backend.python.data import RemoteDataSource # noqa
from beat.backend.python.data import StdoutDataSink # noqa
from beat.backend.python.data import foundSplitRanges # noqa
from beat.backend.python.data import getAllFilenames # noqa
from beat.backend.python.data import load_data_index # noqa
from beat.backend.python.data import load_data_index_db # noqa
from beat.backend.python.data import foundSplitRanges # noqa
from beat.backend.python.data import mixDataIndices # noqa
......@@ -44,8 +44,6 @@ Forward importing from :py:mod:`beat.backend.python.data_loaders`
:py:class:`beat.backend.python.data_loaders.DataLoader`
:py:class:`beat.backend.python.data_loaders.DataView`
"""
from beat.backend.python.data_loaders import DataLoaderList # noqa
from beat.backend.python.data_loaders import DataLoader # noqa
from beat.backend.python.data_loaders import DataLoaderList # noqa
from beat.backend.python.data_loaders import DataView # noqa
......@@ -44,22 +44,19 @@ Validation of databases
Forward importing from :py:mod:`beat.backend.python.database`:
:py:class:`beat.backend.python.database.Storage`
"""
import os
import six
from . import schema
from beat.backend.python.database import Database as BackendDatabase
from beat.backend.python.database import Storage
from beat.backend.python.protocoltemplate import Storage as PTStorage
from . import prototypes
from . import schema
from .dataformat import DataFormat
from .protocoltemplate import ProtocolTemplate
from . import prototypes
from beat.backend.python.database import Storage
from beat.backend.python.database import Database as BackendDatabase
from beat.backend.python.protocoltemplate import Storage as PTStorage
def get_first_procotol_template(prefix):
pt_root_folder = os.path.join(prefix, PTStorage.asset_folder)
......
......@@ -44,17 +44,17 @@ Validation and parsing for dataformats
Forward importing from :py:mod:`beat.backend.python.dataformat`:
:py:class:`beat.backend.python.dataformat.Storage`
"""
import copy
import six
from . import schema
from beat.backend.python.dataformat import DataFormat as BackendDataFormat
from beat.backend.python.dataformat import Storage # noqa
from . import prototypes
from . import schema
from . import utils
from beat.backend.python.dataformat import Storage # noqa
from beat.backend.python.dataformat import DataFormat as BackendDataFormat
class DataFormat(BackendDataFormat):
"""Data formats define the chunks of data that circulate between blocks.
......
......@@ -41,18 +41,16 @@ dock
Docker helper classes
"""
import ast
import logging
import os
import simplejson as json
import socket
import subprocess as sp # nosec
import tempfile
import time
import docker
import subprocess as sp # nosec
import logging
import docker
import simplejson as json
from packaging import version
from beat.core import stats
......
......@@ -41,10 +41,8 @@ environment
Helper functions related to environment management
"""
import re
import logging
import re
logger = logging.getLogger(__name__)
......
......@@ -41,21 +41,19 @@ base
Execution utilities
"""
import os
import glob
import collections
import glob
import logging
import simplejson as json
import os
from .. import schema
from .. import database
from .. import algorithm
from .. import stats
import simplejson as json
from beat.backend.python.helpers import convert_experiment_configuration_to_container
from .. import algorithm
from .. import database
from .. import schema
from .. import stats
logger = logging.getLogger(__name__)
......
......@@ -41,24 +41,21 @@ docker
Execution utilities
"""
import logging
import os
import shutil
import logging
from collections import namedtuple
import requests
import simplejson as json
from collections import namedtuple
from beat.backend.python.execution import MessageHandler
from beat.backend.python.data import getAllFilenames
from beat.backend.python.execution import MessageHandler
from .. import stats
from .. import utils
from .remote import RemoteExecutor
logger = logging.getLogger(__name__)
......
......@@ -41,20 +41,19 @@ local
Execution utilities
"""
import logging
import os
import shutil
import sys
import tempfile
import shutil
import zmq
import time
import logging
import zmq
from beat.backend.python.execution import AlgorithmExecutor
from beat.backend.python.execution import MessageHandler
from beat.backend.python.execution import LoopExecutor
from beat.backend.python.execution import LoopMessageHandler
from beat.backend.python.execution import MessageHandler
from .base import BaseExecutor
......
......@@ -41,12 +41,11 @@ remote
Execution utilities
"""
from .base import BaseExecutor
from beat.backend.python.helpers import create_inputs_from_configuration
from beat.backend.python.helpers import create_outputs_from_configuration
from .base import BaseExecutor
class RemoteExecutor(BaseExecutor):
"""Base class for Executors that communicate with a message handler
......
......@@ -40,22 +40,19 @@ subprocess
Execution utilities
"""
import logging
import os
import shutil
import logging
import sys
import subprocess as sp # nosec
import sys
import tempfile
from beat.backend.python.execution import MessageHandler
from .. import stats
from .. import utils
from .remote import RemoteExecutor
logger = logging.getLogger(__name__)
......
......@@ -41,19 +41,18 @@ experiment
Validation for experiments
"""
import os
import collections
import itertools
import os
import simplejson as json
from . import utils
from . import algorithm
from . import schema
from . import database
from . import toolchain
from . import hash
from . import schema
from . import toolchain
from . import utils
EVALUATOR_PREFIX = "evaluator_"
PROCESSOR_PREFIX = "processor_"
......@@ -84,9 +83,13 @@ class Storage(utils.Storage):
if len(s) == 4:
name = os.path.join(s[0], name)
self.username, self.toolchain_username, self.toolchain, self.version, self.name = name.split(
os.sep
)
(
self.username,
self.toolchain_username,
self.toolchain,
self.version,
self.name,
) = name.split(os.sep)
self.label = name
self.toolchain = os.path.join(
......
......@@ -43,16 +43,14 @@ Various functions for hashing platform contributions and others
Also forward importing from :py:mod:`beat.backend.python.hash`
"""
import collections
import simplejson as json
from beat.backend.python.hash import * # noqa
from beat.backend.python.hash import _compact
from beat.backend.python.hash import _sha256 # noqa
from beat.backend.python.hash import _stringify
from beat.backend.python.hash import _compact
# ----------------------------------------------------------
......
......@@ -45,8 +45,6 @@ Forward imported from :py:mod:`beat.backend.python.inputs`:
:py:class:`beat.backend.python.inputs.Input`
:py:class:`beat.backend.python.inputs.InputGroup`
"""
from beat.backend.python.inputs import InputList # noqa
from beat.backend.python.inputs import Input # noqa
from beat.backend.python.inputs import InputGroup # noqa
from beat.backend.python.inputs import InputList # noqa
......@@ -44,14 +44,13 @@ Validation for libraries
Forward imported from :py:mod:`beat.backend.python.library`:
:py:class:`beat.backend.python.library.Storage`
"""
import six
from . import schema
from . import prototypes
from beat.backend.python.library import Storage
from beat.backend.python.library import Library as BackendLibrary
from beat.backend.python.library import Storage
from . import prototypes
from . import schema
class Library(BackendLibrary):
......
......@@ -44,8 +44,6 @@ Forward imported from :py:mod:`beat.backend.python.outputs`:
:py:class:`beat.backend.python.outputs.Output`
:py:class:`beat.backend.python.outputs.OutputList`
"""
from beat.backend.python.outputs import SynchronizationListener # noqa
from beat.backend.python.outputs import Output # noqa
from beat.backend.python.outputs import OutputList # noqa
from beat.backend.python.outputs import SynchronizationListener # noqa
......@@ -41,18 +41,17 @@ plotter
Validation for plotters
"""
import os
import six
import sys
from . import dataformat
import six
from . import algorithm
from . import schema
from . import dataformat
from . import loader
from . import prototypes
from . import schema
from . import utils
from . import loader
# ----------------------------------------------------------
......
......@@ -41,13 +41,12 @@ plotterparameter
Validation for plotterparameters
"""
import simplejson as json
from . import schema
from . import plotter
from . import prototypes
from . import schema
from . import utils
from . import plotter
class Storage(utils.Storage):
......
......@@ -44,16 +44,15 @@ Validation of protocoltemplate
Forward importing from :py:mod:`beat.backend.python.protocoltemplate`:
:py:class:`beat.backend.python.protocoltemplate.Storage`
"""
import six
from . import schema
from . import prototypes
from beat.backend.python.protocoltemplate import Storage
from beat.backend.python.protocoltemplate import (
ProtocolTemplate as BackendProtocolTemplate,
)
from beat.backend.python.protocoltemplate import Storage
from . import prototypes
from . import schema
class ProtocolTemplate(BackendProtocolTemplate):
......
import numpy
from collections import namedtuple
import numpy
from beat.backend.python.database import View
......
import time
import numpy as np
import pkg_resources
import zmq
from ..agent import MessageHandler
from ..dataformat import DataFormat
from ..data import DataSource
from ..inputs import RemoteInput
from ..dataformat import DataFormat
from ..inputs import Input
from ..inputs import InputGroup
from ..inputs import InputList
import numpy as np
import pkg_resources
import time
import zmq
from ..inputs import RemoteInput
prefix = pkg_resources.resource_filename(__name__, "../test/prefix")
print(prefix)
......
......@@ -48,18 +48,18 @@ Options:
-v, --verbose Increases the output verbosity level
-p, --prefix=<path> Path where the prefix is contained [default: .]
"""
import copy
import os
import sys
import copy
from docopt import docopt
from ..version import __version__
from ..database import Database, Storage as DBStorage
from ..protocoltemplate import ProtocolTemplate, Storage as PTStorage
from ..database import Database
from ..database import Storage as DBStorage
from ..protocoltemplate import ProtocolTemplate
from ..protocoltemplate import Storage as PTStorage
from ..utils import setup_logging
from ..version import __version__
def main(argv=None):
......
......@@ -56,15 +56,15 @@ Options:
--port-range=<range> Range of port usable for communication with containers
"""
import os
import sys
import logging
import zmq
import multiprocessing
import os
import signal
import sys
import simplejson as json
import multiprocessing
import six
import zmq
try:
import Queue
......@@ -72,15 +72,16 @@ except ImportError:
import queue as Queue
import tempfile
from docopt import docopt
from socket import gethostname
from ..version import __version__
from ..execution.local import LocalExecutor
from ..execution.docker import DockerExecutor
from docopt import docopt
from ..dock import Host
from ..worker import WorkerController
from ..execution.docker import DockerExecutor
from ..execution.local import LocalExecutor
from ..utils import send_multipart
from ..version import __version__
from ..worker import WorkerController
stop = False
logger = None
......
......@@ -45,19 +45,17 @@ Forward impored from :py:mod:`beat.backend.python.stats`:
:py:func:`beat.backend.python.stats.io_statistics`
:py:func:`beat.backend.python.stats.update`
"""
import os
import copy
import os
import simplejson as json
from . import schema
from . import prototypes
from beat.backend.python.stats import io_statistics # noqa
from beat.backend.python.stats import update # noqa
from . import prototypes
from . import schema
class Statistics(object):
"""Statistics define resource usage for algorithmic code runs
......
......@@ -41,13 +41,12 @@ toolchain
Validation for toolchains
"""
import collections
import simplejson as json
from . import schema
from . import prototypes
from . import schema
from . import utils
......@@ -521,9 +520,11 @@ class Toolchain(object):
title = title or "Toolchain: %s" % self.name
channel_colors = self.data["representation"]["channel_colors"]
from .drawing import make_label as make_drawing_label, make_layout_label
from graphviz import Digraph
from .drawing import make_label as make_drawing_label
from .drawing import make_layout_label
fontname = "Helvetica"
fontsize = "12"
......
......@@ -43,18 +43,17 @@ Helper methods
Forward imports from :py:mod:`beat.backend.python.utils`
"""
import six
import sys
import tempfile
import socket
import contextlib
import string
import random
import logging
import random
import socket
import string
import sys
import tempfile
from beat.backend.python.utils import * # noqa: F401, F403
import six
from beat.backend.python.utils import * # noqa: F401, F403
# ----------------------------------------------------------
......
......@@ -41,12 +41,11 @@ worker
Worker implementation
"""
import logging
import zmq
import socket
import simplejson as json
import zmq
from .utils import send_multipart
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment