This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignalMethodWrapper(object): | |
"""Object that can act simultaneously as a pyqtBoundSignal and as a callable | |
method. | |
It optionally allows to log deprecation messages whe used as a signal | |
or as a method or both | |
""" | |
def __init__(self, pyqtboundsignal, method, alt_sig=None, alt_meth=None, | |
name='<wrapper>'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4 import Qt | |
class Signaller(Qt.QObject): | |
signal = Qt.pyqtSignal() | |
class Base(object): | |
"""Base is not a QObject but provides a pyqtSignal signal member via | |
a Signaller hidden behind a property""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import numpy | |
import time | |
import sys | |
from multiprocessing import Process | |
FNAME = 'foo.h5' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#find trunks | |
find . -type d -iname trunk > /tmp/find-trunk.txt & | |
#filter paths | |
cat /tmp/find-trunk.txt | sed 's/\.\(.*\)\/trunk/\1/' > /tmp/paths.tst | |
# to make script | |
# sed 's/\.\(.*\)\/trunk/grep -v \1 \| \\/' > /tmp/filter.sh | |
# edit /tmp/filter.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import numpy | |
from taurus.external.qt import QtGui | |
from taurus.qt.qtgui.application import TaurusApplication | |
from taurus.qt.qtgui.base import TaurusBaseComponent | |
from pyqtgraph import PlotDataItem | |
class TaurusPlotDataItem(PlotDataItem, TaurusBaseComponent): | |
"""A taurus-ified PlotDataItem""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Examples on using the evaluation scheme for exposing icepap driver values | |
as taurus attributes | |
Note that: | |
- the first attribute is writable | |
- The second and 3rd attributes do not even require defining MyIpap | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from taurus.qt.qtgui.application import TaurusApplication | |
from taurus.qt.qtgui.plot import TaurusTrend | |
app = TaurusApplication() | |
w = TaurusTrend() | |
model = 'sys/tg_test/1/ampli' | |
w.setModel(model) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A nexus file summary tool implemented with h5py""" | |
import h5py | |
import sys | |
def print_dset(dset): | |
print '\t', dset | |
for k, v in sorted(dset.attrs.iteritems()): | |
print "\t\t@%s=%s" % (k,v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple example of using taurus eval scheme with pandas to | |
read a column of a CSV data file | |
""" | |
#create a dummy csv file with 2 columns with headers "x" and "y" | |
data=\ | |
''' | |
x,y | |
2,4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.optimize import curve_fit | |
def gauss(x, H, A, x0, sigma): | |
return H + A * np.exp(-(x - x0) ** 2 / (2 * sigma ** 2)) | |
def gauss_fit(x, y): |
OlderNewer