after running isort

Change-Id: I6d7dbb8dee9480fc9242529089a1b40f17f068e7
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25052
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
zolliker 2021-02-24 09:21:08 +01:00
parent 1a8ddbc696
commit bb6f692c6b
51 changed files with 197 additions and 168 deletions

View File

@ -22,21 +22,22 @@
# *****************************************************************************
"""general SECoP client"""
import time
import queue
import json
from threading import Event, RLock, current_thread
import queue
import time
from collections import defaultdict
from threading import Event, RLock, current_thread
from secop.lib import mkthread, formatExtendedTraceback, formatExtendedStack
from secop.lib.asynconn import AsynConn, ConnectionClosed
from secop.datatypes import get_datatype
from secop.protocol.interface import encode_msg_frame, decode_msg
from secop.protocol.messages import REQUEST2REPLY, ERRORPREFIX, EVENTREPLY, WRITEREQUEST, WRITEREPLY, \
READREQUEST, READREPLY, IDENTREQUEST, IDENTPREFIX, ENABLEEVENTSREQUEST, COMMANDREQUEST, \
DESCRIPTIONREQUEST, HEARTBEATREQUEST
import secop.errors
import secop.params
from secop.datatypes import get_datatype
from secop.lib import formatExtendedStack, formatExtendedTraceback, mkthread
from secop.lib.asynconn import AsynConn, ConnectionClosed
from secop.protocol.interface import decode_msg, encode_msg_frame
from secop.protocol.messages import COMMANDREQUEST, \
DESCRIPTIONREQUEST, ENABLEEVENTSREQUEST, ERRORPREFIX, \
EVENTREPLY, HEARTBEATREQUEST, IDENTPREFIX, IDENTREQUEST, \
READREPLY, READREQUEST, REQUEST2REPLY, WRITEREPLY, WRITEREQUEST
# replies to be handled for cache
UPDATE_MESSAGES = {EVENTREPLY, READREPLY, WRITEREPLY, ERRORPREFIX + READREQUEST, ERRORPREFIX + EVENTREPLY}

View File

@ -30,11 +30,6 @@ import time
from collections import OrderedDict
from select import select
try:
import mlzlog
except ImportError:
pass
import serial
from secop.datatypes import CommandType, EnumType, get_datatype
@ -47,6 +42,13 @@ from secop.protocol.messages import BUFFERREQUEST, COMMANDREQUEST, \
HEARTBEATREQUEST, HELPREQUEST, IDENTREQUEST, READREPLY, \
READREQUEST, REQUEST2REPLY, WRITEREPLY, WRITEREQUEST
try:
import mlzlog
except ImportError:
pass
class TCPConnection:
# disguise a TCP connection as serial one

View File

@ -25,18 +25,18 @@
import code
import configparser
import socket
import threading
from collections import deque
from os import path
import configparser
import mlzlog
from secop.protocol.interface import decode_msg, encode_msg_frame, get_msg
from secop.protocol.messages import EVENTREPLY
class NameSpace(dict):
def __init__(self):

View File

@ -26,13 +26,14 @@
# allow to import the most important classes from 'secop'
# pylint: disable=unused-import
from secop.datatypes import FloatRange, IntRange, ScaledInteger, \
BoolType, EnumType, BLOBType, StringType, TupleOf, ArrayOf, StructOf
from secop.lib.enum import Enum
from secop.modules import Module, Readable, Writable, Drivable, Communicator, Attached, Done
from secop.properties import Property
from secop.params import Parameter, Command
from secop.poller import AUTO, REGULAR, SLOW, DYNAMIC
from secop.datatypes import ArrayOf, BLOBType, BoolType, EnumType, \
FloatRange, IntRange, ScaledInteger, StringType, StructOf, TupleOf
from secop.iohandler import IOHandler, IOHandlerBase
from secop.stringio import StringIO, HasIodev
from secop.proxy import SecNode, Proxy, proxy_class
from secop.lib.enum import Enum
from secop.modules import Attached, Communicator, \
Done, Drivable, Module, Readable, Writable
from secop.params import Command, Parameter
from secop.poller import AUTO, DYNAMIC, REGULAR, SLOW
from secop.properties import Property
from secop.proxy import Proxy, SecNode, proxy_class
from secop.stringio import HasIodev, StringIO

