Commit ed365f0f authored by Cyril Guilloud's avatar Cyril Guilloud

attempt to remove failing imports...

parent c8edbb53
Pipeline #11648 passed with stages
in 35 minutes and 45 seconds
......@@ -18,7 +18,7 @@ import gevent
import json
from bliss.common.utils import OrderedDict
from collections import OrderedDict
try:
import sps
......
......@@ -42,10 +42,10 @@ def get_interface(*args, **kwargs):
Useful to use in an `__init__` to parse arguments and keyword arguments
with interface connection. Example of usage::
from ... import BaseDevice
?????? from ... import BaseDevice
from bliss.comm.util import get_interface
class Lecroy(BaseDevice):
class Lecroy(?????? BaseDevice):
def __init__(self, *args, **kwargs):
interface, args, kwargs = get_interface(*args, **kwargs)
......
......@@ -237,7 +237,7 @@ class MemoryInterface(BaseCardInterface):
method:`BaseCard.dump_memory()` as argument to construct
this object and then create a card object. Example::
from bliss.controllers.ct2 import P201Card, MemoryInterface
from bliss.controllers.ct2.card import P201Card, MemoryInterface
real_card = P201Card()
memory = real_card.dump_memory()
......
......@@ -14,7 +14,7 @@ from . import pi_gcs
from bliss.comm import tcp
from bliss.common import event
from PI_E51X import PI_E51X
from .pi_e51x import PI_E51X
"""
Bliss controller for ethernet PI E518 piezo controller.
......
......@@ -10,7 +10,8 @@ from math import cos, radians
from numpy import arange
from bliss.controllers.motor import Controller
from bliss.controllers import motor_settings as settings
import bliss.common.motor_settings as settings
from bliss.common.axis import AxisState
from bliss.common.task import task
......
......@@ -8,7 +8,7 @@
from bliss.common.cleanup import cleanup, error_cleanup
from bliss.common.task import task
from bliss.common.measurement import SamplingCounter
from bliss.common import Actuator
from bliss.common import AbstractActuator as Actuator
from bliss.comm.Exporter import *
import time
import numpy
......
......@@ -6,7 +6,8 @@
# Distributed under the GNU LGPLv3. See LICENSE for more info.
from StaubCom import robot
from bliss.common.utils import grouped, subprocess
from bliss.common.utils import grouped
from bliss.common import subprocess
from bliss.common.task import task
from bliss.common.cleanup import cleanup, error_cleanup
from bliss.config import static as static_config
......
......@@ -4,7 +4,7 @@ Example usage:
import sys
from PyQt5.QtWidgets import QApplication
from qgevent import set_gevent_dispatcher
from bliss.flint.qgevent import set_gevent_dispatcher
if __name__ == '__main__':
set_gevent_dispatcher()
......
......@@ -56,7 +56,7 @@ class MyClass():
if AA and not BB:
type(e.titi)
print('\033[31;42m salut')
from NameSpace import FF
from multiprocessing import Process
pass
def my_func():
PythonRepl.__class__();print('dddD') ; # fdslkfjsd
......
......@@ -11,7 +11,9 @@ from bliss.tango import db_access as local_db_access
def main(args=None):
# Give priority to the bliss db_access module
db_access.__path__ = local_db_access.__path__ + db_access.__path__
# Safety check
# Safety check ???
# does not load ?
from tango.databaseds.db_access import beacon
assert beacon.__file__.startswith(local_db_access.__path__[0])
......
......@@ -219,7 +219,6 @@ cards:
from bliss.common.event import dispatcher
from bliss.config.static import get_config
from bliss.controllers.ct2.client import CT2
from bliss.controllers.ct2.device import AcqMode, AcqStatus, StatusSignal
config = get_config()
......
......@@ -64,7 +64,7 @@ each object
* finally, the created object is returned in a dictionary indexed by the object name
```py
from bliss/config.plugins.utils import find_class, replace_reference_by_object
from bliss.config.plugins.utils import find_class, replace_reference_by_object
def create_objects_from_config_node(config, cfg_node):
item_cfg_node = cfg_node.deep_copy()
......
......@@ -28,7 +28,7 @@ The set of masters and slaves acquisition objects is called an
a new Bliss scan:
```python
from bliss.common.continuous_scan import AcquisitionChain
from bliss.scanning.chain import AcquisitionChain
chain = AcquisitionChain()
```
......@@ -44,7 +44,7 @@ capable of triggering slaves at evenly spaced points between a start and
an end position.
```python
from bliss.acquisition.motor import SoftwarePositionTriggerMaster
from bliss.scanning.acquisition.motor import SoftwarePositionTriggerMaster
emotion_master = SoftwarePositionTriggerMaster(m0, 5, 10, 10, time=5)
```
......@@ -118,6 +118,9 @@ identified by its name. Typically, a container will have a sample name,
an each scan on this sample can be stored inside the container.
`Container` objects can be nested without limitation.
??? no more data_manager...
```python
from bliss.common.data_manager import Container, Scan
......
......@@ -15,11 +15,11 @@ import logging
import gevent
from bliss.comm.gpib import Gpib, TMO_MAP
from bliss.comm.scpi import Scpi
from bliss.comm.scpi import SCPI
def test_scpi(interface):
scpi = Scpi(interface=interface)
scpi = SCPI(interface=interface)
return scpi["*IDN"]
......
#!/usr/bin/env python
'''
"""
A script to see which are the most commonly used commands in a spec session
'''
"""
import os
import sys
......@@ -10,27 +10,9 @@ import argparse
import subprocess
import collections
# no collections.Counter on python 2.6
try:
Counter = collections.Counter
except AttributeError:
import backport_collections
Counter = backport_collections.Counter
# no subprocess.check_output on python 2.6
try:
check_output = subprocess.check_output
except AttributeError:
def check_output(*args, **kwargs):
p = subprocess.Popen(stdout=subprocess.PIPE, *args, **kwargs)
out, err = p.communicate()
ret = p.poll()
if ret:
cmd = args[0]
err = subprocess.CalledProcessError(ret, cmd)
err.output = output
raise err
return out
Counter = collections.Counter
check_output = subprocess.check_output
def is_int(s):
......@@ -40,10 +22,12 @@ def is_int(s):
except ValueError:
return False
filter = b'for', b'print', b'while'
filter = b"for", b"print", b"while"
def count(history):
lines = (line.strip() for line in history.split(b'\n')) # history lines
lines = (line.strip() for line in history.split(b"\n")) # history lines
lines = (line.split() for line in lines) # history line tuples
lines = (line for line in lines if line and is_int(line[0])) # only command lines
cmds = (line[1] for line in lines if len(line) > 1)
......@@ -59,7 +43,7 @@ def gui(counter, n=None):
cmds, counts = zip(*most_common)
indexes = numpy.arange(len(cmds))
width=0.7
width = 0.7
plot.bar(indexes, counts, width)
plot.xticks(indexes + width * 0.5, cmds)
plot.show()
......@@ -67,25 +51,31 @@ def gui(counter, n=None):
def console(counter, n=None):
import pprint
most_common = counter.most_common(n)
cmds, counts = zip(*most_common)
pprint.pprint(most_common)
def main():
beamline = os.environ.get('BEAMLINENAME', 'ID00')
user = 'op' + beamline.lower()
parser = argparse.ArgumentParser(description='spec history histogram')
parser.add_argument('session', type=str, help='name of the spec session')
parser.add_argument('-n', default=None, type=int,
help='most common N commads [default is None, meaning all]')
parser.add_argument('--user', type=str, default=user,
help='user [default is ' + user + ']')
parser.add_argument('--no-gui', action='store_true')
beamline = os.environ.get("BEAMLINENAME", "ID00")
user = "op" + beamline.lower()
parser = argparse.ArgumentParser(description="spec history histogram")
parser.add_argument("session", type=str, help="name of the spec session")
parser.add_argument(
"-n",
default=None,
type=int,
help="most common N commads [default is None, meaning all]",
)
parser.add_argument(
"--user", type=str, default=user, help="user [default is " + user + "]"
)
parser.add_argument("--no-gui", action="store_true")
args = parser.parse_args()
show_state = 'show_state', '+h', '-g', args.session, '-u', args.user
show_state = "show_state", "+h", "-g", args.session, "-u", args.user
history = check_output(show_state)
counter = count(history)
......@@ -94,6 +84,5 @@ def main():
show(counter, args.n)
if __name__ == '__main__':
if __name__ == "__main__":
main()
......@@ -18,7 +18,7 @@ sys.path.insert(
)
import bliss
from bliss.common.axis import READY, MOVING
from bliss.common.axis import AxisState
config_xml = """
<config>
......@@ -73,7 +73,7 @@ class TestNewFocus(unittest.TestCase):
def testState(self):
a1 = bliss.get_axis("a1")
self.assertEqual(a1.state, READY)
self.assertEqual(a1.state, AxisState.READY)
def testSimultaneousMove(self):
a1 = bliss.get_axis("a1")
......
......@@ -10,7 +10,7 @@ import random
import pytest
import numpy.random
from bliss.controller.speedgoat import xpc
from bliss.controllers.speedgoat import xpc
pytestmark = pytest.mark.speedgoat
......
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