validate.notify#
Email the user when a run finishes, through the machine’s own mail system (sendmail).
The email carries only the run’s status and duration and where to find its files: the settings file (analysis.yaml), the folder holding it and the run’s outputs, and the error log when there were errors. No patient data or results. The address isn’t saved.
Functions
Path to sendmail, or None if this machine has none. |
|
|
e.g. "1 h 12 min 5 s", "3 min 20 s", "42 s". |
|
True if address is a single plain email address (e.g. name@example.org). |
|
The notification email for a finished run. |
|
Hand message to the machine's mail system (sendmail). |
- validate.notify.isValidAddress(address)[source]#
True if address is a single plain email address (e.g. name@example.org).
- validate.notify.runEmail(address, tab, succeeded, reason, seconds, analysisDir, settingsFile, errorLogPath=None)[source]#
The notification email for a finished run.
- Parameters:
address (str) – recipient.
tab (str) – the run’s tab, e.g. “Segment”.
succeeded (bool) – True if the run finished with no errors.
reason (str or None) – why the status is error (e.g. “2 of 20 patients failed”).
seconds (float) – run time.
analysisDir (str) – the analysis folder.
settingsFile (str) – file name of the settings in analysisDir (analysis.yaml).
errorLogPath (str or None) – the run’s error log, listed when the status is error.
- Returns:
email.message.EmailMessage