temfield_mpylab.TestSusceptibility¶
- class temfield_mpylab.TestSusceptibility.Measure(SearchPaths=None)[source]¶
Bases:
objectBase class for measurements.
- wait(delay, dct, uitester, intervall=0.1)[source]¶
A wait function that can be interrupted.
delay: seconds to wait
dct: namespace passed to legacy handler style
uitester: interrupt callback; supports
fn(dct)andfn()intervall: seconds to sleep between callback calls
Return: None
- out(item)[source]¶
Helper function for all output functions.
Prints item recursively all in one line.
The parameter item can be:
The return value is None.
- set_autosave_interval(interval)[source]¶
Set the intervall between auto save.
intervall: seconds between auto save
This method returns None.
- stdlogger(block, *args)[source]¶
The standard method to write messages to log file.
Print block to self.logfile or to stdout (if self.logfile is None). If block has attribute keys (i.e. is a
dict), the elements are processed with the local functionout_block(). Else, the block is printed directly.Parameter block: object to log
Return value: None
- stdUserMessenger(msg: str = 'Are you ready?', but: list[str] | None = None, level: str = '', dct: dict[Any, Any] | None = None) int[source]¶
The standard (default) method to present messages to the user.
The behaviour depends on the value of the parameter but. If len(but) (buttons are given) the funttions waits for a user answer. Else, the msg is presented only.
The function also calls all additional logger functions given in self.logger with the same arguments.
Parameters:
msg: message to display
but: sequence with the text strings of the buttons
level: to indicate something (not used in the standard logger)
dct: a
dictwith further parameters (not used in the standard logger)
Return value: the index of the selected button (starting from 0), or -1 if len(but) is False.
- static stdUserInterruptTester() int | None[source]¶
The standard (default) user interrupt tester.
Returns return value of
mpylab.util.anykeyevent()
- set_logfile(name)[source]¶
Tries to open a file with the given name with mode ‘a+’. If this fails, nothing will happen, else
stdloogger()will log to this file.Parameter name: full qualified name of the file to be used as logfile
Return: None
- set_logger(logger=None)[source]¶
Set up the list of logger fuctions (self.logger).
If logger is None,
stdlogger()is used.Parameter logger: list of functions called to log events
Return: None
- set_messenger(messenger)[source]¶
Set function to present messages.
Parameter messenger: the messenger (see
stdUserMessenger())Return: None
- set_user_interrupt_tester(tester)[source]¶
Set function to test for user interrupt.
Parameter tester: callable (see
stdUserInterruptTester()).Return: None
- set_user_interrupt_Tester(tester)[source]¶
Backward-compatible alias for
set_user_interrupt_tester().
- set_autosave(name)[source]¶
Setter for the class attribute asname (name of the auto save file).
Parameter name: file name oif the auto save file
Return: None
- do_autosave(name_or_obj=None, depth=None, prefixes=None)[source]¶
Serialize self using
pickle.Assuming a calling sequence like so:
script -> method of measurement class -> do_autosave
depth = 1 (default) will set self.ascmd to the command issued in the script.
If depth is too large, the outermost command is used.
Thus, the issued command in script is extracted and saved in self.ascmd. This can be used to redo the command after a crash.
Return: None
- static stdInteractiveSession(obj, banner)[source]¶
Default interactive session hook for terminal usage.
- setLevel(mg, level_or_names, level_or_leveler=None)[source]¶
Backward-compatible wrapper for legacy callers.
Supported call shapes: -
setLevel(mg, level_dBm)-setLevel(mg, level_dBm, leveler)-setLevel(mg, names_dict, level_dBm)(legacy TEM/Univers code)
- doLeveling(leveling, mg, names, dct)[source]¶
Backward-compatible no-op stub for removed legacy leveling API.
The legacy callers expect this method to exist and to return either a new level or
None. Current code path keeps behavior by returningNone.
- MakeDeslist(thedata, description)[source]¶
Backward-compatible wrapper around
make_deslist().
- MakeWhatlist(thedata, what)[source]¶
Backward-compatible wrapper around
make_whatlist().
- static std_eut_status_checker(status)[source]¶
Backward-compatible alias for
stdEutStatusChecker().