Ensures a proper boolean value (even from a string). Raises UsageError on failure
Ensures a proper floating-point value. Raises UsageError if not
Ensures a proper integer value (from a string). Raises UsageError if not
Ctrl-C is hit
desired_value is reached (if numeric, within desired_epsilon)
The timeout value is reached
The timeout event is triggered (a threading.Event instance)
The update callback function returns False
Stop condition value can be a tuple/list, such that the full set of conditions should be followed in order.
Was the monitor cancelled?
The factor by which desired_value can differ from the actual value
The desired value to reach, after which the monitor can stop
The main PV
Stop monitoring and waiting.
The PV to monitor for a stop condition
Stop PV value updated callback
PV value updated callback
Waits for the conditions in ConditionalMonitor.__doc__
Raises TimeoutError
Simple decorator to indicate the function should be exported to the user namespace
ECLI exported function
Decorator for (optionally) showing elapsed times of commands.
(decorator) Use the user namespace in IPython to evaluate each argument
Parameters: | fcn – The function to decorate |
---|
(decorator) Expand aliases in a command
Parameters: |
|
---|
(decorator) Allows exported functions to be called in a simple fashion:
Parameters: | fcn – The function to decorate |
---|
If the device is an epics.Device instance, return just the PV.
Returns: | a PV, or raises UsageError if invalid |
---|
Like get_record_from_device but accepts a list of devices/records.
Get the user limits, given a motor record
Get the associated (user) readback-value PV from a given motor record.
Get the record type
Is rec an actual motor record?
Is rec an actual sscan record?
Used for magic_arguments (argparse), it allows for automatic expansion of PV aliases
For magic arguments, sets a minimum number/maximum number of arguments. Partly from http://stackoverflow.com/questions/4194948
alias of RequiredLength
Functions of a class instance that are decorated with specific decorators will be exported to the user in IPython.
Parameters: |
|
---|
Functions that are decorated with specific decorators will be exported to the user in IPython.
Parameters: |
|
---|
Functions/classes/etc that start with prefix will be exported (i.e., accessible in ipython) to the user namespace
Parameters: |
|
---|
Redirects an output stream to a callback functions
Clear the current line of text on the terminal.
Edit a file with the system’s default editor.
Parameters: |
|
---|
No spaces for SPS ‘axistitles’ No commas for SPS ‘plotlist’
Assuming a sequence of string lists: calculate the maximum width of each column, and generate a format string so all lines can be printed neatly in a tabular format.
Where each line has the same number of items, and each item supports a conversion to string, calculate the maximum width of each column, and return it as a list.
Expects a (tab) delimited file with the first row being a header (column names) Lines starting with # are ignored (after the first row) Raises ValueError if main column not present
For example:
Field name1 name2
field_1 value1 value2
...
Returns a dictionary:
{ 'field_1' : { 'name1' : 'value1', 'name2' : 'value2', ... }, ... }
Print text on the same line (same arguments as the Python print function)
Not to be confused with the SimpleTable class, this prints out a table stored as a list of lists:
[['row1, 1', 'row1, 2', '...'], ['row2', ...'], ...]
Parameters: |
|
---|---|
Returns: | the printed rows |
Dump a text traceback from the last exception to the file specified
Parameters: |
|
---|
From a list of rows, remove columns by index
Parameters: |
|
---|
From a list of rows, remove empty columns.
Parameters: |
|
---|
Inefficiently manages record field information, loaded from text files located in records/*.txt (relative to this file)
Find “text” in any column or field name
From the detailed information in the database, return a simplified one containing only the main keys and the specified field(s).
Get the RecordFields instance associated with the specific record type (rtyp) – e.g., ‘motor’ or ‘ai’
Note
As the RecordFields instances are cached, users should use this function instead of instantiating their own.
A simple, inefficient representation of a table, where data is stored by column. Column header text must be unique.
Add a column with a header before index in the table, filling its contents with fill.
Parameters: |
|
---|
Insert a row at a specific index (default is to append)
Parameters: |
|
---|
Get the index of a column header in the table
Get the indices of column headers in the table
(generator) Gives all columns in the table, optionally including headers or removing empty columns.
Parameters: |
|
---|
(static method) Create a SimpleTable from column data
Parameters: |
|
---|
kwargs are passed onto the table constructor
(static method) Create a SimpleTable from row data
Parameters: |
|
---|
kwargs are passed onto the table constructor
All of the row data, including the header row
The column headers [list]
Insert a row at a specific index (default is to append)
Parameters: |
|
---|
Print the table to a stream (default: stdout) with a specific format
Parameters: |
|
---|
Remove a column by index
Remove multiple columns by index
Remove all empty columns
Remove a row by index
All of the row data, including the header row
Note
(TODO) this needs to be converted to a SimpleTable someday
Format the pv info from get_structured_pv_info(), for usage with print_table
For a dictionary like the following with a prefix of ‘PV’:
get_structured_pv_info(
{ 'User' : {
'High' : '.HLM',
'Current' : '.RBV',
'Low' : '.LLM',
} ,
}, prefix='PV')
The result would look like:
{
'User' : {
'High' : 2.0, # <-- caget PV.HLM = 2.0
'Current' : 1.0, # <-- caget PV.RBV = 1.0
'Low' : 0.0, # <-- caget PV.RBV = 0.0
} ,
}
prefix can also be a list (or sequence), and the result would then be:
return {
'User' : {
'High' : [1, 2, 3, ...]
}
}
Print the structured pv info in a table