View File

@ -28,13 +28,13 @@
import sys
from base64 import b64decode, b64encode
from secop.errors import ProgrammingError, ProtocolError, BadValueError, ConfigError
from secop.errors import BadValueError, \
ConfigError, ProgrammingError, ProtocolError
from secop.lib import clamp
from secop.lib.enum import Enum
from secop.parse import Parser
from secop.properties import HasProperties, Property
# Only export these classes for 'from secop.datatypes import *'
__all__ = [
'DataType', 'get_datatype',

View File

@ -24,7 +24,7 @@
from secop.datatypes import ArrayOf, BoolType, EnumType, \
FloatRange, StringType, StructOf, TupleOf
from secop.modules import Command, Parameter, HasAccessibles
from secop.modules import Command, HasAccessibles, Parameter
class Feature(HasAccessibles):

View File

@ -21,13 +21,13 @@
# *****************************************************************************
import configparser
from configparser import NoOptionError
from collections import OrderedDict
from secop.gui.cfg_editor.tree_widget_item import TreeWidgetItem
from secop.gui.cfg_editor.utils import get_all_items, get_params, get_props,\
get_all_children_with_names, get_module_class_from_name, \
get_interface_class_from_name
from configparser import NoOptionError
from secop.gui.cfg_editor.tree_widget_item import TreeWidgetItem
from secop.gui.cfg_editor.utils import get_all_children_with_names, \
get_all_items, get_interface_class_from_name, \
get_module_class_from_name, get_params, get_props
NODE = 'node'
INTERFACE = 'interface'

View File

@ -21,11 +21,11 @@
# *****************************************************************************
import os
from secop.gui.qt import QMainWindow, QMessageBox
from secop.gui.cfg_editor.node_display import NodeDisplay
from secop.gui.cfg_editor.utils import loadUi, get_file_paths
from secop.gui.cfg_editor.widgets import TabBar
from secop.gui.cfg_editor.node_display import NodeDisplay
from secop.gui.cfg_editor.utils import get_file_paths, loadUi
from secop.gui.cfg_editor.widgets import TabBar
from secop.gui.qt import QMainWindow, QMessageBox
# TODO move secop mainwinodw to gui/client and all specific stuff
NODE = 'node'

View File

@ -20,8 +20,8 @@
#
# *****************************************************************************
from secop.gui.qt import QWidget, Qt, QHBoxLayout, QSpacerItem, QSizePolicy
from secop.gui.cfg_editor.utils import loadUi
from secop.gui.qt import QHBoxLayout, QSizePolicy, QSpacerItem, Qt, QWidget
class NodeDisplay(QWidget):

View File

@ -20,10 +20,11 @@
#
# *****************************************************************************
from secop.gui.qt import QTreeWidgetItem, QFont, QWidget, QVBoxLayout, QLabel, \
QHBoxLayout, QPushButton, QSize, QSizePolicy, QDialog, QTextEdit, pyqtSignal
from secop.gui.cfg_editor.utils import setTreeIcon, setIcon, loadUi, \
set_name_edit_style
from secop.gui.cfg_editor.utils import loadUi, \
set_name_edit_style, setIcon, setTreeIcon
from secop.gui.qt import QDialog, QFont, QHBoxLayout, \
QLabel, QPushButton, QSize, QSizePolicy, QTextEdit, \
QTreeWidgetItem, QVBoxLayout, QWidget, pyqtSignal
from secop.gui.valuewidgets import get_widget
from secop.properties import Property

View File

@ -20,15 +20,16 @@
#
# *****************************************************************************
from os import path, listdir
import sys
import inspect
from secop.gui.qt import uic, QIcon, QSize, QFileDialog, QDialogButtonBox
from secop.server import getGeneralConfig
import sys
from os import listdir, path
from secop.gui.qt import QDialogButtonBox, QFileDialog, QIcon, QSize, uic
from secop.modules import Module
from secop.params import Parameter
from secop.properties import Property
from secop.protocol.interface.tcp import TCPServer
from secop.server import getGeneralConfig
uipath = path.dirname(__file__)

View File

@ -23,15 +23,15 @@
import os
from secop.gui.cfg_editor.config_file import write_config, read_config
from secop.gui.cfg_editor.config_file import read_config, write_config
from secop.gui.cfg_editor.tree_widget_item import TreeWidgetItem
from secop.gui.cfg_editor.utils import get_file_paths, get_modules, \
get_interfaces, loadUi, set_name_edit_style, get_module_class_from_name, \
get_all_items, get_interface_class_from_name, get_params, get_props, \
setActionIcon
from secop.gui.qt import QWidget, QDialog, QLabel, QTabBar, Qt, QPoint, QMenu, \
QTreeWidget, QSize, pyqtSignal, QLineEdit, QComboBox, QDialogButtonBox, \
QTextEdit, QTreeView, QStandardItemModel, QStandardItem
from secop.gui.cfg_editor.utils import get_all_items, \
get_file_paths, get_interface_class_from_name, get_interfaces, \
get_module_class_from_name, get_modules, get_params, \
get_props, loadUi, set_name_edit_style, setActionIcon
from secop.gui.qt import QComboBox, QDialog, QDialogButtonBox, QLabel, \
QLineEdit, QMenu, QPoint, QSize, QStandardItem, QStandardItemModel, \
Qt, QTabBar, QTextEdit, QTreeView, QTreeWidget, QWidget, pyqtSignal
NODE = 'node'
MODULE = 'module'

View File

@ -26,9 +26,9 @@ import secop.client
from secop.gui.modulectrl import ModuleCtrl
from secop.gui.nodectrl import NodeCtrl
from secop.gui.paramview import ParameterView
from secop.gui.qt import QInputDialog, QMainWindow, QMessageBox, \
QObject, QTreeWidgetItem, pyqtSignal, pyqtSlot, QBrush, QColor
from secop.gui.util import loadUi, Value
from secop.gui.qt import QBrush, QColor, QInputDialog, QMainWindow, \
QMessageBox, QObject, QTreeWidgetItem, pyqtSignal, pyqtSlot
from secop.gui.util import Value, loadUi
from secop.lib import formatExtendedTraceback
ITEM_TYPE_NODE = QTreeWidgetItem.UserType + 1

View File

@ -25,14 +25,15 @@
import json
import pprint
from time import sleep
import mlzlog
import secop.lib
from secop.datatypes import EnumType, StringType
from secop.errors import SECoPError
from secop.gui.qt import QFont, QFontMetrics, QLabel, \
QMessageBox, QTextCursor, QWidget, pyqtSlot, toHtmlEscaped
from secop.gui.util import loadUi, Value
import secop.lib
from secop.gui.util import Value, loadUi
class NodeCtrl(QWidget):

View File

@ -23,9 +23,9 @@
from secop.datatypes import EnumType, FloatRange, IntRange
from secop.gui.qt import QCheckBox, QLabel, QLineEdit, QMessageBox
from secop.gui.qt import QPushButton as QButton
from secop.gui.qt import QCheckBox, QLabel, QLineEdit, \
QMessageBox, QSizePolicy, Qt, QWidget, pyqtSignal, pyqtSlot
from secop.gui.qt import QSizePolicy, Qt, QWidget, pyqtSignal, pyqtSlot
from secop.gui.util import loadUi
from secop.lib import formatExtendedStack

View File

@ -23,10 +23,10 @@
from secop.datatypes import ArrayOf, BLOBType, BoolType, EnumType, \
FloatRange, IntRange, StringType, StructOf, TupleOf, TextType
from secop.gui.qt import QCheckBox, QComboBox, QDialog, QDoubleSpinBox, \
QFrame, QGridLayout, QGroupBox, QLabel, QLineEdit, QSpinBox, QVBoxLayout, \
QTextEdit
FloatRange, IntRange, StringType, StructOf, TextType, TupleOf
from secop.gui.qt import QCheckBox, QComboBox, QDialog, \
QDoubleSpinBox, QFrame, QGridLayout, QGroupBox, \
QLabel, QLineEdit, QSpinBox, QTextEdit, QVBoxLayout
from secop.gui.util import loadUi
# XXX: implement live validators !!!!

View File

@ -54,8 +54,8 @@ method has to be called explicitly int the write_<parameter> method, if needed.
"""
import re
from secop.modules import Done
from secop.errors import ProgrammingError
from secop.modules import Done
class CmdParser:

View File

@ -21,13 +21,13 @@
# *****************************************************************************
"""Define helpers"""
import importlib
import linecache
import socket
import sys
import threading
import traceback
import importlib
from os import path, environ
from os import environ, path
repodir = path.abspath(path.join(path.dirname(__file__), '..', '..'))

View File

@ -28,16 +28,18 @@ support for asynchronous communication, but may be used also for
synchronous IO (see secop.stringio.StringIO)
"""
import socket
import select
import time
import ast
import select
import socket
import time
from secop.errors import CommunicationFailedError, ConfigError
from secop.lib import closeSocket, parseHostPort, tcpSocket
try:
from serial import Serial
except ImportError:
Serial = None
from secop.lib import parseHostPort, tcpSocket, closeSocket
from secop.errors import ConfigError, CommunicationFailedError
class ConnectionClosed(ConnectionError):

View File

@ -21,7 +21,8 @@
# *****************************************************************************
from textwrap import indent
from secop.modules import Module, HasProperties, Property, Parameter, Command
from secop.modules import Command, HasProperties, Module, Parameter, Property
def indent_description(p):

View File

@ -26,16 +26,15 @@
import sys
import time
from secop.datatypes import EnumType, FloatRange, BoolType, IntRange, \
StringType, TupleOf, get_datatype, ArrayOf, TextType, StatusType
from secop.errors import ConfigError, ProgrammingError, SECoPError, BadValueError,\
SilentError, InternalError, secop_error
from secop.datatypes import ArrayOf, BoolType, EnumType, FloatRange, \
IntRange, StatusType, StringType, TextType, TupleOf, get_datatype
from secop.errors import BadValueError, ConfigError, InternalError, \
ProgrammingError, SECoPError, SilentError, secop_error
from secop.lib import formatException, formatExtendedStack, mkthread
from secop.lib.enum import Enum
from secop.params import PREDEFINED_ACCESSIBLES, Command, Parameter, Accessible
from secop.params import PREDEFINED_ACCESSIBLES, Accessible, Command, Parameter
from secop.poller import BasicPoller, Poller
from secop.properties import HasProperties, Property
from secop.poller import Poller, BasicPoller
Done = object() #: a special return value for a read/write function indicating that the setter is triggered already

View File

@ -25,12 +25,12 @@
import inspect
from secop.datatypes import CommandType, DataType, StringType, BoolType, EnumType, DataTypeType, ValueType, OrType, \
NoneOr, TextType, IntRange, TupleOf, StructOf
from secop.errors import ProgrammingError, BadValueError
from secop.datatypes import BoolType, CommandType, DataType, \
DataTypeType, EnumType, IntRange, NoneOr, OrType, \
StringType, StructOf, TextType, TupleOf, ValueType
from secop.errors import BadValueError, ProgrammingError
from secop.properties import HasProperties, Property
UNSET = object() # an argument not given, not even None

View File

@ -34,10 +34,11 @@ Usage examples:
"""
import time
from threading import Event
from heapq import heapify, heapreplace
from secop.lib import mkthread
from threading import Event
from secop.errors import ProgrammingError
from secop.lib import mkthread
# poll types:
AUTO = 1 #: equivalent to True, converted to REGULAR, SLOW or DYNAMIC

View File

@ -23,10 +23,10 @@
"""Define validated data types."""
import sys
import inspect
import sys
from secop.errors import ConfigError, ProgrammingError, BadValueError
from secop.errors import BadValueError, ConfigError, ProgrammingError
class HasDescriptorMeta(type):

View File

@ -21,12 +21,12 @@
# *****************************************************************************
"""provides tcp interface to the SECoP Server"""
import sys
import socket
import socketserver
import sys
import threading
from secop.datatypes import StringType, BoolType
from secop.datatypes import BoolType, StringType
from secop.errors import SECoPError
from secop.lib import formatException, \
formatExtendedStack, formatExtendedTraceback
@ -35,7 +35,6 @@ from secop.protocol.interface import decode_msg, encode_msg_frame, get_msg
from secop.protocol.messages import ERRORPREFIX, \
HELPREPLY, HELPREQUEST, HelpMessage
DEF_PORT = 10767
MESSAGE_READ_SIZE = 1024
HELP = HELPREQUEST.encode()

View File

@ -34,12 +34,12 @@ simplifications:
import time
import secop.protocol.dispatcher
import secop.errors
from secop.protocol.messages import DESCRIPTIONREPLY, ENABLEEVENTSREPLY, ERRORPREFIX, EVENTREPLY,\
READREQUEST, WRITEREQUEST, COMMANDREQUEST
import secop.client
import secop.errors
import secop.protocol.dispatcher
from secop.lib.multievent import MultiEvent
from secop.protocol.messages import COMMANDREQUEST, DESCRIPTIONREPLY, \
ENABLEEVENTSREPLY, ERRORPREFIX, EVENTREPLY, READREQUEST, WRITEREQUEST
class SecopClient(secop.client.SecopClient):

View File

@ -21,14 +21,15 @@
# *****************************************************************************
"""SECoP proxy modules"""
from secop.params import Parameter, Command
from secop.modules import Module, Writable, Readable, Drivable
from secop.client import SecopClient, decode_msg, encode_msg_frame
from secop.datatypes import StringType
from secop.errors import BadValueError, \
CommunicationFailedError, ConfigError, make_secop_error
from secop.lib import get_class
from secop.modules import Drivable, Module, Readable, Writable
from secop.params import Command, Parameter
from secop.properties import Property
from secop.stringio import HasIodev
from secop.lib import get_class
from secop.client import SecopClient, decode_msg, encode_msg_frame
from secop.errors import ConfigError, make_secop_error, CommunicationFailedError, BadValueError
class ProxyModule(HasIodev, Module):

View File

@ -23,12 +23,17 @@
# *****************************************************************************
"""Define helpers"""
import os
import ast
import time
import threading
import configparser
import os
import threading
import time
from collections import OrderedDict
from secop.errors import ConfigError
from secop.lib import formatException, get_class, getGeneralConfig
from secop.modules import Attached
try:
from daemon import DaemonContext
try:
@ -38,9 +43,6 @@ try:
except ImportError:
DaemonContext = None
from secop.errors import ConfigError
from secop.lib import formatException, get_class, getGeneralConfig
from secop.modules import Attached
try:
import systemd.daemon

View File

@ -29,7 +29,8 @@ from time import sleep
from secop.datatypes import FloatRange
from secop.lib import mkthread
from secop.modules import Drivable, Module, Parameter, Readable, Writable, BasicPoller
from secop.modules import BasicPoller, Drivable, \
Module, Parameter, Readable, Writable
class SimBase:

View File

@ -23,13 +23,17 @@
implements TCP/IP and is be used as a base for SerialIO
"""
import time
import threading
import re
import threading
import time
from secop.datatypes import ArrayOf, BoolType, \
FloatRange, StringType, TupleOf, ValueType
from secop.errors import CommunicationFailedError, \
CommunicationSilentError, ConfigError
from secop.lib.asynconn import AsynConn, ConnectionClosed
from secop.modules import Module, Communicator, Parameter, Command, Property, Attached, Done
from secop.datatypes import StringType, FloatRange, ArrayOf, BoolType, TupleOf, ValueType
from secop.errors import CommunicationFailedError, CommunicationSilentError, ConfigError
from secop.modules import Attached, Command, \
Communicator, Done, Module, Parameter, Property
from secop.poller import REGULAR

View File

@ -25,10 +25,9 @@ import random
import time
from math import atan
from secop.datatypes import EnumType, FloatRange, TupleOf, StringType, BoolType
from secop.datatypes import BoolType, EnumType, FloatRange, StringType, TupleOf
from secop.lib import clamp, mkthread
from secop.modules import Drivable, Parameter, Command
from secop.modules import Command, Drivable, Parameter
# test custom property (value.test can be changed in config file)
from secop.properties import Property

View File

@ -28,7 +28,9 @@ import time
from secop.datatypes import ArrayOf, BoolType, EnumType, \
FloatRange, IntRange, StringType, StructOf, TupleOf
from secop.lib.enum import Enum
from secop.modules import Drivable, Parameter as SECoP_Parameter, Readable
from secop.modules import Drivable
from secop.modules import Parameter as SECoP_Parameter
from secop.modules import Readable
from secop.properties import Property

View File

@ -31,7 +31,7 @@ import math
from secop.datatypes import ArrayOf, FloatRange, StringType, StructOf, TupleOf
from secop.errors import ConfigError, DisabledError
from secop.lib.sequence import SequencerMixin, Step
from secop.modules import Drivable, Parameter, BasicPoller
from secop.modules import BasicPoller, Drivable, Parameter
class GarfieldMagnet(SequencerMixin, Drivable):

View File

@ -30,18 +30,17 @@ MLZ TANGO interface for the respective device classes.
import re
import threading
from time import time as currenttime
from time import sleep
from time import time as currenttime
import PyTango
from secop.datatypes import ArrayOf, EnumType, \
FloatRange, IntRange, StringType, TupleOf, LimitsType
from secop.datatypes import ArrayOf, EnumType, FloatRange, \
IntRange, LimitsType, StringType, TupleOf
from secop.errors import CommunicationFailedError, \
ConfigError, HardwareError, ProgrammingError
from secop.lib import lazy_property
from secop.modules import Command, Drivable, \
Module, Parameter, Readable, BasicPoller
from secop.modules import BasicPoller, Command, \
Drivable, Module, Parameter, Readable
#####

View File

@ -20,7 +20,7 @@
# *****************************************************************************
"""Andeen Hagerling capacitance bridge"""
from secop.core import Readable, Parameter, FloatRange, HasIodev, StringIO, Done
from secop.core import Done, FloatRange, HasIodev, Parameter, Readable, StringIO
class Ah2700IO(StringIO):

View File

@ -22,7 +22,8 @@
"""drivers for CCU4, the cryostat control unit at SINQ"""
# the most common Frappy classes can be imported from secop.core
from secop.core import Readable, Parameter, FloatRange, EnumType, StringIO, HasIodev
from secop.core import EnumType, FloatRange, \
HasIodev, Parameter, Readable, StringIO
class CCU4IO(StringIO):

View File

@ -22,8 +22,8 @@
not tested yet"""
from secop.core import Writable, Module, Parameter, Attached,\
BoolType, FloatRange, EnumType, HasIodev, StringIO
from secop.core import Attached, BoolType, EnumType, FloatRange, \
HasIodev, Module, Parameter, StringIO, Writable
class K2601bIO(StringIO):

View File

@ -22,12 +22,13 @@
import time
from secop.modules import Readable, Drivable, Parameter, Property, Attached, Done
from secop.datatypes import FloatRange, IntRange, EnumType, BoolType
from secop.stringio import HasIodev
from secop.poller import Poller, REGULAR
from secop.lib import formatStatusBits
import secop.iohandler
from secop.datatypes import BoolType, EnumType, FloatRange, IntRange
from secop.lib import formatStatusBits
from secop.modules import Attached, Done, \
Drivable, Parameter, Property, Readable
from secop.poller import REGULAR, Poller
from secop.stringio import HasIodev
Status = Drivable.Status

View File

@ -22,6 +22,7 @@
from secop.modules import Communicator
class Ls370Sim(Communicator):
CHANNEL_COMMANDS = [
('RDGR?%d', '1.0'),

View File

@ -31,18 +31,18 @@ Polling of value and status is done commonly for all modules. For each registere
<module>.update_value_status() is called in order to update their value and status.
"""
import time
import threading
import time
from secop.modules import Readable, Drivable, Parameter,\
Communicator, Property, Attached, HasAccessibles, Done
from secop.datatypes import EnumType, FloatRange, IntRange, StringType,\
BoolType, StatusType
from secop.lib.enum import Enum
from secop.lib import clamp
from secop.errors import HardwareError
from secop.poller import Poller
import secop.iohandler
from secop.datatypes import BoolType, EnumType, \
FloatRange, IntRange, StatusType, StringType
from secop.errors import HardwareError
from secop.lib import clamp
from secop.lib.enum import Enum
from secop.modules import Attached, Communicator, Done, \
Drivable, HasAccessibles, Parameter, Property, Readable
from secop.poller import Poller
from secop.stringio import HasIodev
try:

View File

@ -18,9 +18,10 @@
# Module authors:
# Markus Zolliker <markus.zolliker@psi.ch>
# *****************************************************************************
import time
import json
import math
import time
def num(string):
return json.loads(string)

View File

@ -20,13 +20,14 @@
# *****************************************************************************
"""Software calibration"""
import os
from os.path import join, exists, basename
import math
import numpy as np
from scipy.interpolate import splrep, splev # pylint: disable=import-error
import os
from os.path import basename, exists, join
from secop.core import Readable, Parameter, Attached, StringType, BoolType
import numpy as np
from scipy.interpolate import splev, splrep # pylint: disable=import-error
from secop.core import Attached, BoolType, Parameter, Readable, StringType
def linear(x):

View File

@ -24,10 +24,11 @@
# no fixtures needed
import pytest
from secop.basic_validators import FloatProperty, PositiveFloatProperty, \
NonNegativeFloatProperty, IntProperty, PositiveIntProperty, \
NonNegativeIntProperty, BoolProperty, StringProperty, UnitProperty, \
FmtStrProperty, OneOfProperty, NoneOr, EnumProperty, TupleProperty
from secop.basic_validators import BoolProperty, EnumProperty, FloatProperty, \
FmtStrProperty, IntProperty, NoneOr, NonNegativeFloatProperty, \
NonNegativeIntProperty, OneOfProperty, PositiveFloatProperty, \
PositiveIntProperty, StringProperty, TupleProperty, UnitProperty
class unprintable:
def __str__(self):

View File

@ -25,9 +25,10 @@
# no fixtures needed
import pytest
from secop.datatypes import ArrayOf, BLOBType, BoolType, Enum, StatusType, \
DataType, EnumType, FloatRange, IntRange, ProgrammingError, ConfigError, \
ScaledInteger, StringType, TextType, StructOf, TupleOf, get_datatype, CommandType
from secop.datatypes import ArrayOf, BLOBType, BoolType, \
CommandType, ConfigError, DataType, Enum, EnumType, FloatRange, \
IntRange, ProgrammingError, ScaledInteger, StatusType, \
StringType, StructOf, TextType, TupleOf, get_datatype
def copytest(dt):

View File

@ -23,10 +23,11 @@
import pytest
from secop.datatypes import FloatRange, IntRange, Property, StringType
from secop.errors import ProgrammingError
from secop.iohandler import CmdParser, IOHandler
from secop.modules import Module, Parameter
from secop.datatypes import FloatRange, StringType, IntRange, Property
from secop.errors import ProgrammingError
@pytest.mark.parametrize('fmt, text, values, text2', [
('%d,%d', '2,3', [2,3], None),

View File

@ -23,13 +23,14 @@
"""test data types."""
import threading
import pytest
from secop.datatypes import BoolType, FloatRange, StringType
from secop.errors import ProgrammingError
from secop.modules import Communicator, Drivable, Module
from secop.params import Command, Parameter
from secop.poller import BasicPoller
from secop.errors import ProgrammingError
class DispatcherStub:

View File

@ -23,8 +23,8 @@
import pytest
from secop.protocol.interface import encode_msg_frame, decode_msg
import secop.protocol.messages as m
from secop.protocol.interface import decode_msg, encode_msg_frame
# args are: msg tuple, msg bytes
MSG = [

View File

@ -25,10 +25,10 @@
# no fixtures needed
import pytest
from secop.datatypes import BoolType, IntRange, FloatRange
from secop.params import Command, Parameter
from secop.modules import HasAccessibles
from secop.datatypes import BoolType, FloatRange, IntRange
from secop.errors import ProgrammingError
from secop.modules import HasAccessibles
from secop.params import Command, Parameter
def test_Command():

View File

@ -22,8 +22,8 @@
"""test data types."""
from collections import OrderedDict
from ast import literal_eval
from collections import OrderedDict
import pytest

View File

@ -23,9 +23,12 @@
import time
from collections import OrderedDict
import pytest
from secop.modules import Drivable
from secop.poller import Poller, REGULAR, DYNAMIC, SLOW
from secop.poller import DYNAMIC, REGULAR, SLOW, Poller
Status = Drivable.Status
class Time:

View File

@ -23,9 +23,9 @@
import pytest
from secop.datatypes import IntRange, StringType, FloatRange, ValueType
from secop.errors import ProgrammingError, ConfigError, BadValueError
from secop.properties import Property, HasProperties
from secop.datatypes import FloatRange, IntRange, StringType, ValueType
from secop.errors import BadValueError, ConfigError, ProgrammingError
from secop.properties import HasProperties, Property
def Prop(*args, name=None, **kwds):